[jboss-cvs] JBoss Messaging SVN: r2581 - in branches/Branch_1_0: tests/src/org/jboss/test/messaging/jms/message and 1 other directory.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Tue Apr 17 13:12:05 EDT 2007
Author: timfox
Date: 2007-04-17 13:12:05 -0400 (Tue, 17 Apr 2007)
New Revision: 2581
Modified:
branches/Branch_1_0/src/main/org/jboss/jms/message/JBossMessage.java
branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/message/JMSReplyToHeaderTest.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-622
Modified: branches/Branch_1_0/src/main/org/jboss/jms/message/JBossMessage.java
===================================================================
--- branches/Branch_1_0/src/main/org/jboss/jms/message/JBossMessage.java 2007-04-17 17:00:46 UTC (rev 2580)
+++ branches/Branch_1_0/src/main/org/jboss/jms/message/JBossMessage.java 2007-04-17 17:12:05 UTC (rev 2581)
@@ -66,6 +66,7 @@
* @author David Maplesden (David.Maplesden at orion.co.nz)
* @author <a href="mailto:adrian at jboss.org">Adrian Brock</a>
* @author <a href="mailto:ovidiu at jboss.org">Ovidiu Feodorov</a>
+ * @author <a href="mailto:bershath at yahoo.com">Tyronne Wickramarathne</a>
*
* $Id$
*/
@@ -435,11 +436,19 @@
public void setJMSReplyTo(Destination replyTo) throws JMSException
{
- if (!(replyTo instanceof JBossDestination))
+ //Need to be able to set nulls too
+ if (replyTo == null)
{
- throw new InvalidDestinationException("Replyto cannot be foreign");
+ this.replyToDestination = null;
}
- this.replyToDestination = (JBossDestination)replyTo;
+ else
+ {
+ if (!(replyTo instanceof JBossDestination))
+ {
+ throw new InvalidDestinationException("Replyto cannot be foreign");
+ }
+ this.replyToDestination = (JBossDestination)replyTo;
+ }
}
public Destination getJMSDestination() throws JMSException
Modified: branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/message/JMSReplyToHeaderTest.java
===================================================================
--- branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/message/JMSReplyToHeaderTest.java 2007-04-17 17:00:46 UTC (rev 2580)
+++ branches/Branch_1_0/tests/src/org/jboss/test/messaging/jms/message/JMSReplyToHeaderTest.java 2007-04-17 17:12:05 UTC (rev 2581)
@@ -67,7 +67,17 @@
assertEquals(tempQ, m.getJMSReplyTo());
}
+ public void testJMSDestinationNull() throws Exception
+ {
+ Message m = queueProducerSession.createMessage();
+ m.setJMSReplyTo(null);
+
+ queueProducer.send(m);
+ queueConsumer.receive();
+ assertNull(m.getJMSReplyTo());
+ }
+
// Package protected ---------------------------------------------
More information about the jboss-cvs-commits
mailing list