camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r818817 - in /camel/trunk/components/camel-spring/src/test: java/org/apache/camel/spring/processor/SpringCBRHeaderPredicateTest.java resources/org/apache/camel/spring/processor/CBRHeaderPredicateTest.xml
Date Fri, 25 Sep 2009 11:02:06 GMT
Author: davsclaus
Date: Fri Sep 25 11:02:05 2009
New Revision: 818817

URL: http://svn.apache.org/viewvc?rev=818817&view=rev
Log:
Added spring based CBR using bean as predicate test

Added:
    camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringCBRHeaderPredicateTest.java
      - copied, changed from r818745, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregatorTest.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/CBRHeaderPredicateTest.xml
      - copied, changed from r818745, camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aopafter.xml

Copied: camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringCBRHeaderPredicateTest.java
(from r818745, camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregatorTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringCBRHeaderPredicateTest.java?p2=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringCBRHeaderPredicateTest.java&p1=camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregatorTest.java&r1=818745&r2=818817&rev=818817&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringAggregatorTest.java
(original)
+++ camel/trunk/components/camel-spring/src/test/java/org/apache/camel/spring/processor/SpringCBRHeaderPredicateTest.java
Fri Sep 25 11:02:05 2009
@@ -17,14 +17,15 @@
 package org.apache.camel.spring.processor;
 
 import org.apache.camel.CamelContext;
-import org.apache.camel.processor.AggregatorTest;
+import org.apache.camel.processor.CBRHeaderPredicateTest;
 import static org.apache.camel.spring.processor.SpringTestHelper.createSpringCamelContext;
 
 /**
  * @version $Revision$
  */
-public class SpringAggregatorTest extends AggregatorTest {
+public class SpringCBRHeaderPredicateTest extends CBRHeaderPredicateTest {
+
     protected CamelContext createCamelContext() throws Exception {
-        return createSpringCamelContext(this, "org/apache/camel/spring/processor/aggregator.xml");
+        return createSpringCamelContext(this, "org/apache/camel/spring/processor/CBRHeaderPredicateTest.xml");
     }
 }
\ No newline at end of file

Copied: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/CBRHeaderPredicateTest.xml
(from r818745, 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/CBRHeaderPredicateTest.xml?p2=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/CBRHeaderPredicateTest.xml&p1=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/aopafter.xml&r1=818745&r2=818817&rev=818817&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/CBRHeaderPredicateTest.xml
Fri Sep 25 11:02:05 2009
@@ -22,16 +22,21 @@
        http://camel.apache.org/schema/spring http://camel.apache.org/schema/spring/camel-spring.xsd
     ">
 
-    <!-- START SNIPPET: e1 -->
+    <bean id="cbrBean" class="org.apache.camel.processor.CBRHeaderPredicateTest$MyCBRBean"/>
+
     <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>
+            <choice>
+                <when>
+                    <method bean="cbrBean" method="checkHeader"/>
+                    <to uri="mock:foo"/>
+                </when>
+                <otherwise>
+                    <to uri="mock:bar"/>
+                </otherwise>
+            </choice>
         </route>
     </camelContext>
-    <!-- END SNIPPET: e1 -->
 
 </beans>



Mime
View raw message