diff options
| author | Robert Gemmell <robbie@apache.org> | 2012-05-28 12:20:35 +0000 |
|---|---|---|
| committer | Robert Gemmell <robbie@apache.org> | 2012-05-28 12:20:35 +0000 |
| commit | b3bcd521a46ca9e351e295fc8685712291bd86dd (patch) | |
| tree | a23875ade5aca1aae8c87e7ac10e42eb0bdf1fb3 /qpid/java/systests/src | |
| parent | 175c11c7b8056c144b6a9dd8b132cccba7ca442d (diff) | |
| download | qpid-python-b3bcd521a46ca9e351e295fc8685712291bd86dd.tar.gz | |
QPID-4023: restore connection URL setter, add check that URL details have been set before calling connect(), add unit+sys test to verify operation
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1343220 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/java/systests/src')
| -rw-r--r-- | qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionFactoryTest.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionFactoryTest.java b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionFactoryTest.java index a313475b11..bf1fbbf1a3 100644 --- a/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionFactoryTest.java +++ b/qpid/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionFactoryTest.java @@ -20,6 +20,8 @@ */ package org.apache.qpid.test.unit.client.connection; +import javax.jms.Connection; + import org.apache.qpid.client.AMQConnection; import org.apache.qpid.client.AMQConnectionFactory; import org.apache.qpid.test.utils.QpidBrokerTestCase; @@ -57,5 +59,20 @@ public class ConnectionFactoryTest extends QpidBrokerTestCase assertEquals("Usernames used is different from the one in URL","guest",con3.getConnectionURL().getUsername()); assertEquals("Password used is different from the one in URL","guest",con3.getConnectionURL().getPassword()); } - + + /** + * Verifies that a connection can be made using an instance of AMQConnectionFactory created with the + * default constructor and provided with the connection url via setter. + */ + public void testCreatingConnectionWithInstanceMadeUsingDefaultConstructor() throws Exception + { + String broker = getBroker().toString(); + String url = "amqp://guest:guest@clientID/test?brokerlist='" + broker + "'"; + + AMQConnectionFactory factory = new AMQConnectionFactory(); + factory.setConnectionURLString(url); + + Connection con = factory.createConnection(); + con.close(); + } } |
