本文整理汇总了Java中org.embulk.config.ConfigSource.set方法的典型用法代码示例。如果您正苦于以下问题:Java ConfigSource.set方法的具体用法?Java ConfigSource.set怎么用?Java ConfigSource.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.embulk.config.ConfigSource
的用法示例。
在下文中一共展示了ConfigSource.set方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testForumlaReplace
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
@Theory
public void testForumlaReplace(String excelFile) throws ParseException {
try (EmbulkPluginTester tester = new EmbulkPluginTester()) {
tester.addParserPlugin(PoiExcelParserPlugin.TYPE, PoiExcelParserPlugin.class);
EmbulkTestParserConfig parser = tester.newParserConfig(PoiExcelParserPlugin.TYPE);
parser.set("sheet", "formula_replace");
ConfigSource replace0 = tester.newConfigSource();
replace0.set("regex", "test1");
replace0.set("to", "merged_cell");
ConfigSource replace1 = tester.newConfigSource();
replace1.set("regex", "B1");
replace1.set("to", "B${row}");
parser.set("formula_replace", Arrays.asList(replace0, replace1));
parser.addColumn("text", "string");
URL inFile = getClass().getResource(excelFile);
List<OutputRecord> result = tester.runParser(inFile, parser);
assertThat(result.size(), is(2));
assertThat(result.get(0).getAsString("text"), is("test3-a1"));
assertThat(result.get(1).getAsString("text"), is("test2-b2"));
}
}
示例2: prepare
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
@Before
public void prepare()
{
ConfigSource configSource = embulkTestRuntime.getExec().newConfigSource();
configSource.set("account_id", TEST_ACCOUNT_ID);
configSource.set("client_secret", TEST_CLIENT_SECRET);
configSource.set("client_id", TEST_CLIENT_ID);
configSource.set("max_return", 2);
MarketoRestClient.PluginTask task = configSource.loadConfig(MarketoRestClient.PluginTask.class);
mockRetryHelper = Mockito.mock(Jetty92RetryHelper.class);
MarketoRestClient realRestClient = new MarketoRestClient(task, mockRetryHelper);
marketoRestClient = Mockito.spy(realRestClient);
}
示例3: testHdfsFileInputByOpen
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
@Test
public void testHdfsFileInputByOpen()
{
ConfigSource config = getConfigWithDefaultValues();
config.set("num_partitions", 10);
config.set("decompression", true);
runner.transaction(config, new Control());
assertRecords(config, output, 12);
}
示例4: testHdfsFileInputByOpenWithoutPartition
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
@Test
public void testHdfsFileInputByOpenWithoutPartition()
{
ConfigSource config = getConfigWithDefaultValues();
config.set("partition", false);
config.set("decompression", true);
runner.transaction(config, new Control());
assertRecords(config, output, 12);
}
示例5: testHdfsFileInputByOpenWithoutCompressionCodec
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
@Test
public void testHdfsFileInputByOpenWithoutCompressionCodec()
{
ConfigSource config = getConfigWithDefaultValues();
config.set("partition", false);
config.set("path", getClass().getResource("/sample_01.csv").getPath());
runner.transaction(config, new Control());
assertRecords(config, output, 4);
}
示例6: testStrftime
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
@Test
public void testStrftime()
{
ConfigSource config = getConfigWithDefaultValues();
config.set("path", "/tmp/%Y-%m-%d");
config.set("rewind_seconds", 86400);
PluginTask task = config.loadConfig(PluginTask.class);
String result = new Strftime(task).format(task.getPath());
String expected = task.getJRuby().runScriptlet("(Time.now - 86400).strftime('/tmp/%Y-%m-%d')").toString();
assertEquals(expected, result);
}
示例7: runParser
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
public List<OutputRecord> runParser(File inFile, EmbulkTestParserConfig parser) {
ConfigSource in = newConfigSource();
in.set("type", "file");
in.set("path_prefix", inFile.getAbsolutePath());
in.set("parser", parser);
return runInput(in);
}
示例8: runInput
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
public List<OutputRecord> runInput(ConfigSource in) {
ConfigSource out = newConfigSource();
out.set("type", EmbulkTestOutputPlugin.TYPE);
embulkTestOutputPlugin.clearResult();
run(in, out);
return embulkTestOutputPlugin.getResult();
}
示例9: run
import org.embulk.config.ConfigSource; //导入方法依赖的package包/类
public void run(ConfigSource in, ConfigSource out) {
ConfigSource config = newConfigSource();
config.set("in", in);
config.set("out", out);
run(config);
}