当前位置: 首页>>代码示例>>Java>>正文


Java ConfigSource.set方法代码示例

本文整理汇总了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"));
	}
}
 
开发者ID:hishidama,项目名称:embulk-parser-poi_excel,代码行数:27,代码来源:TestPoiExcelParserPlugin_formula.java

示例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);
}
 
开发者ID:treasure-data,项目名称:embulk-input-marketo,代码行数:14,代码来源:MarketoRestClientTest.java

示例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);
}
 
开发者ID:civitaspo,项目名称:embulk-input-hdfs,代码行数:10,代码来源:TestHdfsFileInputPlugin.java

示例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);
}
 
开发者ID:civitaspo,项目名称:embulk-input-hdfs,代码行数:10,代码来源:TestHdfsFileInputPlugin.java

示例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);
}
 
开发者ID:civitaspo,项目名称:embulk-input-hdfs,代码行数:10,代码来源:TestHdfsFileInputPlugin.java

示例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);
}
 
开发者ID:civitaspo,项目名称:embulk-input-hdfs,代码行数:12,代码来源:TestHdfsFileInputPlugin.java

示例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);
}
 
开发者ID:hishidama,项目名称:embulk-parser-poi_excel,代码行数:8,代码来源:EmbulkPluginTester.java

示例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();
}
 
开发者ID:hishidama,项目名称:embulk-parser-poi_excel,代码行数:9,代码来源:EmbulkPluginTester.java

示例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);
}
 
开发者ID:hishidama,项目名称:embulk-parser-poi_excel,代码行数:7,代码来源:EmbulkPluginTester.java


注:本文中的org.embulk.config.ConfigSource.set方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。