One possibility is having a flag:

createRouteBuilder() {
   from(...).to(...); // standard routes
   if (inProduction) {
       from("timer:...").to(...);
   }
}

Or specify the timer in a special class which you dont start via Spring.

Not sure if the ControlBus could help (is just a pattern which comes to my
mind...)


Jan

-----Ursprüngliche Nachricht-----
Von: martin11 [mailto:mato.kraj...@gmail.com] 
Gesendet: Sonntag, 10. Februar 2013 15:41
An: users@camel.apache.org
Betreff: disable timer for unit tests

Hello,

I use Camel ver. 2.10.1 and in production context I use timers (cca 10sec.)
to create an event on route.

I also create unit tests (extended from CamelSpringTestSupport) for my
production context to make tests on individual routes.
When I run my tests, timers expires and start new route. Because it is only
test, than I don`t have a connection to external endpoints (database, LDAP,
etc..) and it cause exceptions in log file. Of course it does not affect
result of my test, but logs are unobvious.

How can I disable timers inside production context when running unit tests?

Thanks for any advice!




--
View this message in context:
http://camel.465427.n5.nabble.com/disable-timer-for-unit-tests-tp5727302.htm
l
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to