Hello Willem, hello list!

Today I found a bit time to look again into this issue and I could solve it
(will provide a unit test later for this).

The trick was to use
context.stopRoute(routeId);
instead of
((DefaultRoute) context.getRoute(routeId)).stop(); // doesn't work

Also
context.removeRoute(routeId);
only removes the route, if the routeStatus is already "stopped" (which was
not the case in my unit test because the route was started automaticly).

Best,
Christian

On Thu, Aug 25, 2011 at 3:46 AM, Willem Jiang <willem.ji...@gmail.com>wrote:

> Hi Christian,
>
> It looks like the route2 doesn't be shutdown, so your mock endpoint only
> get 5 messages.
>
> Here is the setup code snippet which is the only change in the test code.
>
>
>    @Override
>    @Before
>    public void setUp() throws Exception {
>        super.setUp();
>
>        //DefaultRoute route2 = (DefaultRoute)
> context.getRoute(Route2.class.**getName());
>        //route2.stop();
>
>        context.removeRoute(Route2.**class.getName());
>
>        context.addRoutes(new RouteBuilder() {
>            @Override
>            public void configure() throws Exception {
>                from("activemq:queue:foo")
>                    .to(mockEndpointFoo);
>            }
>        });
>    }
>
>
>
> On 8/25/11 12:29 AM, Christian Müller wrote:
>
>> Hello Willem!
>>
>> Today, I tested it again with 2.8.0 and 2.9-SNAPSHOT (log attached at the
>> end of this mail) and my test still fails. Any ideas what's going wrong?
>>
>> My env:
>> Java version: 1.6.0_26, vendor: Apple Inc.
>> Java home: /System/Library/Java/**JavaVirtualMachines/1.6.0.jdk/**
>> Contents/Home
>> Default locale: en_US, platform encoding: MacRoman
>> OS name: "mac os x", version: "10.7.1", arch: "x86_64", family: "mac"
>> Processor: 3.06 GHz Intel Core 2 Duo
>>
>> Best,
>> Christian
>>
>>
>
> --
> Willem
> ------------------------------**----
> FuseSource
> Web: http://www.fusesource.com
> Blog:    
> http://willemjiang.blogspot.**com<http://willemjiang.blogspot.com>(English)
>         http://jnn.javaeye.com (Chinese)
> Twitter: willemjiang
> Weibo: willemjiang
>

Reply via email to