camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r647539 - /activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
Date Sun, 13 Apr 2008 08:26:28 GMT
Author: davsclaus
Date: Sun Apr 13 01:26:27 2008
New Revision: 647539

URL: http://svn.apache.org/viewvc?rev=647539&view=rev
Log:
What is wrong with interceptors

Added:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java

Added: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java?rev=647539&view=auto
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
(added)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/issues/InterceptorLogTest.java
Sun Apr 13 01:26:27 2008
@@ -0,0 +1,34 @@
+package org.apache.camel.issues;
+
+import org.apache.camel.ContextTestSupport;
+import org.apache.camel.component.mock.MockEndpoint;
+import org.apache.camel.builder.RouteBuilder;
+
+/**
+ * Testing http://activemq.apache.org/camel/dsl.html
+ */
+public class InterceptorLogTest extends ContextTestSupport {
+
+    public void testInterceptor() throws Exception {
+        MockEndpoint mock = getMockEndpoint("mock:result");
+        mock.expectedMessageCount(1);
+
+        template.sendBody("seda:foo", "Hello World");
+
+        mock.assertIsSatisfied();
+    }
+
+    protected RouteBuilder createRouteBuilder() throws Exception {
+        return new RouteBuilder() {
+            public void configure() throws Exception {
+                // lets log all steps in all routes
+                // TODO: this does not work as expected. if enabled the exchange is not routed
to seda:bar
+                //intercept().to("log:foo");
+
+                from("seda:foo").to("seda:bar");
+                from("seda:bar").to("mock:result");
+            }
+        };
+    }
+
+}



Mime
View raw message