diff options
author | Rajith Muditha Attapattu <rajith@apache.org> | 2010-03-23 22:48:23 +0000 |
---|---|---|
committer | Rajith Muditha Attapattu <rajith@apache.org> | 2010-03-23 22:48:23 +0000 |
commit | 1de408e7543973a40f1e67e0b40fc8ba897da7a5 (patch) | |
tree | 3ff20d3d57ef7673b545637869b5e19b8f5a2610 | |
parent | 9ef8757f0445fdfc8c82f3fe79abed4a158e2347 (diff) | |
download | qpid-python-1de408e7543973a40f1e67e0b40fc8ba897da7a5.tar.gz |
Added test case for QPID-2242 using a custom exchange to verify the fix.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@926829 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r-- | java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java b/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java index a3e1717a50..984ae9446d 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java +++ b/java/systests/src/main/java/org/apache/qpid/test/client/message/JMSDestinationTest.java @@ -21,9 +21,11 @@ package org.apache.qpid.test.client.message; import org.apache.qpid.configuration.ClientProperties; +import org.apache.qpid.client.AMQAnyDestination; import org.apache.qpid.client.AMQDestination; import org.apache.qpid.client.AMQTopic; import org.apache.qpid.client.CustomJMSXProperty; +import org.apache.qpid.framing.AMQShortString; import org.apache.qpid.management.common.mbeans.ManagedQueue; import org.apache.qpid.test.utils.JMXTestUtils; import org.apache.qpid.test.utils.QpidTestCase; @@ -327,4 +329,45 @@ public class JMSDestinationTest extends QpidTestCase } + /** + * Send a message to a custom exchange and then verify + * the message received has the proper destination set + * + * @throws Exception + */ + public void testGetDestinationWithCustomExchange() throws Exception + { + + AMQDestination dest = new AMQAnyDestination(new AMQShortString("my-exchange"), + new AMQShortString("direct"), + new AMQShortString("test"), + false, + false, + new AMQShortString("test"), + false, + new AMQShortString[]{new AMQShortString("test")}); + + // to force the creation of my-exchange. + sendMessage(_session, dest, 1); + + MessageProducer prod = _session.createProducer(dest); + + MessageConsumer consumer = _session.createConsumer(dest); + + _connection.start(); + + sendMessage(_session, dest, 1); + + Message message = consumer.receive(10000); + + assertNotNull("Message should not be null", message); + + Destination destination = message.getJMSDestination(); + + assertNotNull("JMSDestination should not be null", destination); + + assertEquals("Incorrect Destination name", "my-exchange", dest.getExchangeName().asString()); + assertEquals("Incorrect Destination type", "direct", dest.getExchangeClass().asString()); + assertEquals("Incorrect Routing Key", "test", dest.getRoutingKey().asString()); + } } |