diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2008-02-27 19:59:13 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2008-02-27 19:59:13 +0000 |
| commit | a9227dbda19f88d60689cf2c44940e3552a222e9 (patch) | |
| tree | b632d96321bb6f5df9476bc3c087f4bb55be19dd /java/client/src/test | |
| parent | e5baeccc520bb72063ea603f1c0ecdc07fe7c519 (diff) | |
| download | qpid-python-a9227dbda19f88d60689cf2c44940e3552a222e9.tar.gz | |
Added another test to check for URISyntaxException when both routingkey and bindingkey is specified
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@631697 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/client/src/test')
| -rw-r--r-- | java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java index 3aadd4d99d..88dd212ab6 100644 --- a/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java +++ b/java/client/src/test/java/org/apache/qpid/test/unit/client/destinationurl/DestinationURLTest.java @@ -23,11 +23,17 @@ package org.apache.qpid.test.unit.client.destinationurl; import junit.framework.TestCase; import org.apache.qpid.exchange.ExchangeDefaults; +import org.apache.qpid.test.unit.basic.PropertyValueTest; import org.apache.qpid.url.AMQBindingURL; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + import java.net.URISyntaxException; public class DestinationURLTest extends TestCase { + private static final Logger _logger = LoggerFactory.getLogger(DestinationURLTest.class); + public void testFullURL() throws URISyntaxException { @@ -141,7 +147,7 @@ public class DestinationURLTest extends TestCase public void testDestinationWithMultiBindingKeys() throws URISyntaxException { - String url = "exchangeClass://exchangeName/Destination/?bindingKey='key1',bindingKey='key2'"; + String url = "exchangeClass://exchangeName/Destination/?bindingkey='key1',bindingkey='key2'"; AMQBindingURL dest = new AMQBindingURL(url); @@ -153,6 +159,26 @@ public class DestinationURLTest extends TestCase assertTrue(dest.getBindingKeys().length == 2); } + // You can only specify only a routing key or binding key, but not both. + public void testDestinationIfOnlyRoutingKeyOrBindingKeyIsSpecified() throws URISyntaxException + { + + String url = "exchangeClass://exchangeName/Destination/?bindingkey='key1',routingkey='key2'"; + boolean exceptionThrown = false; + try + { + + AMQBindingURL dest = new AMQBindingURL(url); + } + catch(URISyntaxException e) + { + exceptionThrown = true; + _logger.info("Exception thrown",e); + } + + assertTrue("Failed to throw an URISyntaxException when both the bindingkey and routingkey is specified",exceptionThrown); + } + public static junit.framework.Test suite() { return new junit.framework.TestSuite(DestinationURLTest.class); |
