camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: errorHandler when stopping routes in test
Date Wed, 12 Jan 2011 08:39:22 GMT
Hi John,

Please feel free to create a JIRA here[1] so we can trace it.

[1]https://issues.apache.org/jira/browse/CAMEL

Willem
On 1/11/11 9:16 PM, John wrote:
>
> I'm running the test via junit4. My test class extends CamelTestSupport.
>
> Below is the test itself, if that helps.
>
> Thanks!
>
> -john
>
>      @Test
>      public void testIssue() throws Exception {
>
>          RouteDefinition testRoute = context.getRouteDefinition("TestRoute");
>          testRoute.adviceWith(context, new RouteBuilder() {
>              @Override
>              public void configure() throws Exception {
>                  interceptSendToEndpoint("seda:*")
>                  .skipSendToOriginalEndpoint()
>                  .process(new Processor() {
>                      public void process(Exchange exchange) throws Exception
> {
>                          throw new Exception("Forced");
>                      }
>                  });
>              }
>          });
>
>          RouteDefinition smtpRoute = context.getRouteDefinition("smtpRoute");
>          smtpRoute.adviceWith(context, new RouteBuilder() {
>              @Override
>              public void configure() throws Exception
>              {
>                  interceptSendToEndpoint("smtp*")
>                      .skipSendToOriginalEndpoint()
>                      .to("mock:smtp");
>              }
>          });
>
>          getMockEndpoint("mock:smtp").expectedMessageCount(1);
>
>          RouteDefinition pollRoute = context.getRouteDefinition("pollRoute");
>          context.stopRoute(pollRoute.getId());
>
>          template.sendBody("direct:start", "Hello World");
>
>          assertMockEndpointsSatisfied();
>      }
>
>


-- 
Willem
----------------------------------
FuseSource
Web: http://www.fusesource.com
Blog:    http://willemjiang.blogspot.com (English)
          http://jnn.javaeye.com (Chinese)
Twitter: willemjiang

Mime
View raw message