use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class ControlBusComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
ControlBusComponent comp = context.getComponent("controlbus", ControlBusComponent.class);
EndpointConfiguration conf = comp.createConfiguration("controlbus:route?routeId=bar&action=stop");
assertEquals("bar", conf.getParameter("routeId"));
assertEquals("stop", conf.getParameter("action"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"action\": { \"kind\": \"parameter\", \"displayName\": \"Action\", \"group\": \"producer\", \"type\": \"string\""));
assertTrue(json.contains("\"async\": { \"kind\": \"parameter\", \"displayName\": \"Async\", \"group\": \"producer\", \"type\": \"boolean\""));
}
use of org.apache.camel.ComponentConfiguration 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"));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class XsltComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
XsltComponent comp = context.getComponent("xslt", XsltComponent.class);
EndpointConfiguration conf = comp.createConfiguration("xslt:foo?deleteOutputFile=true");
assertEquals("true", conf.getParameter("deleteOutputFile"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"resourceUri\": { \"kind\": \"path\", \"displayName\": \"Resource Uri\", \"group\": \"producer\", \"required\": true"));
assertTrue(json.contains("\"allowStAX\": { \"kind\": \"parameter\", \"displayName\": \"Allow StAX\", \"group\": \"producer\", \"type\": \"boolean\""));
assertTrue(json.contains("\"transformerFactoryClass\": { \"kind\": \"parameter\", \"displayName\": \"Transformer Factory Class\", \"group\": \"advanced\", \"label\": \"advanced\""));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class FileComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
FileComponent comp = context.getComponent("file", FileComponent.class);
EndpointConfiguration conf = comp.createConfiguration("file:target/foo?delete=true");
assertEquals("true", conf.getParameter("delete"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"directoryName\": { \"kind\": \"path\", \"displayName\": \"Directory Name\", \"group\": \"common\", \"required\": true"));
assertTrue(json.contains("\"autoCreate\": { \"kind\": \"parameter\", \"displayName\": \"Auto Create\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
assertTrue(json.contains("\"readLockMinAge\": { \"kind\": \"parameter\", \"displayName\": \"Read Lock Min Age\", \"group\": \"lock\", \"label\": \"consumer,lock\""));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class FtpComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
FtpComponent comp = context.getComponent("ftp", FtpComponent.class);
EndpointConfiguration conf = comp.createConfiguration("ftp://myhost?username=foo&password=secret&soTimeout=1234");
assertEquals("foo", conf.getParameter("username"));
assertEquals("secret", conf.getParameter("password"));
assertEquals("1234", conf.getParameter("soTimeout"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"minDepth\": { \"kind\": \"parameter\", \"displayName\": \"Min Depth\", \"group\": \"filter\", \"label\": \"consumer,filter\", \"type\": \"integer\", \"javaType\": \"int\""));
assertTrue(json.contains("\"username\": { \"kind\": \"parameter\", \"displayName\": \"Username\", \"group\": \"security\", \"label\": \"security\", \"type\": \"string\""));
}
Aggregations