camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r655728 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MultiCastAggregatorTest.java
Date Tue, 13 May 2008 04:21:06 GMT
Author: davsclaus
Date: Mon May 12 21:21:05 2008
New Revision: 655728

URL: http://svn.apache.org/viewvc?rev=655728&view=rev
Log:
CAMEL-510: Applied patch with thanks to William Tam

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MultiCastAggregatorTest.java

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MultiCastAggregatorTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MultiCastAggregatorTest.java?rev=655728&r1=655727&r2=655728&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MultiCastAggregatorTest.java
(original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/MultiCastAggregatorTest.java
Mon May 12 21:21:05 2008
@@ -90,7 +90,8 @@
     private class BodyInAggregatingStrategy implements AggregationStrategy {
 
         public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
-            Message newIn = newExchange.getIn();
+            Exchange copy = newExchange.copy();
+            Message newIn = copy.getIn();
             String oldBody = oldExchange.getIn().getBody(String.class);
             String newBody = newIn.getBody(String.class);
             newIn.setBody(oldBody + "+" + newBody);
@@ -98,21 +99,9 @@
             if (old == null) {
                 old = 1;
             }
-            newExchange.setProperty("aggregated", old + 1);
-            return newExchange;
+            copy.setProperty("aggregated", old + 1);
+            return copy;
         }
-
-        /**
-         * An expression used to determine if the aggregation is complete
-         */
-        public boolean isCompleted(@Header(name = "aggregated")
-                                   Integer aggregated) {
-            if (aggregated == null) {
-                return false;
-            }
-            return aggregated == 3;
-        }
-
     }
 
     protected RouteBuilder createRouteBuilder() {



Mime
View raw message