activemq-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dej...@apache.org
Subject svn commit: r758789 - in /activemq/trunk/activemq-camel/src: main/java/org/apache/activemq/camel/converter/ test/java/org/apache/activemq/camel/component/
Date Thu, 26 Mar 2009 18:30:57 GMT
Author: dejanb
Date: Thu Mar 26 18:30:51 2009
New Revision: 758789

URL: http://svn.apache.org/viewvc?rev=758789&view=rev
Log:
fix for https://issues.apache.org/activemq/browse/AMQ-2182;apache-camel test failures

Modified:
    activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/converter/ActiveMQMessageConverter.java
    activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQJmsHeaderRouteTest.java
    activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQReplyToHeaderUsingConverterTest.java
    activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/InvokeRequestReplyUsingJmsReplyToHeaderTest.java

Modified: activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/converter/ActiveMQMessageConverter.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/converter/ActiveMQMessageConverter.java?rev=758789&r1=758788&r2=758789&view=diff
==============================================================================
--- activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/converter/ActiveMQMessageConverter.java
(original)
+++ activemq/trunk/activemq-camel/src/main/java/org/apache/activemq/camel/converter/ActiveMQMessageConverter.java
Thu Mar 26 18:30:51 2009
@@ -30,6 +30,7 @@
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.component.jms.JmsBinding;
+import org.apache.camel.component.jms.JmsEndpoint;
 
 /**
  * @version $Revision$

Modified: activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQJmsHeaderRouteTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQJmsHeaderRouteTest.java?rev=758789&r1=758788&r2=758789&view=diff
==============================================================================
--- activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQJmsHeaderRouteTest.java
(original)
+++ activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQJmsHeaderRouteTest.java
Thu Mar 26 18:30:51 2009
@@ -16,24 +16,26 @@
  */
 package org.apache.activemq.camel.component;
 
+import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
+
+import java.util.Date;
+import java.util.List;
+
+import javax.jms.Destination;
+import javax.jms.Message;
+
 import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
-import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
 import org.apache.camel.component.jms.JmsExchange;
-import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.camel.component.mock.AssertionClause;
+import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.jms.Message;
-import javax.jms.Destination;
-import java.util.Date;
-import java.util.List;
-
 /**
  * @version $Revision$
  */
@@ -84,12 +86,13 @@
                     public void process(Exchange exchange) throws Exception {
                         // lets set the custom JMS headers using the JMS API
                         JmsExchange jmsExchange = assertIsInstanceOf(JmsExchange.class, exchange);
+                        
                         Message inMessage = jmsExchange.getInMessage();
                         inMessage.setJMSReplyTo(replyQueue);
                         inMessage.setJMSCorrelationID(correlationID);
                         inMessage.setJMSType(messageType);
                     }
-                }).to("activemq:test.b");
+                }).to("activemq:test.b?preserveMessageQos=true");
 
                 from("activemq:test.b").to("mock:result");
             }

Modified: activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQReplyToHeaderUsingConverterTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQReplyToHeaderUsingConverterTest.java?rev=758789&r1=758788&r2=758789&view=diff
==============================================================================
--- activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQReplyToHeaderUsingConverterTest.java
(original)
+++ activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/ActiveMQReplyToHeaderUsingConverterTest.java
Thu Mar 26 18:30:51 2009
@@ -101,7 +101,7 @@
     protected RouteBuilder createRouteBuilder() throws Exception {
         return new RouteBuilder() {
             public void configure() throws Exception {
-                from("activemq:test.a").to("activemq:test.b");
+                from("activemq:test.a").to("activemq:test.b?preserveMessageQos=true");
 
                 from("activemq:test.b").to("mock:result");
             }

Modified: activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/InvokeRequestReplyUsingJmsReplyToHeaderTest.java
URL: http://svn.apache.org/viewvc/activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/InvokeRequestReplyUsingJmsReplyToHeaderTest.java?rev=758789&r1=758788&r2=758789&view=diff
==============================================================================
--- activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/InvokeRequestReplyUsingJmsReplyToHeaderTest.java
(original)
+++ activemq/trunk/activemq-camel/src/test/java/org/apache/activemq/camel/component/InvokeRequestReplyUsingJmsReplyToHeaderTest.java
Thu Mar 26 18:30:51 2009
@@ -16,25 +16,31 @@
  */
 package org.apache.activemq.camel.component;
 
+import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.hamcrest.Matchers.hasEntry;
+import static org.hamcrest.Matchers.hasKey;
+
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
 
 import javax.jms.Destination;
 
-import static org.apache.activemq.camel.component.ActiveMQComponent.activeMQComponent;
+import org.apache.activemq.command.ActiveMQDestination;
+import org.apache.activemq.command.ActiveMQQueue;
 import org.apache.camel.CamelContext;
 import org.apache.camel.ContextTestSupport;
 import org.apache.camel.Exchange;
 import org.apache.camel.Headers;
 import org.apache.camel.Message;
+import org.apache.camel.Processor;
 import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.component.jms.JmsConstants;
 import org.apache.camel.component.mock.AssertionClause;
 import org.apache.camel.component.mock.MockEndpoint;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.*;
 
 /**
  * @version $Revision$
@@ -59,13 +65,26 @@
         firstMessage.header("JMSXGroupID").isEqualTo(groupID);
         firstMessage.header("JMSReplyTo").isEqualTo(ActiveMQConverter.toDestination(replyQueueName));
 */
-
+        
         Map<String, Object> headers = new HashMap<String, Object>();
         headers.put("cheese", 123);
         headers.put("JMSReplyTo", replyQueueName);
         headers.put("JMSCorrelationID", correlationID);
         headers.put("JMSXGroupID", groupID);
-        template.sendBodyAndHeaders("activemq:test.server", "James", headers);
+        
+        
+        // Camel 2.0 ignores JMSReplyTo, so we're using replyTo MEP property
+        template.request("activemq:test.server?replyTo=queue:test.reply", new Processor()
{
+            public void process(Exchange exchange) {
+                exchange.getIn().setBody("James");
+                Map<String, Object> headers = new HashMap<String, Object>();
+                headers.put("cheese", 123);
+                headers.put("JMSReplyTo", replyQueueName);
+                headers.put("JMSCorrelationID", correlationID);
+                headers.put("JMSXGroupID", groupID);
+                exchange.getIn().setHeaders(headers);
+            }
+        });
 
         resultEndpoint.assertIsSatisfied();
 



Mime
View raw message