camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ra...@apache.org
Subject svn commit: r1387809 - /camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JmsToJmsTransactedSecurityTest.java
Date Wed, 19 Sep 2012 23:06:18 GMT
Author: raulk
Date: Wed Sep 19 23:06:17 2012
New Revision: 1387809

URL: http://svn.apache.org/viewvc?rev=1387809&view=rev
Log:
CAMEL-5626: JmsToJmsTransactedSecurityTest in camel-jms fails every now and then. Fixed by
consuming orphaned message.

Modified:
    camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JmsToJmsTransactedSecurityTest.java

Modified: camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JmsToJmsTransactedSecurityTest.java
URL: http://svn.apache.org/viewvc/camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JmsToJmsTransactedSecurityTest.java?rev=1387809&r1=1387808&r2=1387809&view=diff
==============================================================================
--- camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JmsToJmsTransactedSecurityTest.java
(original)
+++ camel/trunk/components/camel-jms/src/test/java/org/apache/camel/component/jms/tx/JmsToJmsTransactedSecurityTest.java
Wed Sep 19 23:06:17 2012
@@ -16,10 +16,13 @@
  */
 package org.apache.camel.component.jms.tx;
 
+import org.apache.camel.Exchange;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.test.junit4.CamelSpringTestSupport;
 import org.junit.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.context.support.ClassPathXmlApplicationContext;
 
 /**
@@ -27,6 +30,8 @@ import org.springframework.context.suppo
  */
 public class JmsToJmsTransactedSecurityTest extends CamelSpringTestSupport {
 
+    private static final Logger LOG = LoggerFactory.getLogger(JmsToJmsTransactedSecurityTest.class);
+    
     protected ClassPathXmlApplicationContext createApplicationContext() {
         return new ClassPathXmlApplicationContext("/org/apache/camel/component/jms/tx/JmsToJmsTransactedSecurityTest.xml");
     }
@@ -50,7 +55,11 @@ public class JmsToJmsTransactedSecurityT
         mock.expectedMessageCount(0);
 
         template.sendBody("activemq:queue:foo", "Hello World");
-
+        // get the message that got rolled back
+        Exchange exch = consumer.receive("activemq:queue:foo", 250);
+        if (exch != null) {
+            LOG.info("Cleaned up orphaned message: " + exch);
+        }
         mock.assertIsSatisfied(3000);
     }
 
@@ -73,6 +82,7 @@ public class JmsToJmsTransactedSecurityT
         template.sendBody("direct:start", "Hello World");
 
         assertMockEndpointsSatisfied();
+       
     }
 
 }



Mime
View raw message