Package org.apache.camel.component.cxf

Examples of org.apache.camel.component.cxf.CxfEndpoint


        return new String[]{"org/apache/camel/component/cxf/spring/CxfEndpointBeansRouter.xml"};
    }

    @Test
    public void testCxfEndpointBeanDefinitionParser() {
        CxfEndpoint routerEndpoint = (CxfEndpoint)ctx.getBean("routerEndpoint");
        assertEquals("Got the wrong endpoint address", routerEndpoint.getAddress(),
                     "http://localhost:" + CXFTestSupport.getPort1() + "/CxfEndpointBeansRouterTest/router");
        assertEquals("Got the wrong endpont service class",
                     "org.apache.camel.component.cxf.HelloService",
                     routerEndpoint.getServiceClass().getName());
    }
View Full Code Here


    }
   
    @Test
    public void testCreateCxfEndpointFromURI() {
        CamelContext camelContext = (CamelContext) ctx.getBean("camel");
        CxfEndpoint endpoint1 = (CxfEndpoint)
            camelContext.getEndpoint("cxf:bean:routerEndpoint?address=http://localhost:9000/test1");
        CxfEndpoint endpoint2 = (CxfEndpoint)
            camelContext.getEndpoint("cxf:bean:routerEndpoint?address=http://localhost:8000/test2");
        assertEquals("Get a wrong endpoint address.", "http://localhost:9000/test1", endpoint1.getAddress());
        assertEquals("Get a wrong endpoint address.", "http://localhost:8000/test2", endpoint2.getAddress());
        assertEquals("Get a wrong endpoint key.", "cxf://bean:routerEndpoint?address=http://localhost:9000/test1", endpoint1.getEndpointKey());
        assertEquals("Get a wrong endpoint key.", "cxf://bean:routerEndpoint?address=http://localhost:8000/test2", endpoint2.getEndpointKey());
    }
View Full Code Here

    @Test
    public void testCxfBeanWithCamelPropertiesHolder() throws Exception {
        // get the camelContext from application context
        CamelContext camelContext = (CamelContext) ctx.getBean("camel");
        CxfEndpoint testEndpoint = (CxfEndpoint)camelContext.getEndpoint("cxf:bean:testEndpoint");
        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:9000/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());
    }
View Full Code Here

        assertTrue(response, response.contains(responseExp));
    }

    @Test
    public void testMessageHeadersRelaysSpringContext() throws Exception {
        CxfEndpoint endpoint = (CxfEndpoint)context
            .getEndpoint("cxf:bean:serviceExtraRelays?headerFilterStrategy=#customMessageFilterStrategy");
        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,
View Full Code Here

    }
   
    @Test
    public void testBusInjectedBySpring() throws Exception {
        CamelContext camelContext = (CamelContext) ctx.getBean("camel");
        CxfEndpoint endpoint = (CxfEndpoint)camelContext.getEndpoint("cxf:bean:routerEndpoint");

        // verify the interceptor that is added by the logging feature
        // Spring 3.0.0 has an issue of SPR-6589 which will call the BusApplicationListener twice for the same event,
        // so we will get more one InInterceptors here
        assertTrue(endpoint.getBus().getInInterceptors().size() >= 1);
        assertEquals(LoggingInInterceptor.class, endpoint.getBus().getInInterceptors().get(0).getClass());
    }
View Full Code Here

        assertEquals(LoggingInInterceptor.class, endpoint.getBus().getInInterceptors().get(0).getClass());
    }
   
    @Test
    public void testCxfEndpointBeanDefinitionParser() {
        CxfEndpoint routerEndpoint = (CxfEndpoint)ctx.getBean("routerEndpoint");
        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());
       
    }
View Full Code Here

   
    @Test
    public void testBusInjectedBySpring() throws Exception {
        CamelContext camelContext = (CamelContext) ctx.getBean("camel");
       
        CxfEndpoint endpoint = (CxfEndpoint)camelContext.getEndpoint("cxf:bean:routerEndpoint");
        assertEquals("Get a wrong endpoint uri", "cxf://bean:routerEndpoint", endpoint.getEndpointUri());      
        Bus cxf1 = endpoint.getBus();
       
        assertEquals(cxf1, ctx.getBean("cxf1"));
        assertTrue(cxf1.getOutInterceptors().size() >= 1);
        assertTrue(cxf1.getInInterceptors().size() == 0);
        LoggingOutInterceptor log1 = getInterceptor(cxf1.getOutInterceptors(), LoggingOutInterceptor.class);
        assertNotNull(log1);
       
        endpoint = (CxfEndpoint)camelContext.getEndpoint("cxf:bean:serviceEndpoint");
        assertEquals("Get a wrong endpoint uri", "cxf://bean:serviceEndpoint", endpoint.getEndpointUri());
        Bus cxf2 = endpoint.getBus();
       
        assertEquals(cxf2, ctx.getBean("cxf2"));
        assertTrue(cxf2.getInInterceptors().size() >= 1);
        assertTrue(cxf2.getOutInterceptors().size() == 0);
        LoggingInInterceptor log2 = getInterceptor(cxf2.getInInterceptors(), LoggingInInterceptor.class);
View Full Code Here

        return new String[]{"org/apache/camel/component/cxf/spring/CxfEndpointBeans.xml"};
    }

    @Test
    public void testCxfEndpointBeanDefinitionParser() {
        CxfEndpoint routerEndpoint = (CxfEndpoint)ctx.getBean("routerEndpoint");
        assertEquals("Got the wrong endpoint address", "http://localhost:" + port1 + "/router", routerEndpoint.getAddress());
        assertEquals("Got the wrong endpont service class", "org.apache.camel.component.cxf.HelloService",
                         routerEndpoint.getServiceClass().getName());
        assertEquals("Got the wrong handlers size", 1, routerEndpoint.getHandlers().size());
        assertEquals("Got the wrong schemalocations size", 1, routerEndpoint.getSchemaLocations().size());
        assertEquals("Got the wrong schemalocation", "classpath:wsdl/Message.xsd", routerEndpoint.getSchemaLocations().get(0));
    }
View Full Code Here

        return new String[]{"org/apache/camel/component/cxf/spring/CxfEndpointBeansRouter.xml"};
    }

    @Test
    public void testCxfEndpointBeanDefinitionParser() {
        CxfEndpoint routerEndpoint = (CxfEndpoint)ctx.getBean("routerEndpoint");
        assertEquals("Got the wrong endpoint address", routerEndpoint.getAddress(), "http://localhost:9000/router");
        assertEquals("Got the wrong endpont service class",
                     "org.apache.camel.component.cxf.HelloService",
                     routerEndpoint.getServiceClass().getName());
    }
View Full Code Here

    }
   
    @Test
    public void testBusInjectedBySpring() throws Exception {
        CamelContext camelContext = (CamelContext) ctx.getBean("camel");
        CxfEndpoint endpoint = (CxfEndpoint)camelContext.getEndpoint("cxf:bean:routerEndpoint");

        // verify the interceptor that is added by the logging feature
        // Spring 3.0.0 has an issue of SPR-6589 which will call the BusApplicationListener twice for the same event,
        // so we will get more one InInterceptors here
        assertTrue(endpoint.getBus().getInInterceptors().size() >= 1);
        assertEquals(LoggingInInterceptor.class, endpoint.getBus().getInInterceptors().get(0).getClass());
    }
View Full Code Here

TOP

Related Classes of org.apache.camel.component.cxf.CxfEndpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.