I am trying to write tests to my route.

CamelTestSupport has camel context which is of type ModelCamelContext. We
have a method in that : ModelCamelContext.getRouteDefinitions().

When I try that using a regular CamelContext like
CamelContext.getRouteDefinitions(), it says the method is deprecated. 

What is the difference between ModelCamelContext and CamelContext ? 

I am trying to use Route.adviceWith() method to replace the JMS endpoint on
the fly with a mock to test my route. This way I can test my production
route without having to use mocks. But this method is deprecaated. I see a
similar method in RouteDefinition.adviceWith(). 

What is the difference between "RouteDefinition" and a "Route"? What are the
specific uses of each? If I want to use "adviceWith() " inside a test class
that does not extend CamelSpringTestSupport, how can I use it as I will not
have access to ModelCamelContext here.

My test class looks like this  

@ContextConfiguration(locations =
"classpath:META-INF/spring/testCamelContext.xml")
@RunWith(CamelSpringJUnit4ClassRunner.class)
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
public class EventListenerRouteTest{

        @Autowired
    protected CamelContext camelContext;
        
        @EndpointInject(uri = "mock:JMSMock", context = "camelContext")
    protected MockEndpoint mock;

    @Produce(uri = "direct:eventMessageList", context = "camelContext")
    protected ProducerTemplate producer;

..........
....
..

}



Please help. fyi : I am very new to camel :)




--
View this message in context: 
http://camel.465427.n5.nabble.com/Confused-ModelCamelContext-Vs-CamelContext-and-RouteDefinition-Vs-Route-tp5728129.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to