camel-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nicky Sandhu (JIRA)" <j...@apache.org>
Subject [jira] Created: (CAMEL-177) Splitter forwards pre split exchanges out message
Date Thu, 11 Oct 2007 21:04:23 GMT
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


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.


Mime
View raw message