qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arnaudsi...@apache.org
Subject svn commit: r581650 - in /incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit: ./ basic/ client/channelclose/ client/connection/ client/forwardall/ client/message/ close/ message/ topic/ transacted/
Date Wed, 03 Oct 2007 16:35:18 GMT
Author: arnaudsimon
Date: Wed Oct  3 09:35:12 2007
New Revision: 581650

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

Modified:
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
    incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/LargeMessageTest.java
Wed Oct  3 09:35:12 2007
@@ -42,7 +42,6 @@
 
     private Destination _destination;
     private AMQSession _session;
-    public String _broker = "vm://:1";
 
     protected void setUp() throws Exception
     {

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/channelclose/CloseWithBlockingReceiveTest.java
Wed Oct  3 09:35:12 2007
@@ -29,31 +29,29 @@
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQTopic;
 import org.apache.qpid.client.transport.TransportConnection;
+import org.apache.qpid.testutil.QpidTestCase;
 
 /**
  * @author Apache Software Foundation
  */
-public class CloseWithBlockingReceiveTest extends TestCase
+public class CloseWithBlockingReceiveTest extends QpidTestCase
 {
 
 
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
     }
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        TransportConnection.killAllVMBrokers();
     }
 
 
     public void testReceiveReturnsNull() throws Exception
     {
-        final AMQConnection connection = new AMQConnection("vm://:1", "guest", "guest",
-                                                  "fred", "test");
+        final AMQConnection connection =  (AMQConnection) getConnection("guest", "guest");
         Session session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE);
         MessageConsumer consumer = session.createConsumer(new AMQTopic(connection, "banana"));
         connection.start();

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/connection/ConnectionStartTest.java
Wed Oct  3 09:35:12 2007
@@ -31,14 +31,12 @@
 import javax.jms.Session;
 import javax.jms.TextMessage;
 
-import junit.framework.TestCase;
-
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.transport.TransportConnection;
+import org.apache.qpid.testutil.QpidTestCase;
 
-public class ConnectionStartTest extends TestCase
+public class ConnectionStartTest extends QpidTestCase
 {
 
     String _broker = "vm://:1";
@@ -50,13 +48,11 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
-
         try
         {
 
 
-            AMQConnection pubCon = new AMQConnection(_broker, "guest", "guest", "fred", "test");
+            AMQConnection pubCon = (AMQConnection) getConnection("guest", "guest");
 
             AMQQueue queue = new AMQQueue(pubCon,"ConnectionStartTest");
 
@@ -66,7 +62,7 @@
 
             pub.send(pubSess.createTextMessage("Initial Message"));
 
-            _connection = new AMQConnection(_broker, "guest", "guest", "fred", "test");
+            _connection = (AMQConnection) getConnection("guest", "guest");
 
             _consumerSess = _connection.createSession(false, AMQSession.AUTO_ACKNOWLEDGE);
 
@@ -77,6 +73,7 @@
         }
         catch (Exception e)
         {
+            e.printStackTrace();
             fail("Connection to " + _broker + " should succeed. Reason: " + e);
         }
     }
@@ -84,7 +81,6 @@
     protected void tearDown() throws Exception
     {
         _connection.close();
-        TransportConnection.killVMBroker(1);
     }
 
     public void testSimpleReceiveConnection()

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Client.java
Wed Oct  3 09:35:12 2007
@@ -24,6 +24,7 @@
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.testutil.QpidTestCase;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -45,12 +46,17 @@
     private final AMQSession _session;
     private final int _expected;
     private int _count;
+    private static QpidTestCase _qct;
 
     Client(String broker, int expected) throws Exception
     {
         this(connect(broker), expected);
     }
 
+    public static void setQTC(QpidTestCase qtc)
+    {
+        _qct = qtc;
+    }
     Client(AMQConnection connection, int expected) throws Exception
     {
         _connection = connection;
@@ -100,7 +106,8 @@
 
     static AMQConnection connect(String broker) throws Exception
     {
-        return new AMQConnection(broker, "guest", "guest", "Client" + System.currentTimeMillis(),
"test");
+        //return new AMQConnection(broker, "guest", "guest", "Client" + System.currentTimeMillis(),
"test");
+         return (AMQConnection) _qct.getConnection("guest", "guest") ;
     }
 
     public static void main(String[] argv) throws Exception

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/CombinedTest.java
Wed Oct  3 09:35:12 2007
@@ -20,8 +20,8 @@
  */
 package org.apache.qpid.test.unit.client.forwardall;
 
