diff options
| author | Rajith Muditha Attapattu <rajith@apache.org> | 2008-10-07 14:10:39 +0000 |
|---|---|---|
| committer | Rajith Muditha Attapattu <rajith@apache.org> | 2008-10-07 14:10:39 +0000 |
| commit | cdae2a877123056b69a91dd8ca2196577654de2d (patch) | |
| tree | 8a3bede5f872bf1db0d6ce4fc0daace3191b4690 /java/client/src/test | |
| parent | 532f0c68fdf335776810d2a79bd4324631bb38c9 (diff) | |
| download | qpid-python-cdae2a877123056b69a91dd8ca2196577654de2d.tar.gz | |
This is a fix for QPID-1319.
If SSL is specified as an option in the ConnectionURL then it will be copied to the broker level options.
If SSL is also specified in the broker URL then it will override the value given at the top level.
I also added a simple test case for this use case.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@702488 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/BrokerDetails/BrokerDetailsTest.java | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java index 7bf96b99c1..c3175317e6 100644 --- a/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java +++ b/java/client/src/test/java/org/apache/qpid/test/unit/client/BrokerDetails/BrokerDetailsTest.java @@ -20,14 +20,19 @@ */ package org.apache.qpid.test.unit.client.BrokerDetails; +import java.util.HashMap; +import java.util.Map; + import junit.framework.TestCase; import org.apache.qpid.client.AMQBrokerDetails; +import org.apache.qpid.client.AMQConnectionURL; +import org.apache.qpid.jms.ConnectionURL; +import org.apache.qpid.jms.BrokerDetails; import org.apache.qpid.url.URLSyntaxException; public class BrokerDetailsTest extends TestCase { - public void testMultiParameters() throws URLSyntaxException { String url = "tcp://localhost:5672?timeout='200',immediatedelivery='true'"; @@ -86,6 +91,17 @@ public class BrokerDetailsTest extends TestCase } } + + public void testBrokerDefaultsToTopLevelOptions() throws URLSyntaxException + { + String url = "amqp://guest:guest@clientid/test?ssl='false'&brokerlist='tcp://localhost:5672?ssl='true';tcp://myhost:5672'"; + ConnectionURL connectionurl = new AMQConnectionURL(url); + BrokerDetails bd1 = connectionurl.getBrokerDetails(0); + BrokerDetails bd2 = connectionurl.getBrokerDetails(1); + + assertTrue("Broker option should override the top level option",bd1.useSSL()); + assertFalse("Broker options should default to the top level options",bd2.useSSL()); + } public static junit.framework.Test suite() { |
