summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnaud Simon <arnaudsimon@apache.org>2007-10-03 16:36:42 +0000
committerArnaud Simon <arnaudsimon@apache.org>2007-10-03 16:36:42 +0000
commitded5ca42361911cf0659546b045fa599525ee7ac (patch)
treec44858f3c62811b6e13588866d7bdd4ca42c68b6
parent4ffbf78050e07b62e663f94cb2a3de261ecea94b (diff)
downloadqpid-python-ded5ca42361911cf0659546b045fa599525ee7ac.tar.gz
Changed to use QpidTestCase
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@581651 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java18
1 files changed, 13 insertions, 5 deletions
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();
}
}