camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From davscl...@apache.org
Subject svn commit: r1445069 - in /camel/branches/camel-2.10.x: ./ camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java camel-core/src/test/java/org/apache/camel/processor/WireTapOnPrepareTest.java
Date Tue, 12 Feb 2013 09:09:46 GMT
Author: davsclaus
Date: Tue Feb 12 09:09:45 2013
New Revision: 1445069

URL: http://svn.apache.org/r1445069
Log:
CAMEL-6064: Fixed WiraTap EIP onPrepare. Thanks to Scott Cranton for the patch.

Modified:
    camel/branches/camel-2.10.x/   (props changed)
    camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java
    camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/WireTapOnPrepareTest.java

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
  Merged /camel/trunk:r1445068

Propchange: camel/branches/camel-2.10.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java?rev=1445069&r1=1445068&r2=1445069&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java
Tue Feb 12 09:09:45 2013
@@ -143,7 +143,7 @@ public class WireTapProcessor extends Se
         // invoke on prepare on the exchange if specified
         if (onPrepare != null) {
             try {
-                onPrepare.process(exchange);
+                onPrepare.process(answer);
             } catch (Exception e) {
                 throw ObjectHelper.wrapRuntimeCamelException(e);
             }

Modified: camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/WireTapOnPrepareTest.java
URL: http://svn.apache.org/viewvc/camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/WireTapOnPrepareTest.java?rev=1445069&r1=1445068&r2=1445069&view=diff
==============================================================================
--- camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/WireTapOnPrepareTest.java
(original)
+++ camel/branches/camel-2.10.x/camel-core/src/test/java/org/apache/camel/processor/WireTapOnPrepareTest.java
Tue Feb 12 09:09:45 2013
@@ -32,9 +32,16 @@ public class WireTapOnPrepareTest extend
         getMockEndpoint("mock:b").expectedMessageCount(1);
         getMockEndpoint("mock:b").message(0).body(String.class).isEqualTo("1 Tiger");
 
-        template.sendBody("direct:start", new Animal(1, "Tiger"));
+        final Animal original = new Animal(1, "Tiger");
+        template.sendBody("direct:start", original);
 
         assertMockEndpointsSatisfied();
+
+        final Animal aAnimal = getMockEndpoint("mock:a").getExchanges().get(0).getIn().getBody(Animal.class);
+        final Animal bAnimal = getMockEndpoint("mock:b").getExchanges().get(0).getIn().getBody(Animal.class);
+
+        assertSame("Original instance should stay in main route", original, bAnimal);
+        assertNotSame("Copy should go to Wire Tap Endpoint", original, aAnimal);
     }
 
     @Override



Mime
View raw message