Author: arnaudsimon
Date: Wed Oct  3 09:36:42 2007
New Revision: 581651

URL: http://svn.apache.org/viewvc?rev=581651&view=rev
Log:
Changed to use QpidTestCase

Modified:
    
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java

Modified: 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java?rev=581651&r1=581650&r2=581651&view=diff
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/testutil/QpidClientConnection.java
 Wed Oct  3 09:36:42 2007
@@ -40,7 +40,7 @@
 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 @@
         setPrefetch(5000);
     }
 
+
+    public Connection getConnection()
+    {
+        return connection;
+    }
+
     public void connect() throws JMSException
     {
         if (!connected)
@@ -77,8 +83,9 @@
             {
                 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 @@
 
                 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 @@
             connection.close();
             connected = false;
             _logger.info("disconnected");
+            tearDown();
         }
     }
 


Reply via email to