Author: davsclaus
Date: Wed Jan 27 21:34:44 2010
New Revision: 903849

URL: http://svn.apache.org/viewvc?rev=903849&view=rev
Log:
CAMEL-2408: Added spring test for wiretap and aggregator.

Added:
    
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.java
      - copied, changed from r903710, 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringChoiceTest.java
    
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.xml
      - copied, changed from r903710, 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aopafter.xml
Modified:
    
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateFromWireTapTest.java

Modified: 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateFromWireTapTest.java
URL: 
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateFromWireTapTest.java?rev=903849&r1=903848&r2=903849&view=diff
==============================================================================
--- 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateFromWireTapTest.java
 (original)
+++ 
camel/trunk/camel-core/src/test/java/org/apache/camel/processor/aggregator/AggregateFromWireTapTest.java
 Wed Jan 27 21:34:44 2010
@@ -62,7 +62,7 @@
         };
     }
 
-    private static class MyAggregationStrategy implements AggregationStrategy {
+    public static class MyAggregationStrategy implements AggregationStrategy {
 
         public Exchange aggregate(Exchange oldExchange, Exchange newExchange) {
             if (oldExchange == null) {

Copied: 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.java
 (from r903710, 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringChoiceTest.java)
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.java?p2=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.java&p1=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringChoiceTest.java&r1=903710&r2=903849&rev=903849&view=diff
==============================================================================
--- 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringChoiceTest.java
 (original)
+++ 
camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.java
 Wed Jan 27 21:34:44 2010
@@ -17,14 +17,15 @@
 package org.apache.camel.spring.processor;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.processor.ChoiceTest;
+import org.apache.camel.processor.aggregator.AggregateFromWireTapTest;
+
 import static 
org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
 
 /**
  * @version $Revision$
  */
-public class SpringChoiceTest extends ChoiceTest {
+public class SpringAggregateFromWireTapTest extends AggregateFromWireTapTest {
     protected CamelContext createCamelContext() throws Exception {
-        return createSpringCamelContext(this, 
"org/apache/camel/spring/processor/choice.xml");
+        return createSpringCamelContext(this, 
"org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.xml");
     }
 }
\ No newline at end of file

Copied: 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.xml
 (from r903710, 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aopafter.xml)
URL: 
http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.xml?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aopafter.xml&r1=903710&r2=903849&rev=903849&view=diff
==============================================================================
--- 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aopafter.xml
 (original)
+++ 
camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringAggregateFromWireTapTest.xml
 Wed Jan 27 21:34:44 2010
@@ -22,16 +22,27 @@
        http://camel.apache.org/schema/spring 
http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <!-- START SNIPPET: e1 -->
     <camelContext id="camel" xmlns="http://camel.apache.org/schema/spring";>
         <route>
             <from uri="direct:start"/>
-            <aop afterUri="mock:after">
-                <transform><constant>Bye World</constant></transform>
-                <to uri="mock:result"/>
-            </aop>
+            <wireTap uri="direct:tap"/>
+            <to uri="mock:end"/>
+        </route>
+
+        <route>
+            <from uri="direct:tap"/>
+            <aggregate batchSize="2" batchTimeout="5000" 
strategyRef="myStrategy">
+                
<correlationExpression><constant>true</constant></correlationExpression>
+                <to uri="direct:aggregated"/>
+            </aggregate>
+        </route>
+
+        <route>
+            <from uri="direct:aggregated"/>
+            <to uri="mock:aggregated"/>
         </route>
     </camelContext>
-    <!-- END SNIPPET: e1 -->
+
+    <bean id="myStrategy" 
class="org.apache.camel.processor.aggregator.AggregateFromWireTapTest$MyAggregationStrategy"/>
 
 </beans>


Reply via email to