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

Claus Ibsen resolved CAMEL-177.
-------------------------------

    Resolution: Incomplete

Create a new bug if this issue still exists. We have changed a lot in the code 
base since this bug was reported, and James have already fixed what Nicky 
spotted.

> Splitter forwards pre split exchanges out message
> -------------------------------------------------
>
>                 Key: CAMEL-177
>                 URL: https://issues.apache.org/activemq/browse/CAMEL-177
>             Project: Apache Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Nicky Sandhu
>             Fix For: 2.0.0
>
>         Attachments: pipeline.splitter-patch11102007.txt
>
>
> Added to test... existing test passes, new test fails. Follow up from 
> discussion 
> http://www.nabble.com/Pipeline-createNewExchange-t4609319s22882.html
> Index: 
> C:/backyard/camel/camel-core/src/test/java/org/apache/camel/processor/SplitterTest.java
> ===================================================================
> --- 
> C:/backyard/camel/camel-core/src/test/java/org/apache/camel/processor/SplitterTest.java
>    (revision 583358)
> +++ 
> C:/backyard/camel/camel-core/src/test/java/org/apache/camel/processor/SplitterTest.java
>    (working copy)
> @@ -30,19 +30,40 @@
>  public class SplitterTest extends ContextTestSupport {
>      protected Endpoint<Exchange> startEndpoint;
>      protected MockEndpoint resultEndpoint;
> +    protected MockEndpoint nextResultEndpoint;
>  
>      public void testSendingAMessageUsingMulticastReceivesItsOwnExchange() 
> throws Exception {
>          resultEndpoint.expectedBodiesReceived("James", "Guillaume", "Hiram", 
> "Rob");
> +        nextResultEndpoint.expectedBodiesReceived("James", "Guillaume", 
> "Hiram", "Rob");
> +        
> +        template.send("direct:a", new Processor() {
> +            public void process(Exchange exchange) {
> +                Message in = exchange.getIn();
> +                in.setBody("James,Guillaume,Hiram,Rob");
> +                in.setHeader("foo", "bar");
> +            }
> +        });
>  
> +        resultEndpoint.assertIsSatisfied();
> +        nextResultEndpoint.assertIsSatisfied();
> +    }
> +
> +    public void testSendingAMessageDoesNotForwardOutBody() throws Exception {
> +        resultEndpoint.expectedBodiesReceived("James", "Guillaume", "Hiram", 
> "Rob");
> +        nextResultEndpoint.expectedBodiesReceived("James", "Guillaume", 
> "Hiram", "Rob");
> +        
>          template.send("direct:a", new Processor() {
>              public void process(Exchange exchange) {
>                  Message in = exchange.getIn();
>                  in.setBody("James,Guillaume,Hiram,Rob");
>                  in.setHeader("foo", "bar");
> +                Message out = exchange.getOut();
> +                out.setBody("Some Junk");
>              }
>          });
>  
>          resultEndpoint.assertIsSatisfied();
> +        nextResultEndpoint.assertIsSatisfied();
>      }
>  
>      @Override
> @@ -50,12 +71,13 @@
>          super.setUp();
>  
>          resultEndpoint = getMockEndpoint("mock:result");
> +        nextResultEndpoint = getMockEndpoint("mock:nextResult");
>      }
>  
>      protected RouteBuilder createRouteBuilder() {
>          return new RouteBuilder() {
>              public void configure() {
> -                
> from("direct:a").splitter(body().tokenize(",")).to("mock:result");
> +                
> from("direct:a").splitter(body().tokenize(",")).to("mock:result","mock:nextResult");
>              }
>          };
>      }

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

Reply via email to