svn commit: r639484 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r639484 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java

romkal-2
Author: romkal
Date: Thu Mar 20 15:12:23 2008
New Revision: 639484

URL: http://svn.apache.org/viewvc?rev=639484&view=rev
Log:
CAMEL-393 - test showing the problem described in the issue

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

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java?rev=639484&r1=639483&r2=639484&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/AggregatorTest.java Thu Mar 20 15:12:23 2008
@@ -69,12 +69,23 @@
         resultEndpoint.assertIsSatisfied();
     }
     
+    public void _testAggregatorNotAtStart() throws Exception {
+        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
+        resultEndpoint.expectedMessageCount(1);
+        resultEndpoint.message(0).header("visited").isNotNull();
+        resultEndpoint.setSleepForEmptyTest(2 * BatchProcessor.DEFAULT_BATCH_TIMEOUT);
+        template.sendBodyAndHeader("seda:header", "message:1", "cheese", 123);
+        resultEndpoint.assertIsSatisfied();
+    }
+    
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
                 // START SNIPPET: ex
                 from("direct:start").aggregator(header("cheese")).to("mock:result");
 
+                from("seda:header").setHeader("visited", constant(true)).aggregator(header("cheese")).to("mock:result");
+                
                 from("direct:predicate").aggregator(header("cheese"), new MyAggregationStrategy()).
                         completedPredicate(header("aggregated").isEqualTo(5)).to("mock:result");
                 // END SNIPPET: ex