summaryrefslogtreecommitdiff
path: root/qpid/java/client
diff options
context:
space:
mode:
authorAlex Rudyy <orudyy@apache.org>2013-07-17 16:10:32 +0000
committerAlex Rudyy <orudyy@apache.org>2013-07-17 16:10:32 +0000
commit286ece348bd9f70fc4eddfb990df59a3156745b0 (patch)
tree3e1bc3978d0ef0844ded6736b508a005c8bfdee9 /qpid/java/client
parent326e756f2ff38c46f9fb7fcd73f178bc6e2afbd6 (diff)
downloadqpid-python-286ece348bd9f70fc4eddfb990df59a3156745b0.tar.gz
QPID-4994: Remove redundant binding URL options for subscription name and client id
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1504185 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/client')
-rw-r--r--qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java53
1 files changed, 41 insertions, 12 deletions
diff --git a/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java b/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java
index e13180424b..4c558906b3 100644
--- a/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java
+++ b/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java
@@ -27,6 +27,7 @@ import org.slf4j.LoggerFactory;
import org.apache.qpid.client.AMQDestination;
import org.apache.qpid.client.RejectBehaviour;
import org.apache.qpid.exchange.ExchangeDefaults;
+import org.apache.qpid.framing.AMQShortString;
import org.apache.qpid.url.AMQBindingURL;
import org.apache.qpid.url.BindingURL;
@@ -180,18 +181,6 @@ public class DestinationURLTest extends TestCase
assertTrue("Failed to throw an URISyntaxException when both the bindingkey and routingkey is specified",exceptionThrown);
}
-
- public void testDestinationWithDurableTopic() throws URISyntaxException
- {
-
- String url = "topic://amq.topic//testTopicD?durable='true'&autodelete='true'&clientid='test'&subscription='testQueueD'";
-
- AMQBindingURL dest = new AMQBindingURL(url);
-
- assertTrue(dest.getExchangeClass().equalsCharSequence("topic"));
- assertTrue(dest.getExchangeName().equalsCharSequence("amq.topic"));
- assertTrue(dest.getQueueName().equalsCharSequence("test:testQueueD"));
- }
public void testExchangeOptionsNotPresent() throws URISyntaxException
{
@@ -374,6 +363,46 @@ public class DestinationURLTest extends TestCase
assertNull("Reject behaviour is unexpected", dest.getRejectBehaviour());
}
+ public void testBindingUrlWithoutDestinationAndQueueName() throws Exception
+ {
+ AMQBindingURL bindingURL = new AMQBindingURL("topic://amq.topic//?routingkey='testTopic'");
+ assertEquals("Unexpected queue name", AMQShortString.EMPTY_STRING, bindingURL.getQueueName());
+ assertEquals("Unexpected destination", AMQShortString.EMPTY_STRING, bindingURL.getDestinationName());
+ assertEquals("Unexpected routing key", AMQShortString.valueOf("testTopic"), bindingURL.getRoutingKey());
+ }
+
+ public void testBindingUrlWithoutDestinationAndMissedQueueName() throws Exception
+ {
+ AMQBindingURL bindingURL = new AMQBindingURL("topic://amq.topic/?routingkey='testTopic'");
+ assertEquals("Unexpected queue name", AMQShortString.EMPTY_STRING, bindingURL.getQueueName());
+ assertEquals("Unexpected destination", AMQShortString.EMPTY_STRING, bindingURL.getDestinationName());
+ assertEquals("Unexpected routing key", AMQShortString.valueOf("testTopic"), bindingURL.getRoutingKey());
+ }
+
+ public void testBindingUrlWithoutQueueName() throws Exception
+ {
+ AMQBindingURL bindingURL = new AMQBindingURL("topic://amq.topic/destination/?routingkey='testTopic'");
+ assertEquals("Unexpected queue name", AMQShortString.EMPTY_STRING, bindingURL.getQueueName());
+ assertEquals("Unexpected destination", AMQShortString.valueOf("destination"), bindingURL.getDestinationName());
+ assertEquals("Unexpected routing key", AMQShortString.valueOf("testTopic"), bindingURL.getRoutingKey());
+ }
+
+ public void testBindingUrlWithQueueNameWithoutDestination() throws Exception
+ {
+ AMQBindingURL bindingURL = new AMQBindingURL("topic://amq.topic//queueName?routingkey='testTopic'");
+ assertEquals("Unexpected queue name", AMQShortString.valueOf("queueName"), bindingURL.getQueueName());
+ assertEquals("Unexpected destination", AMQShortString.EMPTY_STRING, bindingURL.getDestinationName());
+ assertEquals("Unexpected routing key", AMQShortString.valueOf("testTopic"), bindingURL.getRoutingKey());
+ }
+
+ public void testBindingUrlWithQueueNameAndDestination() throws Exception
+ {
+ AMQBindingURL bindingURL = new AMQBindingURL("topic://amq.topic/destination/queueName?routingkey='testTopic'");
+ assertEquals("Unexpected queue name", AMQShortString.valueOf("queueName"), bindingURL.getQueueName());
+ assertEquals("Unexpected destination", AMQShortString.valueOf("destination"), bindingURL.getDestinationName());
+ assertEquals("Unexpected routing key", AMQShortString.valueOf("testTopic"), bindingURL.getRoutingKey());
+ }
+
public static junit.framework.Test suite()
{
return new junit.framework.TestSuite(DestinationURLTest.class);