-import junit.framework.TestCase;
 import org.apache.qpid.testutil.VMBrokerSetup;
+import org.apache.qpid.testutil.QpidTestCase;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -29,7 +29,7 @@
  * Runs the Service's and Client parts of the test in the same process
  * as the broker
  */
-public class CombinedTest extends TestCase
+public class CombinedTest extends QpidTestCase
 {
     private static final Logger _logger = LoggerFactory.getLogger(CombinedTest.class);
     private int run = 0;
@@ -37,6 +37,8 @@
     protected void setUp() throws Exception
     {
         super.setUp();
+        Service.setQTC(this);
+        Client.setQTC(this);
     }
 
     protected void tearDown() throws Exception

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/forwardall/Service.java
Wed Oct  3 09:35:12 2007
@@ -28,6 +28,7 @@
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
+import org.apache.qpid.testutil.QpidTestCase;
 
 /**
  * Declare a queue and bind it to amq.direct with a 'well known' routing key,
@@ -38,6 +39,13 @@
     private final AMQConnection _connection;
     private final AMQSession _session;
 
+    private static QpidTestCase _qct;
+     
+
+    public static void setQTC(QpidTestCase qtc)
+    {
+        _qct = qtc;
+    }
     Service(String broker) throws Exception
     {
         this(connect(broker));
@@ -73,7 +81,8 @@
 
     static AMQConnection connect(String broker) throws Exception
     {
-        return new AMQConnection(broker, "guest", "guest", "Client" + System.currentTimeMillis(),
"test");
+        //return new AMQConnection(broker, "guest", "guest", "Client" + System.currentTimeMillis(),
"test");
+          return (AMQConnection) _qct.getConnection("guest", "guest") ;
     }
 
 //    public static void main(String[] argv) throws Exception

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/client/message/ObjectMessageTest.java
Wed Oct  3 09:35:12 2007
@@ -20,13 +20,12 @@
  */
 package org.apache.qpid.test.unit.client.message;
 
-import junit.framework.TestCase;
-
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQDestination;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.testutil.VMBrokerSetup;
+import org.apache.qpid.testutil.QpidTestCase;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,7 +41,7 @@
 import java.util.Arrays;
 import java.util.HashMap;
 
-public class ObjectMessageTest extends TestCase implements MessageListener
+public class ObjectMessageTest extends QpidTestCase implements MessageListener
 {
     private static final Logger _logger = LoggerFactory.getLogger(ObjectMessageTest.class);
 
@@ -60,7 +59,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        connection = new AMQConnection(_broker, "guest", "guest", randomize("Client"), "test");
+        connection =  (AMQConnection) getConnection("guest", "guest");
         destination = new AMQQueue(connection, randomize("LatencyTest"), true);
         session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
 

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/CloseBeforeAckTest.java
Wed Oct  3 09:35:12 2007
@@ -21,10 +21,10 @@
 package org.apache.qpid.test.unit.close;
 
 import junit.framework.Assert;
-import junit.framework.TestCase;
 
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.transport.TransportConnection;
+import org.apache.qpid.testutil.QpidTestCase;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -45,7 +45,7 @@
  * <p><table id="crc"><caption>CRC Card</caption> <tr><th>
Responsibilities <th> Collaborations <tr><td> Check that
  * closing a connection whilst handling a message, blocks till completion of the handler.
</table>
  */
-public class CloseBeforeAckTest extends TestCase
+public class CloseBeforeAckTest extends QpidTestCase
 {
     private static final Logger log = LoggerFactory.getLogger(CloseBeforeAckTest.class);
 
@@ -134,14 +134,11 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
-
-        connection = new AMQConnection("vm://:1", "guest", "guest", getName(), "test");
+        connection =  getConnection("guest", "guest");
     }
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        TransportConnection.killVMBroker(1);
     }
 }

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/MessageRequeueTest.java
Wed Oct  3 09:35:12 2007
@@ -91,7 +91,6 @@
             conn.disconnect();
         }
 
