You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Sri <sr...@googlemail.com> on 2012/08/14 23:24:29 UTC
Unit test failing onException clause
Hi ,
I have a route with OnException, when I try to create unit test for the
route it actually faliling and saying it does not find any route
java.lang.IllegalArgumentException: There are no outputs which matches:
ProcessorDefinition in the route: Route[[From[activemq:queue:dispatch]] ->
[OnException[[class
bbc.syndicationmanager.dispatcher.RestClient500SeriesException] ->
[process[bbc.syndicationmanager.dispatcher.Dispatch500ErrorProcessor@7dc8f91e],
process[bbc.syndicationmanager.dispatcher.ClientProcessor@5d0e8647]]]
my routes are below.
onException(RestClient500SeriesException.class)
.maximumRedeliveries(retries).redeliveryDelay(retryDelay)
.process(dispatch500ErrorProcessor)
.end()
.routeId(
Constants.ROUTE_ID_DISPATCHER_DISPATCH_FAILURE_500_DEAL);
from(dispatchEndpoint).process(clientProcessor).routeId(
Constants.ROUTE_ID_DISPATCHER_DISPATCH_DEAL);
And the unit test I written as follows
context.addComponent(Constants.COMPONENT_ACTIVEMQ, jms);
context.addRoutes(routeDispatchDeal);
RouteDefinition routeDef =
context.getRouteDefinition(Constants.ROUTE_ID_DISPATCHER_DISPATCH_DEAL);
assertNotNull(routeDef);
routeDef.adviceWith(context, new AdviceWithRouteBuilder() {
@Override
public void configure() throws Exception {
weaveByType(ProcessorDefinition.class).selectFirst().replace().process(clientProcessor);
}
});
I am using camel 2.9.1
Active MQ 4.5.1
Java 1.6
Regards
Sri
--
View this message in context: http://camel.465427.n5.nabble.com/Unit-test-failing-onException-clause-tp5717350.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Unit test failing onException clause
Posted by Sri <sr...@googlemail.com>.
sorry for misspelling ur name :)
--
View this message in context: http://camel.465427.n5.nabble.com/Unit-test-failing-onException-clause-tp5717350p5717666.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Unit test failing onException clause
Posted by Babak Vahdat <ba...@swissonline.ch>.
You welcome.
BTW my name is not Barek but Babak. :-)
Babak
--
View this message in context: http://camel.465427.n5.nabble.com/Unit-test-failing-onException-clause-tp5717350p5717494.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Unit test failing onException clause
Posted by Sri <sr...@googlemail.com>.
Thank you Barek , It worked.
--
View this message in context: http://camel.465427.n5.nabble.com/Unit-test-failing-onException-clause-tp5717350p5717448.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Unit test failing onException clause
Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi
you should do:
weaveByType(ProcessDefinition.class)
instead of:
weaveByType(ProcessorDefinition.class)
Babak
--
View this message in context: http://camel.465427.n5.nabble.com/Unit-test-failing-onException-clause-tp5717350p5717356.html
Sent from the Camel - Users mailing list archive at Nabble.com.