diff options
-rw-r--r-- | qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java | 35 |
1 files changed, 25 insertions, 10 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 66be1ebc73..3aadd4d99d 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 @@ -7,9 +7,9 @@ * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY @@ -24,11 +24,11 @@ import junit.framework.TestCase; import org.apache.qpid.exchange.ExchangeDefaults; import org.apache.qpid.url.AMQBindingURL; -import org.apache.qpid.url.URLSyntaxException; +import java.net.URISyntaxException; public class DestinationURLTest extends TestCase { - public void testFullURL() throws URLSyntaxException + public void testFullURL() throws URISyntaxException { String url = "exchange.Class://exchangeName/Destination/Queue"; @@ -43,7 +43,7 @@ public class DestinationURLTest extends TestCase assertTrue(dest.getQueueName().equals("Queue")); } - public void testQueue() throws URLSyntaxException + public void testQueue() throws URISyntaxException { String url = "exchangeClass://exchangeName//Queue"; @@ -58,7 +58,7 @@ public class DestinationURLTest extends TestCase assertTrue(dest.getQueueName().equals("Queue")); } - public void testQueueWithOption() throws URLSyntaxException + public void testQueueWithOption() throws URISyntaxException { String url = "exchangeClass://exchangeName//Queue?option='value'"; @@ -75,7 +75,7 @@ public class DestinationURLTest extends TestCase } - public void testDestination() throws URLSyntaxException + public void testDestination() throws URISyntaxException { String url = "exchangeClass://exchangeName/Destination/"; @@ -90,7 +90,7 @@ public class DestinationURLTest extends TestCase assertTrue(dest.getQueueName().equals("")); } - public void testDestinationWithOption() throws URLSyntaxException + public void testDestinationWithOption() throws URISyntaxException { String url = "exchangeClass://exchangeName/Destination/?option='value'"; @@ -107,7 +107,7 @@ public class DestinationURLTest extends TestCase assertTrue(dest.getOption("option").equals("value")); } - public void testDestinationWithMultiOption() throws URLSyntaxException + public void testDestinationWithMultiOption() throws URISyntaxException { String url = "exchangeClass://exchangeName/Destination/?option='value',option2='value2'"; @@ -123,7 +123,7 @@ public class DestinationURLTest extends TestCase assertTrue(dest.getOption("option2").equals("value2")); } - public void testDestinationWithNoExchangeDefaultsToDirect() throws URLSyntaxException + public void testDestinationWithNoExchangeDefaultsToDirect() throws URISyntaxException { String url = "IBMPerfQueue1?durable='true'"; @@ -138,6 +138,21 @@ public class DestinationURLTest extends TestCase assertTrue(dest.getOption("durable").equals("true")); } + public void testDestinationWithMultiBindingKeys() throws URISyntaxException + { + + String url = "exchangeClass://exchangeName/Destination/?bindingKey='key1',bindingKey='key2'"; + + AMQBindingURL dest = new AMQBindingURL(url); + + assertTrue(dest.getExchangeClass().equals("exchangeClass")); + assertTrue(dest.getExchangeName().equals("exchangeName")); + assertTrue(dest.getDestinationName().equals("Destination")); + assertTrue(dest.getQueueName().equals("")); + + assertTrue(dest.getBindingKeys().length == 2); + } + public static junit.framework.Test suite() { return new junit.framework.TestSuite(DestinationURLTest.class); |