camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From kenhans <kenha...@hotmail.co.uk>
Subject Newbie: how to test?
Date Wed, 21 Sep 2011 11:07:45 GMT
hello,
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="http://camel.apache.org/schema/spring">
      <routeBuilder ref="subscriptionRoute"/>
</camelContext>

my subscriptionRoute is defined like this:
from("jms:queue:subscription").....
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: http://camel.465427.n5.nabble.com/Newbie-how-to-test-tp4825969p4825969.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message