Search in sources :

Example 21 with EndpointConfiguration

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());
}
Also used : EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 22 with EndpointConfiguration

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"));
}
Also used : EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 23 with EndpointConfiguration

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));
}
Also used : EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 24 with EndpointConfiguration

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));
}
Also used : EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Example 25 with EndpointConfiguration

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));
}
Also used : EndpointConfiguration(org.apache.camel.EndpointConfiguration) Test(org.junit.Test)

Aggregations

EndpointConfiguration (org.apache.camel.EndpointConfiguration)27 Test (org.junit.Test)26 ComponentConfiguration (org.apache.camel.ComponentConfiguration)16 Component (org.apache.camel.Component)1 BeanComponent (org.apache.camel.component.bean.BeanComponent)1 BrowseComponent (org.apache.camel.component.browse.BrowseComponent)1 ControlBusComponent (org.apache.camel.component.controlbus.ControlBusComponent)1 DataFormatComponent (org.apache.camel.component.dataformat.DataFormatComponent)1 DataSetComponent (org.apache.camel.component.dataset.DataSetComponent)1 DirectComponent (org.apache.camel.component.direct.DirectComponent)1 DirectVmComponent (org.apache.camel.component.directvm.DirectVmComponent)1 FileComponent (org.apache.camel.component.file.FileComponent)1 FtpComponent (org.apache.camel.component.file.remote.FtpComponent)1 LanguageComponent (org.apache.camel.component.language.LanguageComponent)1 LogComponent (org.apache.camel.component.log.LogComponent)1 MockComponent (org.apache.camel.component.mock.MockComponent)1 SedaComponent (org.apache.camel.component.seda.SedaComponent)1 TestComponent (org.apache.camel.component.test.TestComponent)1 TimerComponent (org.apache.camel.component.timer.TimerComponent)1 XsltComponent (org.apache.camel.component.xslt.XsltComponent)1