svn commit: r701802 - in /activemq/camel/trunk: camel-core/src/test/java/org/apache/camel/builder/ camel-core/src/test/java/org/apache/camel/processor/ components/camel-spring/src/test/resources/org/apache/camel/spring/xml/

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r701802 - in /activemq/camel/trunk: camel-core/src/test/java/org/apache/camel/builder/ camel-core/src/test/java/org/apache/camel/processor/ components/camel-spring/src/test/resources/org/apache/camel/spring/xml/

davsclaus-2
Author: davsclaus
Date: Sun Oct  5 07:44:47 2008
New Revision: 701802

URL: http://svn.apache.org/viewvc?rev=701802&view=rev
Log:
CAMEL-958: wiretab examples should use multicast to stay in line with the EIP pattern as the exchange should be sent as a fixed recipent list so the wiretab is independent on the ultimate destination.

Modified:
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java
    activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml
    activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java?rev=701802&r1=701801&r2=701802&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/builder/RouteBuilderTest.java Sun Oct  5 07:44:47 2008
@@ -36,6 +36,8 @@
 import org.apache.camel.processor.RecipientList;
 import org.apache.camel.processor.SendProcessor;
 import org.apache.camel.processor.Splitter;
+import org.apache.camel.processor.Interceptor;
+import org.apache.camel.processor.interceptor.StreamCachingInterceptor;
 import org.apache.camel.processor.idempotent.IdempotentConsumer;
 import org.apache.camel.processor.idempotent.MemoryMessageIdRepository;
 
@@ -49,6 +51,12 @@
     protected DelegateProcessor interceptor1;
     protected DelegateProcessor interceptor2;
 
+    @Override
+    protected void setUp() throws Exception {
+
+        super.setUp();
+    }
+
     protected List<Route> buildSimpleRoute() throws Exception {
         // START SNIPPET: e1
         RouteBuilder builder = new RouteBuilder() {
@@ -231,7 +239,7 @@
         // START SNIPPET: e6
         RouteBuilder builder = new RouteBuilder() {
             public void configure() {
-                from("seda:a").to("seda:tap", "seda:b");
+                from("seda:a").multicast().to("seda:tap", "seda:b");
             }
         };
         // END SNIPPET: e6
@@ -249,6 +257,7 @@
             assertEquals("From endpoint", "seda:a", key.getEndpointUri());
             Processor processor = getProcessorWithoutErrorHandler(route);
 
+            processor = unwrapInterceptor(processor);
             MulticastProcessor multicastProcessor = assertIsInstanceOf(MulticastProcessor.class, processor);
             List<Processor> endpoints = new ArrayList<Processor>(multicastProcessor.getProcessors());
             assertEquals("Should have 2 endpoints", 2, endpoints.size());
@@ -462,12 +471,6 @@
             processor = unwrapErrorHandler(processor);
         }
 
-        if (!Boolean.getBoolean(JmxSystemPropertyKeys.DISABLED)) {
-            InstrumentationProcessor interceptor =
-                assertIsInstanceOf(InstrumentationProcessor.class, processor);
-            processor = interceptor.getProcessor();
-        }
-
         if (processor instanceof SendProcessor) {
             assertSendTo(processor, uri);
         } else {
@@ -495,6 +498,15 @@
         }
     }
 
+    protected Processor unwrapInterceptor(Processor processor) {
+        if (processor instanceof Interceptor) {
+            Interceptor interceptor = (Interceptor) processor;
+            return interceptor.getProcessor();
+        } else {
+            return processor;
+        }
+    }
+
     public void testCorrectNumberOfRoutes() throws Exception {
         RouteBuilder builder = new RouteBuilder() {
             public void configure() throws Exception {

Modified: activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java?rev=701802&r1=701801&r2=701802&view=diff
==============================================================================
--- activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java (original)
+++ activemq/camel/trunk/camel-core/src/test/java/org/apache/camel/processor/WireTapTest.java Sun Oct  5 07:44:47 2008
@@ -47,7 +47,7 @@
     protected RouteBuilder createRouteBuilder() {
         return new RouteBuilder() {
             public void configure() {
-                from("direct:start").to("mock:tap", "mock:result");
+                from("direct:start").multicast().to("mock:tap", "mock:result");
             }
         };
     }

Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml?rev=701802&r1=701801&r2=701802&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildStaticRecipientList.xml Sun Oct  5 07:44:47 2008
@@ -22,9 +22,6 @@
        http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
     ">
 
-  <!--
-        from("seda:a").to("seda:b", "seda:c", "seda:d");
-  -->
   <!-- START SNIPPET: example -->
   <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
     <route>
@@ -38,5 +35,4 @@
   </camelContext>
   <!-- END SNIPPET: example -->
 
-
 </beans>

Modified: activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml
URL: http://svn.apache.org/viewvc/activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml?rev=701802&r1=701801&r2=701802&view=diff
==============================================================================
--- activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml (original)
+++ activemq/camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/xml/buildWireTap.xml Sun Oct  5 07:44:47 2008
@@ -22,18 +22,16 @@
        http://activemq.apache.org/camel/schema/spring http://activemq.apache.org/camel/schema/spring/camel-spring.xsd
     ">
 
-  <!--
-        from("seda:a").to("seda:tap", "seda:b");
-  -->
   <!-- START SNIPPET: example -->
   <camelContext id="camel" xmlns="http://activemq.apache.org/camel/schema/spring">
     <route>
       <from uri="seda:a"/>
-      <to uri="seda:tap"/>
-      <to uri="seda:b"/>
+      <multicast>
+        <to uri="seda:tap"/>
+        <to uri="seda:b"/>
+      </multicast>
     </route>
   </camelContext>
   <!-- END SNIPPET: example -->
 
-
 </beans>