You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ni...@apache.org on 2010/04/23 08:07:04 UTC

svn commit: r937165 - in /camel/trunk: camel-core/src/test/java/org/apache/camel/processor/ components/camel-spring/src/test/resources/org/apache/camel/spring/processor/

Author: ningjiang
Date: Fri Apr 23 06:07:03 2010
New Revision: 937165

URL: http://svn.apache.org/viewvc?rev=937165&view=rev
Log:
Updated the PolicyPerRouteTest and PolicyPerProcessTest

Modified:
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerProcessorTest.java
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerRouteTest.java
    camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/PolicyPerRouteTest.xml

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerProcessorTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerProcessorTest.java?rev=937165&r1=937164&r2=937165&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerProcessorTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerProcessorTest.java Fri Apr 23 06:07:03 2010
@@ -33,9 +33,11 @@ public class PolicyPerProcessorTest exte
         getMockEndpoint("mock:foo").expectedMessageCount(1);
         getMockEndpoint("mock:foo").expectedHeaderReceived("foo", "was wrapped");
         getMockEndpoint("mock:bar").expectedMessageCount(1);
-        getMockEndpoint("mock:bar").expectedHeaderReceived("foo", "was wrapped");
+        getMockEndpoint("mock:bar").expectedHeaderReceived("foo", "police finished excution");
         getMockEndpoint("mock:bar").expectedHeaderReceived("bar", "was wrapped");
         getMockEndpoint("mock:result").expectedMessageCount(1);
+        getMockEndpoint("mock:result").expectedHeaderReceived("foo", "police finished excution");               
+        getMockEndpoint("mock:result").expectedHeaderReceived("bar", "police finished excution");
 
         template.sendBody("direct:start", "Hello World");
 
@@ -91,6 +93,7 @@ public class PolicyPerProcessorTest exte
                     exchange.getIn().setHeader(name, "was wrapped");
                     // let the original processor continue routing
                     processor.process(exchange);
+                    exchange.getIn().setHeader(name, "police finished excution");
                 }
             };
         }

Modified: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerRouteTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerRouteTest.java?rev=937165&r1=937164&r2=937165&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerRouteTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/PolicyPerRouteTest.java Fri Apr 23 06:07:03 2010
@@ -36,8 +36,10 @@ public class PolicyPerRouteTest extends 
         getMockEndpoint("mock:bar").expectedHeaderReceived("foo", "was wrapped");
         getMockEndpoint("mock:result").expectedMessageCount(1);
         getMockEndpoint("mock:result").expectedHeaderReceived("foo", "was wrapped");
-
-        template.sendBody("direct:start", "Hello World");
+        
+        getMockEndpoint("mock:response").expectedMessageCount(1);
+        getMockEndpoint("mock:response").expectedHeaderReceived("foo", "policy finished excution");
+        template.sendBody("direct:send", "Hello World");
 
         assertMockEndpointsSatisfied();
 
@@ -66,6 +68,10 @@ public class PolicyPerRouteTest extends 
                         .to("mock:bar")
                         .to("mock:result");
                 // END SNIPPET: e1
+                
+                from("direct:send")
+                    .to("direct:start")
+                    .to("mock:response");
             }
         };
     }
@@ -83,10 +89,10 @@ public class PolicyPerRouteTest extends 
             return new Processor() {
                 public void process(Exchange exchange) throws Exception {
                     invoked++;
-
-                    exchange.getIn().setHeader(name, "was wrapped");
                     // let the original processor continue routing
+                    exchange.getIn().setHeader(name, "was wrapped");
                     processor.process(exchange);
+                    exchange.getIn().setHeader(name, "policy finished excution");
                 }
             };
         }

Modified: camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/PolicyPerRouteTest.xml
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/PolicyPerRouteTest.xml?rev=937165&r1=937164&r2=937165&view=diff
==============================================================================
--- camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/PolicyPerRouteTest.xml (original)
+++ camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/PolicyPerRouteTest.xml Fri Apr 23 06:07:03 2010
@@ -39,6 +39,11 @@
             </policy>
         </route>
         <!-- END SNIPPET: e1 -->
+        <route>
+            <from uri="direct:send"/>
+            <to uri="direct:start"/>
+            <to uri="mock:response"/>
+        </route>
     </camelContext>
 
 </beans>