camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Kaul, Prerna " <prerna.k...@citi.com>
Subject Camel Testing Framework
Date Mon, 25 Jul 2011 17:57:26 GMT
Hi,

I am trying to use the Camel Spring Junit test framework. I have defined a route which has
a polling consumer(not "direct:start" but "myComponent:parameters") and a mock processor endpoint
("mock:result"), using Spring DSL.

<route id="myRoute">
        <from uri="myConsumer" />
        <to uri="mock:result" />
</route>

When I start the Junit test, I receive the error below. "myConsumer" is able to successfully
process and set the exchange by using a custom implementation of "Processor". I'm not sure
what I'm doing wrong here. Could somebody help? Thanks so much!

java.lang.IllegalStateException: SendProcessor has not been started: sendTo(Endpoint[mock://static])
        at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:94)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
        at org.apache.camel.processor.interceptor.TraceInterceptor.process(TraceInterceptor.java:99)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
        at org.apache.camel.processor.RedeliveryErrorHandler.processErrorHandler(RedeliveryErrorHandler.java:299)
        at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:208)
        at org.apache.camel.processor.DefaultChannel.process(DefaultChannel.java:269)
        at org.apache.camel.processor.UnitOfWorkProcessor.process(UnitOfWorkProcessor.java:109)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:77)
        at org.apache.camel.processor.DelegateAsyncProcessor.processNext(DelegateAsyncProcessor.java:98)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:89)
        at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:68)
        at org.apache.camel.util.AsyncProcessorHelper.process(AsyncProcessorHelper.java:103)
        at org.apache.camel.processor.DelegateAsyncProcessor.process(DelegateAsyncProcessor.java:85)
        at gravity.framework.component.myComp.MYCOMPConsumer.processorHelper(MYCOMPConsumer.java:23)
        at gravity.framework.component.myComp.MYCOMPConsumer.<init>(MYCOMPConsumer.java:15)
        at gravity.framework.component.myComp.MYCOMPEndpoint.createConsumer(MYCOMPEndpoint.java:35)
        at org.apache.camel.impl.EventDrivenConsumerRoute.addServices(EventDrivenConsumerRoute.java:61)
        at org.apache.camel.impl.DefaultRoute.onStartingServices(DefaultRoute.java:75)
        at org.apache.camel.impl.RouteService.warmUp(RouteService.java:128)
        at org.apache.camel.impl.DefaultCamelContext.doWarmUpRoutes(DefaultCamelContext.java:1832)
        at org.apache.camel.impl.DefaultCamelContext.safelyStartRouteServices(DefaultCamelContext.java:1758)
        at org.apache.camel.impl.DefaultCamelContext.doStartOrResumeRoutes(DefaultCamelContext.java:1548)
        at org.apache.camel.impl.DefaultCamelContext.doStartCamel(DefaultCamelContext.java:1440)
        at org.apache.camel.impl.DefaultCamelContext.doStart(DefaultCamelContext.java:1336)
        at org.apache.camel.spring.SpringCamelContext.doStart(SpringCamelContext.java:164)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:67)
        at org.apache.camel.impl.ServiceSupport.start(ServiceSupport.java:54)
        at org.apache.camel.impl.DefaultCamelContext.start(DefaultCamelContext.java:1314)
        at org.apache.camel.spring.SpringCamelContext.maybeStart(SpringCamelContext.java:203)
        at org.apache.camel.spring.SpringCamelContext.onApplicationEvent(SpringCamelContext.java:101)
        at org.apache.camel.spring.CamelContextFactoryBean.onApplicationEvent(CamelContextFactoryBean.java:238)
        at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:97)
        at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:303)
        at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:911)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:428)
        at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:84)
        at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:1)
        at org.springframework.test.context.TestContext.loadApplicationContext(TestContext.java:280)
        at org.springframework.test.context.TestContext.getApplicationContext(TestContext.java:304)
        at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
        at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
        at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:333)
        at org.springframework.test.context.junit38.AbstractJUnit38SpringContextTests.runBare(AbstractJUnit38SpringContextTests.java:205)
        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:232)
        at junit.framework.TestSuite.run(TestSuite.java:227)
        at org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:83)
        at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
        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)


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message