summaryrefslogtreecommitdiff
path: root/java/client/src/test
diff options
context:
space:
mode:
authorAidan Skinner <aidan@apache.org>2008-02-19 16:53:57 +0000
committerAidan Skinner <aidan@apache.org>2008-02-19 16:53:57 +0000
commit45072deb936db16404f3746eeb9dcb74e4ecd3df (patch)
tree5d00f77fc816ec19d80a3b5b2ec54ced54c462e4 /java/client/src/test
parent321153d64eccde228d4dd8d9c9833e2b259d8c05 (diff)
downloadqpid-python-45072deb936db16404f3746eeb9dcb74e4ecd3df.tar.gz
Qpid-594: make AMQConnection listen for exceptions that are thrown asynchronously in it's constructor and do something appropriate with them
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/M2.1@629158 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/connection/ConnectionTest.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java b/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
index 56394fee27..7103397ad4 100644
--- a/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
+++ b/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionTest.java
@@ -165,6 +165,22 @@ public class ConnectionTest extends TestCase
}
}
+ public void testUnresolvedVirtualHostFailure() throws Exception
+ {
+ try
+ {
+ new AMQConnection("amqp://guest:guest@clientid/rubbishhost?brokerlist='" + _broker + "?retries='0''");
+ fail("Connection should not be established");
+ }
+ catch (AMQException amqe)
+ {
+ if (!(amqe instanceof AMQConnectionFailureException))
+ {
+ fail("Correct exception not thrown. Excpected 'AMQConnectionFailureException' got: " + amqe);
+ }
+ }
+ }
+
public void testClientIdCannotBeChanged() throws Exception
{
Connection connection = new AMQConnection(_broker, "guest", "guest",