Search in sources :

Example 1 with CamelCxfClientImpl

use of org.apache.camel.component.cxf.CxfEndpoint.CamelCxfClientImpl in project camel by apache.

the class CxfEndpointTest method testSettingClientBus.

@Test
public void testSettingClientBus() throws Exception {
    ExtensionManagerBus bus = (ExtensionManagerBus) BusFactory.newInstance().createBus();
    bus.setId("oldCXF");
    BusFactory.setThreadDefaultBus(bus);
    ExtensionManagerBus newBus = (ExtensionManagerBus) BusFactory.newInstance().createBus();
    newBus.setId("newCXF");
    CxfComponent cxfComponent = new CxfComponent(new DefaultCamelContext());
    CxfEndpoint endpoint = (CxfEndpoint) cxfComponent.createEndpoint(routerEndpointURI);
    endpoint.setBus(newBus);
    CamelCxfClientImpl client = (CamelCxfClientImpl) endpoint.createClient();
    assertEquals("CamelCxfClientImpl should has the same bus with CxfEndpoint", newBus, client.getBus());
    endpoint = (CxfEndpoint) cxfComponent.createEndpoint(wsdlEndpointURI);
    endpoint.setBus(newBus);
    client = (CamelCxfClientImpl) endpoint.createClient();
    assertEquals("CamelCxfClientImpl should has the same bus with CxfEndpoint", newBus, client.getBus());
}
Also used : CamelCxfClientImpl(org.apache.camel.component.cxf.CxfEndpoint.CamelCxfClientImpl) ExtensionManagerBus(org.apache.cxf.bus.extension.ExtensionManagerBus) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Test(org.junit.Test)

Aggregations

CamelCxfClientImpl (org.apache.camel.component.cxf.CxfEndpoint.CamelCxfClientImpl)1 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)1 ExtensionManagerBus (org.apache.cxf.bus.extension.ExtensionManagerBus)1 Test (org.junit.Test)1