use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class ManagedCamelContext method completeEndpointPath.
public List<String> completeEndpointPath(String componentName, Map<String, Object> endpointParameters, String completionText) throws Exception {
if (completionText == null) {
completionText = "";
}
Component component = context.getComponent(componentName, false);
if (component != null) {
ComponentConfiguration configuration = component.createComponentConfiguration();
configuration.setParameters(endpointParameters);
return configuration.completeEndpointPath(completionText);
} else {
return new ArrayList<String>();
}
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class TimerComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
TimerComponent comp = context.getComponent("timer", TimerComponent.class);
EndpointConfiguration conf = comp.createConfiguration("timer:foo?period=2000");
assertEquals("2000", conf.getParameter("period"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"timerName\": { \"kind\": \"path\", \"displayName\": \"Timer Name\", \"group\": \"consumer\", \"required\": true"));
assertTrue(json.contains("\"delay\": { \"kind\": \"parameter\", \"displayName\": \"Delay\", \"group\": \"consumer\", \"type\": \"integer\""));
assertTrue(json.contains("\"timer\": { \"kind\": \"parameter\", \"displayName\": \"Timer\", \"group\": \"advanced\", \"label\": \"advanced\""));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class DataFormatComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
DataFormatComponent comp = context.getComponent("dataformat", DataFormatComponent.class);
EndpointConfiguration conf = comp.createConfiguration("dataformaat:marshal:string?charset=iso-8859-1");
assertEquals("iso-8859-1", conf.getParameter("charset"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true, \"type\": \"string\", \"javaType\": \"java.lang.String\"," + " \"deprecated\": false, \"secret\": false, \"description\": \"Name of data format\" }"));
assertTrue(json.contains("\"operation\": { \"kind\": \"path\", \"displayName\": \"Operation\", \"group\": \"producer\", \"required\": true, \"type\": \"string\""));
assertTrue(json.contains("\"synchronous\": { \"kind\": \"parameter\", \"displayName\": \"Synchronous\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class DirectComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
DirectComponent comp = context.getComponent("direct", DirectComponent.class);
EndpointConfiguration conf = comp.createConfiguration("direct:foo?block=true");
assertEquals("true", conf.getParameter("block"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"displayName\": \"Timeout\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer\""));
}
use of org.apache.camel.ComponentConfiguration in project camel by apache.
the class DirectVmComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
DirectVmComponent comp = context.getComponent("direct-vm", DirectVmComponent.class);
EndpointConfiguration conf = comp.createConfiguration("direct-vm:foo?block=false");
assertEquals("false", conf.getParameter("block"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"common\", \"required\": true, \"type\": \"string\""));
assertTrue(json.contains("\"timeout\": { \"kind\": \"parameter\", \"displayName\": \"Timeout\", \"group\": \"producer\", \"label\": \"producer\", \"type\": \"integer\""));
}
Aggregations