camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mark Webb <elihusma...@gmail.com>
Subject unit testing Spring XML route
Date Mon, 01 Nov 2010 20:16:15 GMT
I have a route defined in XML that I want to unit test.  Is there a
way to do this?  I have found CamelSpringTestSupport, but I am not
sure that is what I want.  When I run a unit test that extends
CamelSpringTestSupport I get the following stack trace.

org.apache.camel.CamelExecutionException: Exception occurred during
execution on the exchange: Exchange[Message: HELLO WORLD]
	at org.apache.camel.util.ObjectHelper.wrapCamelExecutionException(ObjectHelper.java:1156)
	at org.apache.camel.util.ExchangeHelper.extractResultBody(ExchangeHelper.java:456)
	at org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:441)
	at org.apache.camel.impl.DefaultProducerTemplate.extractResultBody(DefaultProducerTemplate.java:437)
	at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:125)
	at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:341)
	at com.x.y.z.RecipientXmlTest.testTest(RecipientXmlTest.java:33)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at junit.framework.TestCase.runTest(TestCase.java:168)
	at junit.framework.TestCase.runBare(TestCase.java:134)
	at org.apache.camel.test.TestSupport.runBare(TestSupport.java:65)
	at junit.framework.TestResult$1.protect(TestResult.java:110)
	at junit.framework.TestResult.runProtected(TestResult.java:128)
	at junit.framework.TestResult.run(TestResult.java:113)
	at junit.framework.TestCase.run(TestCase.java:124)
	at junit.framework.TestSuite.runTest(TestSuite.java:243)
	at junit.framework.TestSuite.run(TestSuite.java:238)
	at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:49)
	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
Caused by: org.apache.camel.CamelExchangeException: No consumers
available on endpoint: Endpoint[direct://start]. Exchange[Message:
HELLO WORLD]
	at org.apache.camel.component.direct.DirectProducer.process(DirectProducer.java:56)
	at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:99)
	at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:91)
	at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
	at org.apache.camel.processor.UnitOfWorkProducer.process(UnitOfWorkProducer.java:63)
	at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:333)
	at org.apache.camel.impl.ProducerCache$1.doInProducer(ProducerCache.java:303)
	at org.apache.camel.impl.ProducerCache.doInProducer(ProducerCache.java:208)
	at org.apache.camel.impl.ProducerCache.sendExchange(ProducerCache.java:303)
	at org.apache.camel.impl.ProducerCache.send(ProducerCache.java:154)
	at org.apache.camel.impl.DefaultProducerTemplate.send(DefaultProducerTemplate.java:110)
	at org.apache.camel.impl.DefaultProducerTemplate.sendBody(DefaultProducerTemplate.java:123)
	... 22 more

Mime
View raw message