Package org.apache.camel.component.cxf

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


        assertEquals("We should get the right service name", service, SERVICE_NAME);
        assertEquals("We should get the setDefaultBus value", CxfEndpointUtils.getSetDefaultBus(endpoint) , true);
    }

    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


        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.getServiceClass(endpoint);
            fail("Should get a CamelException here");
        } catch (ClassNotFoundException exception) {
            assertNotNull("Should get a ClassNotFoundExceptionException here", exception);
View Full Code Here

            assertEquals("Can't find serviceClass from uri, please check the cxf endpoint configuration", exception.getMessage());
        }
    }

    public void testCheckServiceClassProcedure() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            endpoint.createProducer();
        } catch (ClassNotFoundException exception) {
            assertNotNull("Should get a ClassNotFoundException here", exception);
            assertEquals("Can't find serviceClass from uri, please check the cxf endpoint configuration", exception.getMessage());
        }
    }
View Full Code Here

            assertEquals("Can't find serviceClass from uri, please check the cxf endpoint configuration", exception.getMessage());
        }
    }

    public void testCheckServiceClassConsumer() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            endpoint.createConsumer(new NullProcessor());
        } catch (ClassNotFoundException exception) {
            assertNotNull("Should get a ClassNotFoundException here", exception);
            assertEquals("Can't find serviceClass from uri, please check the cxf endpoint configuration", exception.getMessage());
        }
    }
View Full Code Here

public class CamelEndpointSpringConfigureTest extends CamelSpringTestSupport {
   
    @Test
    public void testCreateDestinationFromSpring() throws Exception {
        CxfEndpoint cxfEndpoint = context.getEndpoint("cxf:bean:serviceEndpoint", CxfEndpoint.class);
        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 = context.getEndpoint("cxf:bean:routerEndpoint", CxfEndpoint.class);
        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

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

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

        assertEquals("We should get the right service name", service, SERVICE_NAME);
    }

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

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

    @Test
    public void testCheckServiceClassWithTheEndpoint() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        assertNull(endpoint.getServiceClass());
    }
View Full Code Here

        assertNull(endpoint.getServiceClass());
    }

    @Test
    public void testCheckServiceClassProcedure() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            endpoint.createProducer();
        } catch (IllegalArgumentException exception) {
            assertNotNull("Should get a CamelException here", exception);
        }
    }
View Full Code Here

        }
    }

    @Test
    public void testCheckServiceClassConsumer() throws Exception {
        CxfEndpoint endpoint = createEndpoint(getNoServiceClassURI());
        try {
            endpoint.createConsumer(new NullProcessor());
        } catch (IllegalArgumentException exception) {
            assertNotNull("Should get a CamelException here", exception);
            assertTrue(exception.getMessage().startsWith("serviceClass must be specified"));
        }
    }
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.