Search in sources :

Example 21 with CxfEndpoint

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

Example 22 with CxfEndpoint

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

Example 23 with CxfEndpoint

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"));
}
Also used : CamelContext(org.apache.camel.CamelContext) Bus(org.apache.cxf.Bus) CxfEndpoint(org.apache.camel.component.cxf.CxfEndpoint) Test(org.junit.Test)

Example 24 with CxfEndpoint

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());
}
Also used : HTTPConduit(org.apache.cxf.transport.http.HTTPConduit) CxfProducer(org.apache.camel.component.cxf.CxfProducer) CxfEndpoint(org.apache.camel.component.cxf.CxfEndpoint) Client(org.apache.cxf.endpoint.Client) Test(org.junit.Test)

Example 25 with CxfEndpoint

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

Aggregations

CxfEndpoint (org.apache.camel.component.cxf.CxfEndpoint)32 Test (org.junit.Test)30 CamelContext (org.apache.camel.CamelContext)10 QName (javax.xml.namespace.QName)4 RouteBuilder (org.apache.camel.builder.RouteBuilder)4 CxfComponent (org.apache.camel.component.cxf.CxfComponent)4 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)4 Endpoint (org.wildfly.camel.test.common.types.Endpoint)3 Exchange (org.apache.camel.Exchange)2 Processor (org.apache.camel.Processor)2 ProducerTemplate (org.apache.camel.ProducerTemplate)2 CxfProducer (org.apache.camel.component.cxf.CxfProducer)2 SoapBindingConfiguration (org.apache.cxf.binding.soap.SoapBindingConfiguration)2 Interceptor (org.apache.cxf.interceptor.Interceptor)2 Message (org.apache.cxf.message.Message)2 URL (java.net.URL)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 CountDownLatch (java.util.concurrent.CountDownLatch)1