You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@camel.apache.org by "Nicky Sandhu (JIRA)" <ji...@apache.org> on 2007/10/11 23:04:23 UTC
[jira] Created: (CAMEL-177) Splitter forwards pre split exchanges
out message
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.
[jira] Updated: (CAMEL-177) Splitter forwards pre split exchanges
out message
Posted by "Nicky Sandhu (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Nicky Sandhu updated CAMEL-177:
-------------------------------
Attachment: pipeline.splitter-patch11102007.txt
Please review this patch carefully. It makes some changes to the tests as well so some assertions are removed/changed to make the test pass. I did this after some thought of what a pipeline should do and am looking for other suggestions/solutions
> 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
> 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.
[jira] Commented: (CAMEL-177) Splitter forwards pre split exchanges
out message
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/activemq/browse/CAMEL-177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=46348#action_46348 ]
Claus Ibsen commented on CAMEL-177:
-----------------------------------
Nicky I know this is +1 year since. But what was the original problem you try to solve?
> 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.
[jira] Resolved: (CAMEL-177) Splitter forwards pre split exchanges
out message
Posted by "Claus Ibsen (JIRA)" <ji...@apache.org>.
[ 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.