|
5 | 5 | import org.embulk.EmbulkTestRuntime;
|
6 | 6 | import org.embulk.config.ConfigException;
|
7 | 7 | import org.embulk.config.ConfigSource;
|
8 |
| -import org.embulk.config.TaskReport; |
9 |
| -import org.embulk.config.TaskSource; |
10 | 8 | import org.embulk.spi.Exec;
|
11 |
| -import org.embulk.spi.FileInputRunner; |
12 |
| -import org.embulk.spi.InputPlugin; |
13 |
| -import org.embulk.spi.Schema; |
14 |
| -import org.embulk.spi.TestPageBuilderReader; |
15 | 9 | import org.junit.Before;
|
16 |
| -import org.junit.BeforeClass; |
17 | 10 | import org.junit.Rule;
|
18 | 11 | import org.junit.Test;
|
19 | 12 |
|
20 | 13 | import java.security.NoSuchAlgorithmException;
|
21 | 14 | import java.security.SecureRandom;
|
22 |
| -import java.util.List; |
23 | 15 |
|
24 | 16 | import static org.embulk.input.s3.TestS3FileInputPlugin.parserConfig;
|
25 | 17 | import static org.embulk.input.s3.TestS3FileInputPlugin.schemaConfig;
|
26 |
| -import static org.junit.Assert.*; |
27 |
| -import static org.junit.Assume.assumeNotNull; |
| 18 | +import static org.junit.Assert.assertEquals; |
28 | 19 |
|
29 | 20 | /**
|
30 | 21 | * Created by takahiro.nakayama on 3/30/16.
|
31 | 22 | */
|
32 | 23 | public class TestClientConfigurationConfigurable
|
33 | 24 | {
|
34 |
| - private static String EMBULK_S3_TEST_BUCKET; |
35 |
| - private static String EMBULK_S3_TEST_ACCESS_KEY_ID; |
36 |
| - private static String EMBULK_S3_TEST_SECRET_ACCESS_KEY; |
37 |
| - private static final String EMBULK_S3_TEST_PATH_PREFIX = "embulk_input_s3_test"; |
38 |
| - |
39 |
| - /* |
40 |
| - * This test case requires environment variables: |
41 |
| - * EMBULK_S3_TEST_BUCKET |
42 |
| - * EMBULK_S3_TEST_ACCESS_KEY_ID |
43 |
| - * EMBULK_S3_TEST_SECRET_ACCESS_KEY |
44 |
| - * If the variables not set, the test case is skipped. |
45 |
| - */ |
46 |
| - @BeforeClass |
47 |
| - public static void initializeConstantVariables() |
48 |
| - { |
49 |
| - EMBULK_S3_TEST_BUCKET = System.getenv("EMBULK_S3_TEST_BUCKET"); |
50 |
| - EMBULK_S3_TEST_ACCESS_KEY_ID = System.getenv("EMBULK_S3_TEST_ACCESS_KEY_ID"); |
51 |
| - EMBULK_S3_TEST_SECRET_ACCESS_KEY = System.getenv("EMBULK_S3_TEST_SECRET_ACCESS_KEY"); |
52 |
| - assumeNotNull(EMBULK_S3_TEST_BUCKET, EMBULK_S3_TEST_ACCESS_KEY_ID, EMBULK_S3_TEST_SECRET_ACCESS_KEY); |
53 |
| - } |
54 |
| - |
55 | 25 | @Rule
|
56 | 26 | public EmbulkTestRuntime runtime = new EmbulkTestRuntime();
|
57 | 27 |
|
58 | 28 | private S3FileInputPlugin plugin;
|
59 | 29 | private ConfigSource config;
|
60 |
| - private FileInputRunner runner; |
61 |
| - private TestPageBuilderReader.MockPageOutput output; |
62 | 30 |
|
63 | 31 | @Before
|
64 | 32 | public void createResources()
|
65 | 33 | {
|
66 | 34 | plugin = new S3FileInputPlugin();
|
67 | 35 | config = runtime.getExec().newConfigSource()
|
68 | 36 | .set("type", "s3")
|
69 |
| - .set("bucket", EMBULK_S3_TEST_BUCKET) |
70 |
| - .set("path_prefix", EMBULK_S3_TEST_PATH_PREFIX) |
| 37 | + .set("bucket", "dummy") |
| 38 | + .set("path_prefix", "dummy") |
71 | 39 | .set("parser", parserConfig(schemaConfig()));
|
72 |
| - runner = new FileInputRunner(runtime.getInstance(S3FileInputPlugin.class)); |
73 |
| - output = new TestPageBuilderReader.MockPageOutput(); |
74 | 40 | }
|
75 | 41 |
|
76 | 42 | @Test
|
|
0 commit comments