-        TransportConnection.killVMBroker(1);
     }
 
     /**
@@ -100,7 +99,7 @@
      * @throws javax.jms.JMSException if a JMS problem occurs
      * @throws InterruptedException   on timeout
      */
-    public void testDrain() throws JMSException, InterruptedException
+    public void testDrain() throws Exception
     {
         QpidClientConnection conn = new QpidClientConnection(BROKER);
 
@@ -337,8 +336,10 @@
             String virtualHost = "/test";
             String brokerlist = BROKER;
             String brokerUrl = "amqp://guest:guest@" + virtualHost + "?brokerlist='" + brokerlist
+ "'";
+            QpidClientConnection qpc =      new QpidClientConnection(BROKER);
+            qpc.connect();
+            Connection conn = qpc. getConnection();
 
-            Connection conn = new AMQConnection(brokerUrl);
             Session session = conn.createSession(false, Session.CLIENT_ACKNOWLEDGE);
             Queue q = session.createQueue(queue);
 

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/close/TopicPublisherCloseTest.java
Wed Oct  3 09:35:12 2007
@@ -29,31 +29,28 @@
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQTopic;
 import org.apache.qpid.client.transport.TransportConnection;
+import org.apache.qpid.testutil.QpidTestCase;
 
 /**
  * @author Apache Software Foundation
  */
-public class TopicPublisherCloseTest extends TestCase
+public class TopicPublisherCloseTest extends QpidTestCase
 {
 
-    public String _connectionString = "vm://:1";
-
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
     }
 
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        TransportConnection.killAllVMBrokers();
     }
 
     public void testAllMethodsThrowAfterConnectionClose() throws Exception
     {
-        AMQConnection connection = new AMQConnection(_connectionString, "guest", "guest",
"Client", "test");
+        AMQConnection connection =   (AMQConnection) getConnection("guest", "guest");
 
         Topic destination1 = new AMQTopic(connection, "t1");
         TopicSession session1 = connection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSDestinationTest.java
Wed Oct  3 09:35:12 2007
@@ -21,13 +21,11 @@
 
 package org.apache.qpid.test.unit.message;
 
-import junit.framework.TestCase;
-
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.testutil.QpidTestCase;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,34 +40,31 @@
 /**
  * @author Apache Software Foundation
  */
-public class JMSDestinationTest extends TestCase
+public class JMSDestinationTest extends QpidTestCase
 {
     private static final Logger _logger = LoggerFactory.getLogger(JMSDestinationTest.class);
 
-    public String _connectionString = "vm://:1";
 
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
     }
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        TransportConnection.killAllVMBrokers();
     }
 
     public void testJMSDestination() throws Exception
     {
-        AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
+        AMQConnection con =  (AMQConnection) getConnection("guest", "guest");
         AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         Queue queue =
             new AMQQueue(con.getDefaultQueueExchangeName(), new AMQShortString("someQ"),
new AMQShortString("someQ"), false,
                 true);
         MessageConsumer consumer = consumerSession.createConsumer(queue);
 
-        Connection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
+        Connection con2 =  (AMQConnection) getConnection("guest", "guest");
         Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         MessageProducer producer = producerSession.createProducer(queue);
 

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/JMSPropertiesTest.java
Wed Oct  3 09:35:12 2007
@@ -28,6 +28,7 @@
 import org.apache.qpid.client.message.NonQpidObjectMessage;
 import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.testutil.QpidTestCase;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -42,7 +43,7 @@
 /**
  * @author Apache Software Foundation
  */
-public class JMSPropertiesTest extends TestCase
+public class JMSPropertiesTest extends QpidTestCase
 {
 
     private static final Logger _logger = LoggerFactory.getLogger(JMSPropertiesTest.class);
@@ -56,25 +57,23 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
     }
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        TransportConnection.killAllVMBrokers();
     }
 
     public void testJMSProperties() throws Exception
     {
-        AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
+        AMQConnection con = (AMQConnection) getConnection("guest", "guest");
         AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         Queue queue =
             new AMQQueue(con.getDefaultQueueExchangeName(), new AMQShortString("someQ"),
new AMQShortString("someQ"), false,
                 true);
         MessageConsumer consumer = consumerSession.createConsumer(queue);
 
-        AMQConnection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1",
"test");
+        AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
         Session producerSession = con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         MessageProducer producer = producerSession.createProducer(queue);
         Destination JMS_REPLY_TO = new AMQQueue(con2, "my.replyto");

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/message/StreamMessageTest.java
Wed Oct  3 09:35:12 2007
@@ -20,18 +20,16 @@
  */
 package org.apache.qpid.test.unit.message;
 
