Examples of CxfEndpoint


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

        assertEquals("Got the wrong schemalocation", "classpath:wsdl/Message.xsd", routerEndpoint.getSchemaLocations().get(0));
    }
   
    @Test
    public void testPropertiesSettingOnCxfClient() throws Exception {
        CxfEndpoint clientEndpoint = (CxfEndpoint)ctx.getBean("clientEndpoint");
        CxfProducer producer = (CxfProducer) clientEndpoint.createProducer();
        Client client = producer.getClient();
        HTTPConduit conduit = (HTTPConduit)client.getConduit();
        assertEquals("Got the wrong user name", "test", conduit.getAuthorization().getUserName());
    }
View Full Code Here

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:9000/router");
        assertEquals("Got the wrong endpont service class",
                     "org.apache.camel.component.cxf.HelloService",
                     routerEndpoint.getServiceClass().getName());
    }
View Full Code Here

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

    }
   
    @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());
        assertFalse("Get a wrong endpoint key.",  endpoint1.getEndpointKey().equals(endpoint2.getEndpointKey()));
    }
View Full Code Here

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

    }
   
    @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

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

        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:9000/router", routerEndpoint.getAddress());
        assertEquals("Got the wrong endpont service class",
                     "org.apache.camel.component.cxf.HelloService",
                     routerEndpoint.getServiceClass().getName());
       
    }
View Full Code Here

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

   
    @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"));
        assertEquals(cxf1, endpoint.getBus());
        assertEquals("barf", endpoint.getBus().getProperty("foo"));
       
        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"));
        assertEquals(cxf2, endpoint.getBus());
        assertEquals("snarf", endpoint.getBus().getProperty("foo"));
       
    }
View Full Code Here

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

            throw new IllegalArgumentException("The CxfEndpoint instance is null");
        }
        // CamelContext
        SpringCamelContext context = SpringCamelContext.springCamelContext(endpointBean.getApplicationContext());
        // The beanId will be set from endpointBean's property       
        CxfEndpoint answer = new CxfSpringEndpoint(context, endpointBean);
        // check the properties map
        if (endpointBean.getProperties() != null) {
            Map<String, Object> copy = new HashMap<String, Object>();
            copy.putAll(endpointBean.getProperties());
            EndpointHelper.setReferenceProperties(context, answer, copy);
            EndpointHelper.setProperties(context, answer, copy);
            answer.setMtomEnabled(Boolean.valueOf((String)copy.get(Message.MTOM_ENABLED)));
        }
        return answer;
    }
View Full Code Here

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

        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

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

        assertEquals("Got the wrong schemalocation", "classpath:wsdl/Message.xsd", routerEndpoint.getSchemaLocations().get(0));
    }
   
    @Test
    public void testPropertiesSettingOnCxfClient() throws Exception {
        CxfEndpoint clientEndpoint = (CxfEndpoint)ctx.getBean("clientEndpoint");
        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());
View Full Code Here

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

    }
   
    @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
Copyright © 2018 www.massapi.com. 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.