camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raul Kripalani <r...@evosent.com>
Subject Re: disable timer for unit tests
Date Sun, 10 Feb 2013 15:32:14 GMT
Hi,

Identify the timer-based route with an explicit routeId:

from("timer:...").routeId("timed-route")...

And then stop it explicitly from your test code:

context.stopRoute("timed-route");

Alternatively, you could disable autostart for that route altogether, but
then you have to start it manually for production usage.

Or use a system property to control the behaviour per environment. See
http://camel.apache.org/configuring-route-startup-ordering-and-autostartup.html.


Hope that helps,
Raúl.
On 10 Feb 2013 14:41, "martin11" <mato.krajcir@gmail.com> wrote:

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.html
Sent from the Camel - Users mailing list archive at Nabble.com.

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