use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfEndpointUtilsWithSpringTest method testGetServiceClass.
@Test
public void testGetServiceClass() throws Exception {
CxfEndpoint endpoint = createEndpoint("cxf:bean:helloServiceEndpoint?serviceClass=#helloServiceImpl");
assertEquals("org.apache.camel.component.cxf.HelloServiceImpl", endpoint.getServiceClass().getName());
}
use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfEndpointUtilsWithSpringTest method testGetDataFormatFromCxfEndpontProperties.
@Test
public void testGetDataFormatFromCxfEndpontProperties() throws Exception {
CxfEndpoint endpoint = createEndpoint(getEndpointURI() + "?dataFormat=PAYLOAD");
assertEquals("We should get the PAYLOAD DataFormat", DataFormat.PAYLOAD, endpoint.getDataFormat());
}
use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfEndpointBeanBusSettingTest method testBusInjectedBySpring.
@Test
public void testBusInjectedBySpring() throws Exception {
CamelContext camelContext = (CamelContext) ctx.getBean("camel");
CxfEndpoint endpoint = camelContext.getEndpoint("cxf:bean:routerEndpoint", CxfEndpoint.class);
assertEquals("Get a wrong endpoint uri", "cxf://bean:routerEndpoint", endpoint.getEndpointUri());
Bus cxf1 = endpoint.getBus();
assertEquals(cxf1, ctx.getBean("cxf1"));
assertEquals(cxf1, endpoint.getBus());
assertEquals("barf", endpoint.getBus().getProperty("foo"));
endpoint = camelContext.getEndpoint("cxf:bean:serviceEndpoint", CxfEndpoint.class);
assertEquals("Get a wrong endpoint uri", "cxf://bean:serviceEndpoint", endpoint.getEndpointUri());
Bus cxf2 = endpoint.getBus();
assertEquals(cxf2, ctx.getBean("cxf2"));
assertEquals(cxf2, endpoint.getBus());
assertEquals("snarf", endpoint.getBus().getProperty("foo"));
}
use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfEndpointBeanTest method testPropertiesSettingOnCxfClient.
@Test
public void testPropertiesSettingOnCxfClient() throws Exception {
CxfEndpoint clientEndpoint = ctx.getBean("clientEndpoint", CxfEndpoint.class);
CxfProducer producer = (CxfProducer) clientEndpoint.createProducer();
// need to start the producer to get the client
producer.start();
Client client = producer.getClient();
HTTPConduit conduit = (HTTPConduit) client.getConduit();
assertEquals("Got the wrong user name", "test", conduit.getAuthorization().getUserName());
}
use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfEndpointBeanWithBusTest method testCxfEndpointBeanDefinitionParser.
@Test
public void testCxfEndpointBeanDefinitionParser() {
CxfEndpoint routerEndpoint = ctx.getBean("routerEndpoint", CxfEndpoint.class);
assertEquals("Got the wrong endpoint address", "http://localhost:" + port1 + "/CxfEndpointBeanWithBusTest/router/", routerEndpoint.getAddress());
assertEquals("Got the wrong endpont service class", "org.apache.camel.component.cxf.HelloService", routerEndpoint.getServiceClass().getName());
}
Aggregations