-import junit.framework.TestCase;
-
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQHeadersExchange;
 import org.apache.qpid.client.AMQQueue;
 import org.apache.qpid.client.AMQSession;
-import org.apache.qpid.client.transport.TransportConnection;
 import org.apache.qpid.exchange.ExchangeDefaults;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.FieldTable;
 import org.apache.qpid.url.AMQBindingURL;
 import org.apache.qpid.url.BindingURL;
+import org.apache.qpid.testutil.QpidTestCase;
 
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -49,7 +47,7 @@
 /**
  * @author Apache Software Foundation
  */
-public class StreamMessageTest extends TestCase
+public class StreamMessageTest extends QpidTestCase
 {
 
     private static final Logger _logger = LoggerFactory.getLogger(StreamMessageTest.class);
@@ -59,18 +57,16 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
     }
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        TransportConnection.killAllVMBrokers();
     }
 
     public void testStreamMessageEOF() throws Exception
     {
-        Connection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
+        Connection con = (AMQConnection) getConnection("guest", "guest");
         AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
 
         AMQHeadersExchange queue =
@@ -87,7 +83,7 @@
         // ((AMQSession) consumerSession).declareExchangeSynch(ExchangeDefaults.HEADERS_EXCHANGE_NAME,
ExchangeDefaults.HEADERS_EXCHANGE_CLASS);
         // This is the default now
 
-        Connection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
+        Connection con2 = (AMQConnection) getConnection("guest", "guest");
 
         AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
 
@@ -125,7 +121,7 @@
 
     public void testModifyReceivedMessageExpandsBuffer() throws Exception
     {
-        AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "consumer1", "test");
+        AMQConnection con = (AMQConnection) getConnection("guest", "guest");
         AMQSession consumerSession = (AMQSession) con.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         AMQQueue queue = new AMQQueue(con.getDefaultQueueExchangeName(), new AMQShortString("testQ"));
         MessageConsumer consumer = consumerSession.createConsumer(queue);
@@ -148,7 +144,7 @@
                 }
             });
 
-        Connection con2 = new AMQConnection("vm://:1", "guest", "guest", "producer1", "test");
+        Connection con2 = (AMQConnection) getConnection("guest", "guest");
         AMQSession producerSession = (AMQSession) con2.createSession(false, Session.CLIENT_ACKNOWLEDGE);
         MessageProducer mandatoryProducer = producerSession.createProducer(queue);
         con.start();

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/tests.properties
Wed Oct  3 09:35:12 2007
@@ -23,17 +23,17 @@
 
 # register some connection factories
 # connectionfactory.[jndiname] = [ConnectionURL]
-connectionfactory.local = qpid:password=guest;username=guest;client_id=clientid;virtualhost=test@tcp:localhost:5672
-
+connectionfactory.local = qpid:password=guest;username=guest;client_id=clientid;virtualhost=test@tcp:127.0.0.1:5672
+                                                                     
 # register some queues in JNDI using the form
 # queue.[jndiName] = [physicalName]
-queue.MyQueue = example.MyQueue
+#queue.MyQueue = example.MyQueue
 
 # register some topics in JNDI using the form
 # topic.[jndiName] = [physicalName]
-topic.ibmStocks = stocks.nyse.ibm
+#topic.ibmStocks = stocks.nyse.ibm
 
 # Register an AMQP destination in JNDI
 #   NOTE: Qpid currently only supports direct,topics and headers
 # destination.[jniName] = [BindingURL]
-destination.direct = direct://amq.direct//directQueue
+#destination.direct = direct://amq.direct//directQueue

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
Wed Oct  3 09:35:12 2007
@@ -23,6 +23,7 @@
 import junit.framework.TestCase;
 
 import org.apache.qpid.AMQException;
