camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tarjei Huse <>
Subject Re: camel test kit
Date Fri, 27 Jan 2012 08:42:22 GMT
On 01/27/2012 09:25 AM, Claus Ibsen wrote:
> Hi
> Can you be more specific how this is related to C
> This is not really Camel specific, but about timing issues from unit
> tests running on CI servers.
> On Fri, Jan 27, 2012 at 9:03 AM, Filippo Balicchia <> wrote:
>> Hi,
>> When use camelTestSuport is possible to avoid the use of Thread.sleep
>> for gives Camel to React and and route ?
>> Suppose that  test is running on CI where cpu  it is particularly
>> busy, with thread.sleep
>> there is a risk that the test should not fail even if

This is what you use the MockEndpoint.assertSatisfied() methods for. You
await a reaction at the end of the route. If it is not possible to await
the end of the route because it ends in a dead end (f.x. a db value is
updated) then inject an extra listener that you can wait for.

Tip if you got multiple tests running in the same jvm then it is often a
good idea to call

As spring has a tendency to reuse too much of the context.

A bit sample code to get you started:

RouteDefinition rdef = context().getRouteDefinition(routeName);
rdef.adviceWith(context(), new AdviceWithRouteBuilder() {
            public void configure() throws Exception {
                .before().log(("[MOCK] message for ${header.dest}
sending to mock")).to("mock:myMock");

>> Cheers
>> --Filippo

Regards / Med vennlig hilsen
Tarjei Huse
Mobil: 920 63 413

View raw message