qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ai...@apache.org
Subject svn commit: r650658 - in /incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit: basic/SelectorTest.java topic/DurableSubscriptionTest.java
Date Tue, 22 Apr 2008 21:15:06 GMT
Author: aidan
Date: Tue Apr 22 14:15:04 2008
New Revision: 650658

URL: http://svn.apache.org/viewvc?rev=650658&view=rev
Log:
QPID-832 make tests use new QpidTestCase magic for getting connections

Modified:
    incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.java
    incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java

Modified: incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.java?rev=650658&r1=650657&r2=650658&view=diff
==============================================================================
--- incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.java
(original)
+++ incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/SelectorTest.java
Tue Apr 22 14:15:04 2008
@@ -55,7 +55,7 @@
     protected void setUp() throws Exception
     {
         super.setUp();
-        init((AMQConnection) getConnection("guest", "guest"));
+        init((AMQConnection) getConnection("", "guest"));
     }
 
     protected void tearDown() throws Exception
@@ -83,12 +83,12 @@
         _session.createConsumer(destination, selector).setMessageListener(this);
     }
 
-    public synchronized void test() throws JMSException, InterruptedException, URLSyntaxException,
AMQException
+    public synchronized void test() throws Exception
     {
         try
         {
 
-            init(new AMQConnection(_connectionString, "guest", "guest", randomize("Client"),
"test"));
+            init((AMQConnection) getConnection("guest", "guest", randomize("Client")));
 
             Message msg = _session.createTextMessage("Message");
             msg.setJMSPriority(1);
@@ -154,13 +154,13 @@
     }
 
 
-    public void testInvalidSelectors()
+    public void testInvalidSelectors() throws Exception
     {
         Connection connection = null;
 
         try
         {
-            connection = new AMQConnection(_connectionString, "guest", "guest", randomize("Client"),
"test");
+            connection = getConnection("guest", "guest", randomize("Client"));
             _session = (AMQSession) connection.createSession(false, AMQSession.NO_ACKNOWLEDGE);
         }
         catch (JMSException e)

Modified: incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java?rev=650658&r1=650657&r2=650658&view=diff
==============================================================================
--- incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
(original)
+++ incubator/qpid/branches/thegreatmerge/qpid/java/client/src/test/java/org/apache/qpid/test/unit/topic/DurableSubscriptionTest.java
Tue Apr 22 14:15:04 2008
@@ -121,24 +121,24 @@
         con.close();
     }
 
-    public void testDurabilityAUTOACK() throws AMQException, JMSException, URLSyntaxException
+    public void testDurabilityAUTOACK() throws Exception
     {
         durabilityImpl(Session.AUTO_ACKNOWLEDGE);
     }
 
-    public void testDurabilityNOACKSessionPerConnection() throws AMQException, JMSException,
URLSyntaxException
+    public void testDurabilityNOACKSessionPerConnection() throws Exception
     {
         durabilityImplSessionPerConnection(AMQSession.NO_ACKNOWLEDGE);
     }
 
-    public void testDurabilityAUTOACKSessionPerConnection() throws AMQException, JMSException,
URLSyntaxException
+    public void testDurabilityAUTOACKSessionPerConnection() throws Exception
     {
         durabilityImplSessionPerConnection(Session.AUTO_ACKNOWLEDGE);
     }
 
-    private void durabilityImpl(int ackMode) throws AMQException, JMSException, URLSyntaxException
+    private void durabilityImpl(int ackMode) 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, ackMode);
         MessageConsumer consumer1 = session1.createConsumer(topic);
@@ -193,11 +193,11 @@
         con.close();
     }
 
-    private void durabilityImplSessionPerConnection(int ackMode) throws AMQException, JMSException,
URLSyntaxException
+    private void durabilityImplSessionPerConnection(int ackMode) throws Exception
     {
         Message msg;
         // Create producer.
-        AMQConnection con0 = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
+        AMQConnection con0 = (AMQConnection) getConnection("guest", "guest");
         con0.start();
         Session session0 = con0.createSession(false, ackMode);
 
@@ -207,14 +207,14 @@
         MessageProducer producer = sessionProd.createProducer(topic);
 
         // Create consumer 1.
-        AMQConnection con1 = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
+        AMQConnection con1 = (AMQConnection) getConnection("guest", "guest");
         con1.start();
         Session session1 = con1.createSession(false, ackMode);
 
         MessageConsumer consumer1 = session0.createConsumer(topic);
 
         // Create consumer 2.
-        AMQConnection con2 = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
+        AMQConnection con2 = (AMQConnection) getConnection("guest", "guest");
         con2.start();
         Session session2 = con2.createSession(false, ackMode);
 
@@ -251,7 +251,7 @@
         assertEquals(null, msg);
 
         // Re-attach a new consumer to the durable subscription, and check that it gets the
message that it missed.
-        AMQConnection con3 = new AMQConnection("vm://:1", "guest", "guest", "test", "test");
+        AMQConnection con3 = (AMQConnection) getConnection("guest", "guest");
         con3.start();
         Session session3 = con3.createSession(false, ackMode);
 



Mime
View raw message