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 | 2e94295802a69fd5e94e2df8ca1a3f9429439b1d (patch) | |
| tree | 0281ecf916ea5921a79f15599d79af77ff020150 /java/systests | |
| parent | 248fa27fa45dab6e958a0aeb990fa51f3d1f12ed (diff) | |
| download | qpid-python-2e94295802a69fd5e94e2df8ca1a3f9429439b1d.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/qpid@1343220 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'java/systests')
| -rw-r--r-- | 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/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionFactoryTest.java b/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionFactoryTest.java index a313475b11..bf1fbbf1a3 100644 --- a/java/systests/src/main/java/org/apache/qpid/test/unit/client/connection/ConnectionFactoryTest.java +++ b/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(); + } } |
