use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfConsumerSoap12Test method testCxfEndpointBeanDefinitionParser.
@Test
public void testCxfEndpointBeanDefinitionParser() {
CxfEndpoint routerEndpoint = context.getEndpoint("routerEndpoint", CxfEndpoint.class);
assertEquals("Got the wrong endpoint address", routerEndpoint.getAddress(), "http://localhost:" + CXFTestSupport.getPort1() + "/CxfConsumerSoap12Test/router");
assertEquals("Got the wrong endpont service class", "org.apache.hello_world_soap_http.Greeter", routerEndpoint.getServiceClass().getName());
BindingConfiguration binding = routerEndpoint.getBindingConfig();
assertTrue("Got no soap binding", binding instanceof SoapBindingConfiguration);
assertEquals("Got the wrong soap version", "http://schemas.xmlsoap.org/wsdl/soap12/", ((SoapBindingConfiguration) binding).getVersion().getBindingId());
assertTrue("Mtom not enabled", ((SoapBindingConfiguration) binding).isMtomEnabled());
}
use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfEndpointBeansTest method testCxfBusInjection.
@Test
public void testCxfBusInjection() {
CxfEndpoint serviceEndpoint = context.getEndpoint("cxf:bean:serviceEndpoint", CxfEndpoint.class);
CxfEndpoint routerEndpoint = context.getEndpoint("cxf:bean:routerEndpoint", CxfEndpoint.class);
assertEquals("These endpoints don't share the same bus", serviceEndpoint.getBus().getId(), routerEndpoint.getBus().getId());
}
use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfEndpointBeansTest method testCxfFeatureSetting.
@Test
public void testCxfFeatureSetting() {
CxfEndpoint routerEndpoint = context.getEndpoint("cxf:bean:routerEndpoint", CxfEndpoint.class);
assertEquals("Get a wrong size of features.", 1, routerEndpoint.getFeatures().size());
assertTrue("Get a wrong feature instance.", routerEndpoint.getFeatures().get(0) instanceof FailoverFeature);
}
use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfEndpointBeansTest method testCxfBeanWithCamelPropertiesHolder.
@Test
public void testCxfBeanWithCamelPropertiesHolder() throws Exception {
// get the camelContext from application context
CxfEndpoint testEndpoint = context.getEndpoint("cxf:bean:testEndpoint", CxfEndpoint.class);
QName endpointName = QName.valueOf("{http://org.apache.camel.component.cxf}myEndpoint");
QName serviceName = QName.valueOf("{http://org.apache.camel.component.cxf}myService");
assertEquals("Got a wrong address", "http://localhost:" + CXFTestSupport.getPort3() + "/testEndpoint", testEndpoint.getAddress());
assertEquals("Got a wrong bindingId", "http://schemas.xmlsoap.org/wsdl/soap12/", testEndpoint.getBindingId());
assertEquals("Got a wrong transportId", "http://cxf.apache.org/transports/http", testEndpoint.getTransportId());
assertEquals("Got a wrong endpointName", endpointName, testEndpoint.getPortName());
assertEquals("Got a wrong WsdlURL", "wsdl/test.wsdl", testEndpoint.getWsdlURL());
assertEquals("Got a wrong serviceName", serviceName, testEndpoint.getServiceName());
}
use of org.apache.camel.component.cxf.CxfEndpoint in project camel by apache.
the class CxfMessageHeadersRelayTest method testMessageHeadersRelaysSpringContext.
@Test
public void testMessageHeadersRelaysSpringContext() throws Exception {
CxfEndpoint endpoint = context.getEndpoint("cxf:bean:serviceExtraRelays?headerFilterStrategy=#customMessageFilterStrategy", CxfEndpoint.class);
CxfHeaderFilterStrategy strategy = (CxfHeaderFilterStrategy) endpoint.getHeaderFilterStrategy();
List<MessageHeaderFilter> filters = strategy.getMessageHeaderFilters();
assertEquals("Expected number of filters ", 2, filters.size());
Map<String, MessageHeaderFilter> messageHeaderFilterMap = strategy.getMessageHeaderFiltersMap();
for (String ns : new CustomHeaderFilter().getActivationNamespaces()) {
assertEquals("Expected a filter class for namespace: " + ns, CustomHeaderFilter.class, messageHeaderFilterMap.get(ns).getClass());
}
}
Aggregations