+import org.apache.qpid.testutil.QpidTestCase;
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.client.AMQTopic;
@@ -40,25 +41,23 @@
 import javax.jms.TextMessage;
 import javax.jms.TopicSubscriber;
 
-public class DurableSubscriptionTest extends TestCase
+public class DurableSubscriptionTest extends QpidTestCase
 {
     private static final Logger _logger = LoggerFactory.getLogger(DurableSubscriptionTest.class);
 
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
     }
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        TransportConnection.killAllVMBrokers();
     }
 
-    public void testUnsubscribe() throws AMQException, JMSException, URLSyntaxException
+    public void testUnsubscribe() throws Exception
     {
-        AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
+        AMQConnection con = (AMQConnection) getConnection("guest", "guest");
         AMQTopic topic = new AMQTopic(con, "MyTopic");
         _logger.info("Create Session 1");
         Session session1 = con.createSession(false, AMQSession.NO_ACKNOWLEDGE);
@@ -114,10 +113,10 @@
         con.close();
     }
 
-    public void testDurability() throws AMQException, JMSException, URLSyntaxException
+    public void testDurability() throws Exception
     {
 
-        AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
+        AMQConnection con = (AMQConnection) getConnection("guest", "guest");
         AMQTopic topic = new AMQTopic(con, "MyTopic");
         Session session1 = con.createSession(false, AMQSession.NO_ACKNOWLEDGE);
         MessageConsumer consumer1 = session1.createConsumer(topic);

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicPublisherTest.java
Wed Oct  3 09:35:12 2007
@@ -25,34 +25,30 @@
 import javax.jms.TopicPublisher;
 import javax.jms.TopicSession;
 
-import junit.framework.TestCase;
-
 import org.apache.qpid.client.AMQConnection;
 import org.apache.qpid.client.AMQSession;
 import org.apache.qpid.client.AMQTopic;
-import org.apache.qpid.client.transport.TransportConnection;
+import org.apache.qpid.testutil.QpidTestCase;
 
 /**
  * @author Apache Software Foundation
  */
-public class TopicPublisherTest extends TestCase
+public class TopicPublisherTest extends QpidTestCase
 {
     protected void setUp() throws Exception
     {
         super.setUp();
-        TransportConnection.createVMBroker(1);
     }
 
     protected void tearDown() throws Exception
     {
         super.tearDown();
-        TransportConnection.killAllVMBrokers();
     }
 
     public void testUnidentifiedProducer() throws Exception
     {
 
-        AMQConnection con = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
+        AMQConnection con =  (AMQConnection) getConnection("guest", "guest");
         AMQTopic topic = new AMQTopic(con,"MyTopic");
         TopicSession session1 = con.createTopicSession(false, AMQSession.NO_ACKNOWLEDGE);
         TopicPublisher publisher = session1.createPublisher(null);

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/TopicSessionTest.java
Wed Oct  3 09:35:12 2007
@@ -42,7 +42,6 @@
 /** @author Apache Software Foundation */
 public class TopicSessionTest extends QpidTestCase
 {
-    private static final String BROKER = "vm://:1";
 
     protected void setUp() throws Exception
     {

Modified: incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java?rev=581650&r1=581649&r2=581650&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
(original)
+++ incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/transacted/CommitRollbackTest.java
Wed Oct  3 09:35:12 2007
@@ -20,12 +20,8 @@
  */
 package org.apache.qpid.test.unit.transacted;
 
-import junit.framework.TestCase;
-import org.apache.qpid.AMQException;
 import org.apache.qpid.testutil.QpidTestCase;
 import org.apache.qpid.client.AMQConnection;
-import org.apache.qpid.client.transport.TransportConnection;
-import org.apache.qpid.url.URLSyntaxException;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -55,7 +51,6 @@
     Queue _jmsQueue;
 
     private static final Logger _logger = LoggerFactory.getLogger(CommitRollbackTest.class);
-    private static final String BROKER = "vm://:1";
     private boolean _gotone = false;
     private boolean _gottwo = false;
     private boolean _gottwoRedelivered = false;



Mime
View raw message