camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kenhans <>
Subject Newbie: how to test?
Date Wed, 21 Sep 2011 11:07:45 GMT
I started looking into Camel a few days ago and was wondering how to test... 

I define my camelContext through Spring, with the route I want to use

<camelContext xmlns="">
      <routeBuilder ref="subscriptionRoute"/>

my subscriptionRoute is defined like this:
where jms is ActiveMQ, added to the context, not part of the test project.

Now I would like to test my routes through a simple JUnit-test. So how do I
fire messages into the subscription queue from my JUnit test so that my
route picks it up? Do I need to create a new camelContext in my test class
and have a ProducerTemplate create messages? But how can I be sure I put
them into the queue for the subscriptionRoute to pick them up?

Sorry if this is extremely newbie, but I am kind of stuck on this and would
highly appreciate any hints. I've gone through the steps doing it all
through the JUnit-test (i.e. creating the route, posting to a queue,
checking the outputs etc), but I simply do not understand how to separate
the test from my eventual production code...

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message