use of org.apache.camel.component.dataset.DataSetComponent in project camel by apache.
the class DataSetComponentAutoConfiguration method configureDataSetComponent.
@Lazy
@Bean(name = "dataset-component")
@ConditionalOnClass(CamelContext.class)
@ConditionalOnMissingBean(DataSetComponent.class)
public DataSetComponent configureDataSetComponent(CamelContext camelContext) throws Exception {
DataSetComponent component = new DataSetComponent();
component.setCamelContext(camelContext);
return component;
}
use of org.apache.camel.component.dataset.DataSetComponent in project camel by apache.
the class DataSetComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
DataSetComponent comp = context.getComponent("dataset", DataSetComponent.class);
EndpointConfiguration conf = comp.createConfiguration("dataset:foo?minRate=3&produceDelay=33&consumeDelay=333&preloadSize=3333&initialDelay=33333&disableDataSetIndex=true");
assertEquals("Unexpected endpoint configuration value for minRate", "3", conf.getParameter("minRate"));
assertEquals("Unexpected endpoint configuration value for produceDelay", "33", conf.getParameter("produceDelay"));
assertEquals("Unexpected endpoint configuration value for consumeDelay", "333", conf.getParameter("consumeDelay"));
assertEquals("Unexpected endpoint configuration value for preloadSize", "3333", conf.getParameter("preloadSize"));
assertEquals("Unexpected endpoint configuration value for initialDelay", "33333", conf.getParameter("initialDelay"));
assertEquals("Unexpected endpoint configuration value for disableDataSetIndex", "true", conf.getParameter("disableDataSetIndex"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\""));
assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer"));
}
Aggregations