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);