use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class TestComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
TestComponent comp = context.getComponent("test", TestComponent.class);
EndpointConfiguration conf = comp.createConfiguration("test:my:foo?timeout=1000");
assertEquals("1000", conf.getParameter("timeout"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"name\": { \"kind\": \"path\", \"displayName\": \"Name\", \"group\": \"producer\", \"required\": true"));
assertTrue(json.contains("\"retainFirst\": { \"kind\": \"parameter\", \"displayName\": \"Retain First\", \"group\": \"producer\", \"label\": \"producer\""));
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class ConfigurationHelperTest method testUrlWithPath.
@Test
public void testUrlWithPath() throws Exception {
EndpointConfiguration cfg = ConfigurationHelper.createConfiguration("uri-dump://foo/bar#defrag", context);
logConfigurationObject(cfg);
assertEquals(URIDUMP_SCHEME, cfg.getParameter(EndpointConfiguration.URI_SCHEME));
assertEquals("//foo/bar#defrag", cfg.getParameter(EndpointConfiguration.URI_SCHEME_SPECIFIC_PART));
assertEquals("foo", cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
assertEquals("foo", cfg.getParameter(EndpointConfiguration.URI_HOST));
assertEquals(Integer.valueOf(-1), cfg.getParameter(EndpointConfiguration.URI_PORT));
assertEquals("/bar#defrag", cfg.getParameter(EndpointConfiguration.URI_PATH));
assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_QUERY));
assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class ConfigurationHelperTest method testUrlSimple.
@Test
public void testUrlSimple() throws Exception {
EndpointConfiguration cfg = ConfigurationHelper.createConfiguration("uri-dump://foo", context);
logConfigurationObject(cfg);
assertEquals(URIDUMP_SCHEME, cfg.getParameter(EndpointConfiguration.URI_SCHEME));
assertEquals("//foo", cfg.getParameter(EndpointConfiguration.URI_SCHEME_SPECIFIC_PART));
assertEquals("foo", cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
assertEquals("foo", cfg.getParameter(EndpointConfiguration.URI_HOST));
assertEquals(Integer.valueOf(-1), cfg.getParameter(EndpointConfiguration.URI_PORT));
assertEquals("", cfg.getParameter(EndpointConfiguration.URI_PATH));
assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_QUERY));
assertEquals(null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class EndpointConfigurationTest method testConfigurationPortParameter.
@Test
@Ignore("Fails due CAMEL-5183")
public void testConfigurationPortParameter() throws Exception {
EndpointConfiguration cfg1 = ConfigurationHelper.createConfiguration("mapped://foo:8080?one=true&two=2&port=123", context);
String uri1 = cfg1.toUriString(EndpointConfiguration.UriFormat.Complete);
assertEquals("mapped://foo:8080?one=true&port=123&two=2", uri1);
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class BeanComponentConfigurationAndDocumentationTest method testComponentConfiguration.
@Test
public void testComponentConfiguration() throws Exception {
BeanComponent comp = context.getComponent("bean", BeanComponent.class);
EndpointConfiguration conf = comp.createConfiguration("bean:foo?method=bar");
assertEquals("bar", conf.getParameter("method"));
ComponentConfiguration compConf = comp.createComponentConfiguration();
String json = compConf.createParameterJsonSchema();
assertNotNull(json);
assertTrue(json.contains("\"method\": { \"kind\": \"parameter\", \"displayName\": \"Method\", \"group\": \"producer\", \"type\": \"string\""));
assertTrue(json.contains("\"cache\": { \"kind\": \"parameter\", \"displayName\": \"Cache\", \"group\": \"advanced\", \"label\": \"advanced\", \"type\": \"boolean\""));
}
Aggregations