Package org.apache.camel.component.cxf

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


        CxfEndpoint endpoint = createEndpoint(getEndpointURI() + "&dataFormat=MESSAGE");
        assertEquals("We should get the Message DataFormat", CxfEndpointUtils.getDataFormat(endpoint), DataFormat.MESSAGE);
    }

    public void testCheckServiceClassWithTheEndpoint() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            CxfEndpointUtils.checkServiceClassName(endpoint.getServiceClass());
            fail("Should get a CamelException here");
        } catch (CamelException exception) {
            assertNotNull("Should get a CamelException here", exception);
            assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
        }
View Full Code Here


            assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
        }
    }

    public void testCheckServiceClassProcedure() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            endpoint.createProducer();
        } catch (CamelException exception) {
            assertNotNull("Should get a CamelException here", exception);
            assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
        }
    }
View Full Code Here

            assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
        }
    }

    public void testCheckServiceClassConsumer() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            endpoint.createConsumer(new NullProcessor());
        } catch (CamelException exception) {
            assertNotNull("Should get a CamelException here", exception);
            assertEquals("serviceClass is required for CXF endpoint configuration", exception.getMessage());
        }
    }
View Full Code Here

import org.springframework.context.support.ClassPathXmlApplicationContext;

public class CamelEndpointSpringConfigureTest extends SpringTestSupport {
   
    public void testCreateDestinationFromSpring() throws Exception {
        CxfEndpoint cxfEndpoint = (CxfEndpoint) context.getEndpoint("cxf:bean:serviceEndpoint");
        CxfProducer producer = (CxfProducer)cxfEndpoint.createProducer();
        assertNotNull("The producer should not be null", producer);       
        producer.start();
        CamelConduit conduit = (CamelConduit)producer.getClient().getConduit();
        assertTrue("we should get SpringCamelContext here", conduit.getCamelContext() instanceof SpringCamelContext);
        assertEquals("The context id should be camel_conduit", "camel_conduit", conduit.getCamelContext().getName());
       
        cxfEndpoint = (CxfEndpoint) context.getEndpoint("cxf:bean:routerEndpoint");
        CxfConsumer consumer = (CxfConsumer)cxfEndpoint.createConsumer(new Processor() {
            public void process(Exchange exchange) throws Exception {
                // do nothing here               
            }           
        });
        assertNotNull("The consumer should not be null", consumer);       
View Full Code Here

    protected String getNoServiceClassURI() {
        return "cxf:bean:noServiceClassEndpoint";
    }
   
    public void testGetServiceClass() throws Exception {
        CxfEndpoint endpoint = createEndpoint("cxf:bean:helloServiceEndpoint?serviceClassInstance=helloServiceImpl");       
        Class clazz = CxfEndpointUtils.getServiceClass(endpoint);
        assertNotNull("The service calss should not be null ", clazz);
        assertTrue("The service class should be the instance of HelloServiceImpl", clazz.equals(HelloServiceImpl.class));
    }
View Full Code Here

        assertNotNull("The service calss should not be null ", clazz);
        assertTrue("The service class should be the instance of HelloServiceImpl", clazz.equals(HelloServiceImpl.class));
    }

    public void testGetDataFormat() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getEndpointURI() + "?dataFormat=MESSAGE");
        assertEquals("We should get the Message DataFormat", CxfEndpointUtils.getDataFormat(endpoint),
                     DataFormat.MESSAGE);
    }
View Full Code Here

        assertEquals("We should get the Message DataFormat", CxfEndpointUtils.getDataFormat(endpoint),
                     DataFormat.MESSAGE);
    }

    public void testGetURIOverCxfEndpointProperties() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getEndpointURI() + "?setDefaultBus=false");
        assertEquals("We should get the setDefaultBus value", CxfEndpointUtils.getSetDefaultBus(endpoint),
                     false);

    }
View Full Code Here

                     false);

    }

    public void testGetProperties() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getEndpointURI());
        QName service = endpoint.getCxfEndpointBean().getServiceName();
        assertEquals("We should get the right service name", service, SERVICE_NAME);
        assertEquals("We should get the setDefaultBus value", CxfEndpointUtils.getSetDefaultBus(endpoint),
                     true);
        assertEquals("The cxf endpoint's DataFromat should be MESSAGE", CxfEndpointUtils.getDataFormat(endpoint), DataFormat.MESSAGE);
       
View Full Code Here

        QName port = CxfEndpointUtils.getPortName(endpoint);
        assertEquals("We should get the right endpoint name", port, PORT_NAME);
    }

    public void testGetDataFormatFromCxfEndpontProperties() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getEndpointURI() + "?dataFormat=PAYLOAD");
        assertEquals("We should get the PAYLOAD DataFormat", CxfEndpointUtils.getDataFormat(endpoint),
                     DataFormat.PAYLOAD);
    }
View Full Code Here

        CamelContext context = getCamelContext();
        return (CxfEndpoint)new CxfComponent(context).createEndpoint(uri);
    }     

    public void testGetProperties() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getEndpointURI());
        QName service = CxfEndpointUtils.getQName(endpoint.getServiceName());
        assertEquals("We should get the right service name", service, SERVICE_NAME);
        assertEquals("We should get the setDefaultBus value", CxfEndpointUtils.getSetDefaultBus(endpoint) , true);
    }
View Full Code Here

TOP

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

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.