From ded5ca42361911cf0659546b045fa599525ee7ac Mon Sep 17 00:00:00 2001 From: Arnaud Simon Date: Wed, 3 Oct 2007 16:36:42 +0000 Subject: Changed to use QpidTestCase git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@581651 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/qpid/testutil/QpidClientConnection.java | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'java/client/src/test') diff --git a/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java b/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java index acfb00c9ba..f9c830ddae 100644 --- a/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java +++ b/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java @@ -40,7 +40,7 @@ import javax.jms.Queue; import javax.jms.Session; import javax.jms.TextMessage; -public class QpidClientConnection implements ExceptionListener +public class QpidClientConnection extends QpidTestCase implements ExceptionListener { private static final Logger _logger = LoggerFactory.getLogger(QpidClientConnection.class); @@ -62,6 +62,12 @@ public class QpidClientConnection implements ExceptionListener setPrefetch(5000); } + + public Connection getConnection() + { + return connection; + } + public void connect() throws JMSException { if (!connected) @@ -77,8 +83,9 @@ public class QpidClientConnection implements ExceptionListener { AMQConnectionFactory factory = new AMQConnectionFactory(brokerUrl); _logger.info("connecting to Qpid :" + brokerUrl); - connection = factory.createConnection(); - + //connection = factory.createConnection(); + setUp(); + connection = getConnection("guest", "guest") ; // register exception listener connection.setExceptionListener(this); @@ -89,14 +96,14 @@ public class QpidClientConnection implements ExceptionListener connected = true; } - catch (URLSyntaxException e) + catch (Exception e) { throw new JMSAMQException("URL syntax error in [" + brokerUrl + "]: " + e.getMessage(), e); } } } - public void disconnect() throws JMSException + public void disconnect() throws Exception { if (connected) { @@ -105,6 +112,7 @@ public class QpidClientConnection implements ExceptionListener connection.close(); connected = false; _logger.info("disconnected"); + tearDown(); } } -- cgit v1.2.1