From 45072deb936db16404f3746eeb9dcb74e4ecd3df Mon Sep 17 00:00:00 2001 From: Aidan Skinner Date: Tue, 19 Feb 2008 16:53:57 +0000 Subject: 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 --- .../qpid/test/unit/client/connection/ConnectionTest.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'java/client/src/test') 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", -- cgit v1.2.1