use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class EndpointConfigurationTest method testConfigurationInstanceType.
@Test
public void testConfigurationInstanceType() throws Exception {
EndpointConfiguration cfg = ConfigurationHelper.createConfiguration("mapped:foo", context);
assertEquals("EndpointConfiguration instance not of expected type", MappedEndpointConfiguration.class, cfg.getClass());
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class ConfigurationHelperTest method testDummyConfiguration.
@Test
public void testDummyConfiguration() throws Exception {
String configUri = "dummy://foobar?first=one&second=2";
EndpointConfiguration config = ConfigurationHelper.createConfiguration(configUri, context);
assertNotNull(config);
assertTrue(config instanceof DummyConfiguration);
assertEquals("one", config.getParameter("first"));
assertEquals(Integer.valueOf(2), config.getParameter("second"));
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class ConfigurationHelperTest method testUrnWithQuery.
@Test
public void testUrnWithQuery() throws Exception {
EndpointConfiguration cfg = ConfigurationHelper.createConfiguration("uri-dump:hadrian@localhost:9001/context/path/?bar=true&baz=2#1234", context);
logConfigurationObject(cfg);
assertEquals(URIDUMP_SCHEME, cfg.getParameter(EndpointConfiguration.URI_SCHEME));
assertEquals("hadrian@localhost:9001/context/path/?bar=true&baz=2#1234", cfg.getParameter(EndpointConfiguration.URI_SCHEME_SPECIFIC_PART));
assertEquals("URNs don't set the authority field", null, cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
assertEquals("URNs don't set the userInfo field", null, cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
assertEquals("URNs don't set the host field", null, cfg.getParameter(EndpointConfiguration.URI_HOST));
assertEquals("URNs don't set the port field", Integer.valueOf(-1), cfg.getParameter(EndpointConfiguration.URI_PORT));
assertEquals("URNs don't set the path field", null, cfg.getParameter(EndpointConfiguration.URI_PATH));
assertEquals("URNs don't set the query field", null, cfg.getParameter(EndpointConfiguration.URI_QUERY));
assertEquals("URNs don't set the fragment field", null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class ConfigurationHelperTest method testUrnNoQuery.
@Test
public void testUrnNoQuery() 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("URNs don't set the authority field", null, cfg.getParameter(EndpointConfiguration.URI_AUTHORITY));
assertEquals("URNs don't set the userInfo field", null, cfg.getParameter(EndpointConfiguration.URI_USER_INFO));
assertEquals("URNs don't set the host field", null, cfg.getParameter(EndpointConfiguration.URI_HOST));
assertEquals("URNs don't set the port field", Integer.valueOf(-1), cfg.getParameter(EndpointConfiguration.URI_PORT));
assertEquals("URNs don't set the path field", null, cfg.getParameter(EndpointConfiguration.URI_PATH));
assertEquals("URNs don't set the query field", null, cfg.getParameter(EndpointConfiguration.URI_QUERY));
assertEquals("URNs don't set the fragment field", null, cfg.getParameter(EndpointConfiguration.URI_FRAGMENT));
}
use of org.apache.camel.EndpointConfiguration in project camel by apache.
the class ConfigurationHelperTest method testConfigurationFormat.
@Test
public void testConfigurationFormat() throws Exception {
EndpointConfiguration config = ConfigurationHelper.createConfiguration("uri-dump:foo", context);
assertEquals(null, config.toUriString(EndpointConfiguration.UriFormat.Canonical));
assertEquals(null, config.toUriString(EndpointConfiguration.UriFormat.Provider));
assertEquals(null, config.toUriString(EndpointConfiguration.UriFormat.Consumer));
assertEquals(null, config.toUriString(EndpointConfiguration.UriFormat.Complete));
}
Aggregations