camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob <>
Subject JUnit route with routeContextRef
Date Fri, 08 Aug 2014 15:04:58 GMT

I have been trying to JUnit one of my Camel routes where the Camel context
contains a <routeContextRef>. When I comment this out my test works, but I
cannot seem to get my test to run with this in as I get an error,
IllegalArgumentException: Cannot find RouteContext with reference

How do I either mock or skip this without having to import all the dependent
xml's as I am mocking the endpoint that is dependant on the reference.  I am
trying to test just the transform route indicated below.

<beans xmlns=""

	<camelContext id="management-mymanagementDetails_v2" trace="{{trace}}"
		<propertyPlaceholder id="properties"
    	<routeContextRef ref="commonRoute"/>
	    <route id="transform">
			<from uri="direct:transform"/>
	        <marshal ref="jaxbMain"/>
			<filter xmlns:ns2="http://www.mycompany/main/management/v2">
				<to uri="xquery://v2/xquery/managementRequest.xq"/>
	        <unmarshal ref="jaxbBus"/>
	        <to uri="direct:toMainServiceCall"/>


Test Class extract, my test is extending CamelSpringTestSupport

	protected AbstractApplicationContext createApplicationContext() {

		System.setProperty("trace", "true");
		System.setProperty("messageCentralXslt", "messagecentral-transform.xsl");
		System.setProperty("msgQueueName", "messagecentral.orderpbb");
		ClassPathXmlApplicationContext a = new ClassPathXmlApplicationContext();
		*a.setConfigLocations(new String[]{V2_GET_DETAILS_V2_XML});*
		return a;


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

View raw message