camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Strachan (JIRA)" <j...@apache.org>
Subject [jira] Resolved: (CAMEL-240) Intercept/proceed seems to be broken
Date Tue, 20 Nov 2007 15:01:34 GMT

     [ https://issues.apache.org/activemq/browse/CAMEL-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

James Strachan resolved CAMEL-240.
----------------------------------

       Resolution: Fixed
    Fix Version/s: 1.3.0

Resolved! 

> Intercept/proceed seems to be broken
> ------------------------------------
>
>                 Key: CAMEL-240
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-240
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: William Tam
>             Fix For: 1.3.0
>
>
> This problem can be demontrated by org.apache.camel.processor.InterceptWithoutProceedRouteTest
>     protected RouteBuilder createRouteBuilder() {
>         return new RouteBuilder() {
>             public void configure() {
>                 // we will disable the output to 'mock:a' since we never proceed()
>                 intercept().filter(header("foo").isEqualTo("bar")).to("mock:b");
>                 from("direct:start").to("mock:a");
>             }
>         };
>     }
> If I slightly modify the testSendMatchingMessage() to make sure that my message was not
proceeded to "mock:a", it fails.
>     public void testSendMatchingMessage() throws Exception {
>         b.expectedMessageCount(1);
>         a.expectedMessageCount(0);  // added by me
>         template.sendBodyAndHeader("direct:start", "<matched/>", "foo", "bar");
>         assertMockEndpointsSatisifed();
>     }
> The problem can be observed in org.apache.camel.processor.InterceptRouteTest.
>     protected RouteBuilder createRouteBuilder() {
>         return new RouteBuilder() {
>             public void configure() {
>                 intercept().choice().
>                         when(header("foo").isEqualTo("bar")).to("mock:b").
>                         otherwise().proceed();
>                 from("direct:start").to("mock:a");
>             }
>         };
>     }
>   public void testSendMatchingMessage() throws Exception {
>         a.expectedMessageCount(0);  //   I don't expect mock:a to receive my message,
but it did.
>         b.expectedMessageCount(1);
>         template.sendBodyAndHeader("direct:start", "<matched/>", "foo", "bar");
>         assertMockEndpointsSatisifed();
>     }

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message