Search in sources :

Example 1 with DataSource

use of org.embulk.config.DataSource in project embulk by embulk.

the class TestCsvGuessPlugin method assertGuessByResource.

static void assertGuessByResource(TestingEmbulk embulk, String seedYamlResourceName, String sourceCsvResourceName, String resultResourceName) throws IOException {
    ConfigSource seed = embulk.loadYamlResource(RESOURCE_NAME_PREFIX + seedYamlResourceName);
    ConfigDiff guessed = embulk.parserBuilder().parser(seed).exec(embulk.newConfig().set("exclude_guess_plugins", ImmutableList.of("json"))).inputResource(RESOURCE_NAME_PREFIX + sourceCsvResourceName).guess();
    assertThat(guessed, is((DataSource) embulk.loadYamlResource(RESOURCE_NAME_PREFIX + resultResourceName)));
}
Also used : ConfigSource(org.embulk.config.ConfigSource) ConfigDiff(org.embulk.config.ConfigDiff) DataSource(org.embulk.config.DataSource)

Example 2 with DataSource

use of org.embulk.config.DataSource in project embulk by embulk.

the class TestCsvAllStringsGuessPlugin method testSimple.

@Test
public void testSimple() throws Exception {
    ConfigSource exec = embulk.newConfig().set("guess_plugins", ImmutableList.of("csv_all_strings")).set("exclude_guess_plugins", ImmutableList.of("csv"));
    ConfigDiff guessed = embulk.parserBuilder().exec(exec).inputResource(RESOURCE_NAME_PREFIX + "test_simple.csv").guess();
    assertThat(guessed, is((DataSource) embulk.loadYamlResource(RESOURCE_NAME_PREFIX + "test_simple_guessed.yml")));
}
Also used : ConfigSource(org.embulk.config.ConfigSource) ConfigDiff(org.embulk.config.ConfigDiff) DataSource(org.embulk.config.DataSource) Test(org.junit.Test)

Aggregations

ConfigDiff (org.embulk.config.ConfigDiff)2 ConfigSource (org.embulk.config.ConfigSource)2 DataSource (org.embulk.config.DataSource)2 Test (org.junit.Test)1