本文整理汇总了Java中org.embulk.config.ConfigLoader类的典型用法代码示例。如果您正苦于以下问题:Java ConfigLoader类的具体用法?Java ConfigLoader怎么用?Java ConfigLoader使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
ConfigLoader类属于org.embulk.config包,在下文中一共展示了ConfigLoader类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: config
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
/**
* Load plugin config with Guava & Joda support
*/
private static ConfigSource config()
{
String path = System.getenv("EMBULK_OUTPUT_MAILCHIMP_TEST_CONFIG");
assumeThat(isNullOrEmpty(path), is(false));
try {
ObjectMapper mapper = new ObjectMapper()
.registerModule(new GuavaModule())
.registerModule(new JodaModule());
ConfigLoader configLoader = new ConfigLoader(new ModelManager(null, mapper));
return configLoader.fromYamlFile(new File(path));
}
catch (IOException ex) {
throw Throwables.propagate(ex);
}
}
示例2: loadConfigSource
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
private ConfigSource loadConfigSource(String yamlPath)
{
try {
ConfigLoader loader = new ConfigLoader(Exec.getModelManager());
InputStream stream = Thread.currentThread().getContextClassLoader().getResourceAsStream(yamlPath);
return loader.fromYaml(stream);
}
catch (IOException e) {
throw Throwables.propagate(e);
}
}
示例3: taskFromYamlString
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
private PluginTask taskFromYamlString(String... lines)
{
StringBuilder builder = new StringBuilder();
for (String line : lines) {
builder.append(line).append("\n");
}
String yamlString = builder.toString();
ConfigLoader loader = new ConfigLoader(Exec.getModelManager());
ConfigSource config = loader.fromYamlString(yamlString);
return config.loadConfig(PluginTask.class);
}
示例4: configFromYamlString
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
private ConfigSource configFromYamlString(String... lines)
{
StringBuilder builder = new StringBuilder();
for (String line : lines) {
builder.append(line).append("\n");
}
String yamlString = builder.toString();
ConfigLoader loader = new ConfigLoader(Exec.getModelManager());
return loader.fromYamlString(yamlString);
}
示例5: setUp
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
leadWithListInputPlugin = Mockito.spy(new LeadWithListInputPlugin());
ConfigLoader configLoader = embulkTestRuntime.getInjector().getInstance(ConfigLoader.class);
configSource = configLoader.fromYaml(this.getClass().getResourceAsStream("/config/rest_config.yaml"));
mockMarketoRestClient = Mockito.mock(MarketoRestClient.class);
Mockito.doReturn(mockMarketoRestClient).when(leadWithListInputPlugin).createMarketoRestClient(any(LeadWithListInputPlugin.PluginTask.class));
}
示例6: setUp
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
campaignInputPlugin = Mockito.spy(new CampaignInputPlugin());
ConfigLoader configLoader = embulkTestRuntime.getInjector().getInstance(ConfigLoader.class);
configSource = configLoader.fromYaml(this.getClass().getResourceAsStream("/config/rest_config.yaml"));
mockMarketoRestClient = Mockito.mock(MarketoRestClient.class);
Mockito.doReturn(mockMarketoRestClient).when(campaignInputPlugin).createMarketoRestClient(Mockito.any(CampaignInputPlugin.PluginTask.class));
}
示例7: prepare
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
@Before
public void prepare() throws IOException
{
bulkExtractInputPlugin = Mockito.spy(new LeadBulkExtractInputPlugin());
ConfigLoader configLoader = embulkTestRuntime.getInjector().getInstance(ConfigLoader.class);
configSource = configLoader.fromYaml(this.getClass().getResourceAsStream("/config/lead_bulk_extract_config.yaml"));
mockMarketoRestclient = Mockito.mock(MarketoRestClient.class);
Mockito.doReturn(mockMarketoRestclient).when(bulkExtractInputPlugin).createMarketoRestClient(any(LeadBulkExtractInputPlugin.PluginTask.class));
}
示例8: setUp
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
@Before
public void setUp() throws Exception
{
leadWithProgramInputPlugin = Mockito.spy(new LeadWithProgramInputPlugin());
ConfigLoader configLoader = embulkTestRuntime.getInjector().getInstance(ConfigLoader.class);
configSource = configLoader.fromYaml(this.getClass().getResourceAsStream("/config/rest_config.yaml"));
mockMarketoRestClient = Mockito.mock(MarketoRestClient.class);
Mockito.doReturn(mockMarketoRestClient).when(leadWithProgramInputPlugin).createMarketoRestClient(any(LeadWithProgramInputPlugin.PluginTask.class));
}
示例9: prepare
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
@Before
public void prepare() throws IOException
{
baseBulkExtractInputPlugin = Mockito.mock(MarketoBaseBulkExtractInputPlugin.class, Mockito.CALLS_REAL_METHODS);
ConfigLoader configLoader = embulkTestRuntime.getInjector().getInstance(ConfigLoader.class);
ConfigSource configSource = configLoader.fromYaml(
this.getClass().getResourceAsStream("/config/activity_bulk_extract_config.yaml"));
validBaseTask = configSource.loadConfig(MarketoBaseBulkExtractInputPlugin.PluginTask.class);
}
开发者ID:treasure-data,项目名称:embulk-input-marketo,代码行数:10,代码来源:MarketoBaseBulkExtractInputPluginTest.java
示例10: prepare
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
@Before
public void prepare() throws IOException
{
activityBulkExtractInputPlugin = Mockito.spy(new ActivityBulkExtractInputPlugin());
ConfigLoader configLoader = embulkTestRuntime.getInjector().getInstance(ConfigLoader.class);
configSource = configLoader.fromYaml(this.getClass().getResourceAsStream("/config/activity_bulk_extract_config.yaml"));
mockMarketoRestclient = Mockito.mock(MarketoRestClient.class);
Mockito.doReturn(mockMarketoRestclient).when(activityBulkExtractInputPlugin).createMarketoRestClient(any(ActivityBulkExtractInputPlugin.PluginTask.class));
}
示例11: getConfigFromYamlFile
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
private ConfigSource getConfigFromYamlFile(File yamlFile)
throws IOException
{
ConfigLoader loader = new ConfigLoader(Exec.getModelManager());
return loader.fromYamlFile(yamlFile);
}
示例12: getConfigFromYaml
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
private ConfigSource getConfigFromYaml(String yaml)
{
ConfigLoader loader = new ConfigLoader(Exec.getModelManager());
return loader.fromYamlString(yaml);
}
示例13: getConfigLoader
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
public ConfigLoader getConfigLoader() {
if (configLoader == null) {
configLoader = getEmbulkEmbed().newConfigLoader();
}
return configLoader;
}
示例14: loadConfigFromYaml
import org.embulk.config.ConfigLoader; //导入依赖的package包/类
private ConfigSource loadConfigFromYaml(String yaml)
{
ConfigLoader loader = new ConfigLoader(runtime.getModelManager());
return loader.fromYamlString(yaml);
}