Author: aidan
Date: Wed Feb 11 15:55:48 2009
New Revision: 743367

URL: http://svn.apache.org/viewvc?rev=743367&view=rev
Log:
QPID-1623: Allow null as a valid destination for JMSReplyTo

Added:
    
qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/AbstractJMSMessageTest.java
Modified:
    
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
    
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java

Modified: 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java?rev=743367&r1=743366&r2=743367&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
 (original)
+++ 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_10.java
 Wed Feb 11 15:55:48 2009
@@ -286,7 +286,8 @@
     {
         if (destination == null)
         {
-            throw new IllegalArgumentException("Null destination not allowed");
+            _messageProps.setReplyTo(null);
+            return;
         }
 
         if (!(destination instanceof AMQDestination))

Modified: 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java?rev=743367&r1=743366&r2=743367&view=diff
==============================================================================
--- 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java
 (original)
+++ 
qpid/trunk/qpid/java/client/src/main/java/org/apache/qpid/client/message/AMQMessageDelegate_0_8.java
 Wed Feb 11 15:55:48 2009
@@ -196,7 +196,8 @@
     {
         if (destination == null)
         {
-            throw new IllegalArgumentException("Null destination not allowed");
+            getContentHeaderProperties().setReplyTo((String) null);
+            return; // We're done here
         }
 
         if (!(destination instanceof AMQDestination))

Added: 
qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/AbstractJMSMessageTest.java
URL: 
http://svn.apache.org/viewvc/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/AbstractJMSMessageTest.java?rev=743367&view=auto
==============================================================================
--- 
qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/AbstractJMSMessageTest.java
 (added)
+++ 
qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/client/message/AbstractJMSMessageTest.java
 Wed Feb 11 15:55:48 2009
@@ -0,0 +1,36 @@
+package org.apache.qpid.client.message;
+
+import javax.jms.JMSException;
+
+import junit.framework.TestCase;
+
+public class AbstractJMSMessageTest extends TestCase
+{
+
+    public void testSetNullJMSReplyTo08() throws JMSException
+    {
+        JMSTextMessage message = new 
JMSTextMessage(AMQMessageDelegateFactory.FACTORY_0_8);
+        try 
+        {
+            message.setJMSReplyTo(null);
+        }
+        catch (IllegalArgumentException e)
+        {
+            fail("Null destination should be allowed");
+        }
+    }
+
+    public void testSetNullJMSReplyTo10() throws JMSException
+    {
+        JMSTextMessage message = new 
JMSTextMessage(AMQMessageDelegateFactory.FACTORY_0_10);
+        try 
+        {
+            message.setJMSReplyTo(null);
+        }
+        catch (IllegalArgumentException e)
+        {
+            fail("Null destination should be allowed");
+        }
+    }
+
+}



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscr...@qpid.apache.org

Reply via email to