camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1353227 - /camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapBeanTest.java
Date Sun, 24 Jun 2012 07:50:10 GMT
Author: davsclaus
Date: Sun Jun 24 07:50:10 2012
New Revision: 1353227

URL: http://svn.apache.org/viewvc?rev=1353227&view=rev
Log:
CAMEL-5384: Added unit test.

Added:
    camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapBeanTest.java
      - copied, changed from r1353079, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java

Copied: camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapBeanTest.java
(from r1353079, camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java)
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapBeanTest.java?p2=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapBeanTest.java&p1=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java&r1=1353079&r2=1353227&rev=1353227&view=diff
==============================================================================
--- camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java (original)
+++ camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapBeanTest.java Sun
Jun 24 07:50:10 2012
@@ -25,16 +25,15 @@ import org.apache.camel.component.mock.M
  *
  * @version 
  */
-public class WireTapTest extends ContextTestSupport {
+public class WireTapBeanTest extends ContextTestSupport {
     protected MockEndpoint tap;
     protected MockEndpoint result;
 
     public void testSend() throws Exception {
-        // hello must come first, as we have delay on the tapped route
-        result.expectedBodiesReceived("Hello World", "Tapped");
-        tap.expectedBodiesReceived("Tapped");
+        result.expectedBodiesReceived("Bye World");
+        tap.expectedBodiesReceived("World");
 
-        template.sendBody("direct:start", "Hello World");
+        template.sendBody("direct:start", "World");
 
         assertMockEndpointsSatisfied();
     }
@@ -49,17 +48,22 @@ public class WireTapTest extends Context
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                // START SNIPPET: e1
                 from("direct:start")
                     .to("log:foo")
-                    .wireTap("direct:tap")
+                    .wireTap("seda:tap")
+                    .bean(MyBean.class)
                     .to("mock:result");
-                // END SNIPPET: e1
 
-                from("direct:tap")
-                    .delay(1000).setBody().constant("Tapped")
-                    .to("mock:result", "mock:tap");
+                from("seda:tap")
+                    .to("mock:tap");
             }
         };
     }
+
+    public static class MyBean {
+
+        public String transform(String body) {
+            return "Bye " + body;
+        }
+    }
 }
\ No newline at end of file



Mime
View raw message