camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbellat <>
Subject Unit test camel with activeMQ
Date Mon, 30 May 2011 09:19:15 GMT

I used Junit for java program but I need some examples to understand how it
works in camel with activeMQ

I wrote a simple camel.xml as follow :

<camelContext id="camel" xmlns="">
			<from uri="activemq:start"/>
			<bean ref="MyBean" method="route" />
			<to uri="activemq:finish"/>

and is :

      public class MyBean {

	public void route(Exchange message){

		 String name = message.getIn().getBody(String.class);

In my route I send any string like "my unit Test", this string received by
the bean and affecte "test" in my String and route it to activemq:finish.

How can I write a unit test for that simple code ?

In my test I was wondring if my activemq must be started ?

I will appreciate your help.

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

View raw message