You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by anand sridhar <an...@gmail.com> on 2012/01/25 22:55:39 UTC

Unit testing with Camel - Alter Route for each testcase.

Hi,
I have a Unit test class to test a route.

My Route is :

from("endpoint1")
.to("endpoint2")
.to("endpoint3")
.to("endpoint4")
;

I want to set up a unit test case that tests parts of the above route.

For eg, from("endpoint2").to("endpoint3"); ,
from("endpoint3").to("endpoint4") can be two different test methods.

Right now, I can override the createRouteBuilder from CamelTestCase and
create the first route but cannot really modify the route there after.
Is there any way to alter the route for each test case. ?

Thanks,
Anand

Re: Unit testing with Camel - Alter Route for each testcase.

Posted by anand sridhar <an...@gmail.com>.
Thanks.
Will check that.

On Wed, Jan 25, 2012 at 2:36 PM, Babak Vahdat
<ba...@swissonline.ch>wrote:

> Hi
>
> you can make use of the AdviceWith facility [1] at runtime by each of your
> given test cases to change your routing chain before pushing exchanges into
> it.
>
> [1] http://camel.apache.org/advicewith.html
>
> Babak
>
> --
> View this message in context:
> http://camel.465427.n5.nabble.com/Unit-testing-with-Camel-Alter-Route-for-each-testcase-tp5431445p5431549.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>

Re: Unit testing with Camel - Alter Route for each testcase.

Posted by Babak Vahdat <ba...@swissonline.ch>.
Hi

you can make use of the AdviceWith facility [1] at runtime by each of your
given test cases to change your routing chain before pushing exchanges into
it.

[1] http://camel.apache.org/advicewith.html

Babak

--
View this message in context: http://camel.465427.n5.nabble.com/Unit-testing-with-Camel-Alter-Route-for-each-testcase-tp5431445p5431549.html
Sent from the Camel - Users mailing list archive at Nabble.com.