camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From shyenuganti <>
Subject My First Camel Route. Need help unit testing and refactoring.
Date Mon, 25 Feb 2013 21:01:57 GMT
Here is a sample route written in Camel for our application. This is our
first ever route in camel. 

This route reads Event Table in Oracle and AS400 systems, extracts an XML
message from the record and send the message to JMS queue.

All the JDBC and JMS endpoints are based on JNDI Lookup.

This is working fine. Now I am a bit confused on how to write
unit/integration tests for this route. Can anyone help me with  a sample
unit test methods for this route? 

Do we have to use "mocks" for testing? Cant we replace the components with
mocks on the fly ? Should we have multiple application context files in
test/resources thaat mocks the JPA and jms endpoints for testing ? 

Any comments on the route structure or any refactoring/best practice ideas
are welcome. Please assist.

public class EventListenerRoute	
	extends RouteBuilder
	implements InitializingBean, DisposableBean{
		public void configure() throws Exception {
			.log("Sending Message to Queue: jbossEventQueue")
			.log("Sent message to jbossEventQueue");


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

View raw message