summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajith Muditha Attapattu <rajith@apache.org>2011-03-17 21:29:50 +0000
committerRajith Muditha Attapattu <rajith@apache.org>2011-03-17 21:29:50 +0000
commit4a3c90a970302d33c15aecdda7073a8522f3eb15 (patch)
tree00804b25322807c0e30d8342c1166972dc981963
parente64bdb7315bb39c42355caa01c66e170ea772581 (diff)
downloadqpid-python-4a3c90a970302d33c15aecdda7073a8522f3eb15.tar.gz
Added testReplyToWithNamelessExchange as a test case for QPID-2959
Added testReplyToWithCustomExchange as a test case for QPID-3011 Removed testAddressBasedReplyTo as the above test cases cover it adequately. Currently the testReplyToWithNamelessExchange fails with the java.0.10 test profile. This is due to the default being BURL and the replyTo address is evaluated as a BURL and as part of the logic an exchange declare is being set. The C++ broker does seem to ignore the exchange declare of a known type (the nameless exchange in this case), while the java broker throws an exception. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1082709 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java65
1 files changed, 32 insertions, 33 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java
index 4e34e7a48b..931833408e 100644
--- a/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java
+++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/client/destination/AddressBasedDestinationTest.java
@@ -474,39 +474,6 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase
}
/**
- * Test goal: Verifies that and address based destination can be used successfully
- * as a reply to.
- */
- public void testAddressBasedReplyTo() throws Exception
- {
- Session jmsSession = _connection.createSession(false,Session.AUTO_ACKNOWLEDGE);
-
- String addr = "ADDR:amq.direct/x512; {create: receiver, " +
- "link : {name : 'MY.RESP.QUEUE', " +
- "x-declare : { auto-delete: true, exclusive: true, " +
- "arguments : {'qpid.max_size': 1000, 'qpid.policy_type': ring }} } }";
-
- Destination replyTo = new AMQAnyDestination(addr);
- Destination dest =new AMQAnyDestination("ADDR:amq.direct/Hello");
-
- MessageConsumer cons = jmsSession.createConsumer(dest);
- MessageProducer prod = jmsSession.createProducer(dest);
- Message m = jmsSession.createTextMessage("Hello");
- m.setJMSReplyTo(replyTo);
- prod.send(m);
-
- Message msg = cons.receive(1000);
- assertNotNull("consumer should have received the message",msg);
-
- MessageConsumer replyToCons = jmsSession.createConsumer(replyTo);
- MessageProducer replyToProd = jmsSession.createProducer(msg.getJMSReplyTo());
- replyToProd.send(jmsSession.createTextMessage("reply"));
-
- Message replyToMsg = replyToCons.receive(1000);
- assertNotNull("The reply to consumer should have got the message",replyToMsg);
- }
-
- /**
* Test goal: Verifies that session.createQueue method
* works as expected both with the new and old addressing scheme.
*/
@@ -1020,4 +987,36 @@ public class AddressBasedDestinationTest extends QpidBrokerTestCase
prod.close();
cons.close();
}
+
+ public void testReplyToWithNamelessExchange() throws Exception
+ {
+ replyToTest("ADDR:my-queue;{create: always}");
+ }
+
+ public void testReplyToWithCustomExchange() throws Exception
+ {
+ replyToTest("ADDR:hello;{create:always,node:{type:topic}}");
+ }
+
+ private void replyToTest(String replyTo) throws Exception
+ {
+ Session session = _connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
+ Destination replyToDest = AMQDestination.createDestination(replyTo);
+ MessageConsumer replyToCons = session.createConsumer(replyToDest);
+
+ Destination dest = session.createQueue("amq.direct/test");
+
+ MessageConsumer cons = session.createConsumer(dest);
+ MessageProducer prod = session.createProducer(dest);
+ Message m = session.createTextMessage("test");
+ m.setJMSReplyTo(replyToDest);
+ prod.send(m);
+
+ Message msg = cons.receive();
+ MessageProducer prodR = session.createProducer(msg.getJMSReplyTo());
+ prodR.send(session.createTextMessage("x"));
+
+ Message m1 = replyToCons.receive();
+ assertNotNull("The reply to consumer should have received the messsage",m1);
+ }
}