Author: vinoski
Date: Wed Nov 22 14:17:32 2006
New Revision: 478343

URL: http://svn.apache.org/viewvc?view=rev&rev=478343
Log:
* use VMBrokerSetup test helper class where appropriate
* change notifyAll() to notify() in MultipleConnectionTest.java

Modified:
    
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
    
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
    
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.java

Modified: 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java?view=diff&rev=478343&r1=478342&r2=478343
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MapMessageTest.java
 Wed Nov 22 14:17:32 2006
@@ -53,7 +53,6 @@
         super.setUp();
         try
         {
-            TransportConnection.createVMBroker(1);
             init(new AMQConnection(_connectionString, "guest", "guest", 
randomize("Client"), "/test_path"));
         }
         catch (Exception e)
@@ -136,7 +135,7 @@
 //            try
 //            {
 //                m.setInt("testint", 3);
-//                Assert.fail("Message should not be writeable");
+//                fail("Message should not be writeable");
 //            }
 //            catch (MessageNotWriteableException mnwe)
 //            {

Modified: 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java?view=diff&rev=478343&r1=478342&r2=478343
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/MultipleConnectionTest.java
 Wed Nov 22 14:17:32 2006
@@ -36,7 +36,8 @@
  */
 public class MultipleConnectionTest extends TestCase
 {
-    public static String _connectionString = "vm://:1";
+    public static final String _defaultBroker = "vm://:1";
+    public static String _connectionString = _defaultBroker;
 
     private static class Receiver
     {
@@ -111,7 +112,7 @@
         public synchronized void onMessage(Message message)
         {
             _count++;
-            notifyAll();
+            notify();
         }
 
         synchronized boolean waitUntil(int expected, long maxWait) throws 
InterruptedException
@@ -154,7 +155,6 @@
             {
                 throw new RuntimeException("Expected: " + expected + " got " + 
counters[i]);
             }
-            ;
         }
     }
 
@@ -165,7 +165,7 @@
 
     public static void main(String[] argv) throws Exception
     {
-        String broker = argv.length > 0 ? argv[0] : "vm://:1";
+        String broker = argv.length > 0 ? argv[0] : _defaultBroker;
 
         int connections = 7;
         int sessions = 2;
@@ -181,14 +181,6 @@
         int messages = 10;
 
         AMQTopic topic = new AMQTopic("amq.topic");
-
-        /*
-        Receiver[] receivers = new Receiver[connections];
-        for(int i = 0; i < receivers.length; i++)
-        {
-            receivers[i] = new Receiver(broker, topic, sessions);
-        }
-        */
 
         Receiver[] receivers = new Receiver[]{
                 new Receiver(broker, topic, 2),

Modified: 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.java
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.java?view=diff&rev=478343&r1=478342&r2=478343
==============================================================================
--- 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.java
 (original)
+++ 
incubator/qpid/trunk/qpid/java/client/src/test/java/org/apache/qpid/test/unit/basic/ReceiveTest.java
 Wed Nov 22 14:17:32 2006
@@ -99,10 +99,17 @@
         test._connectionString = argv.length == 0 ? VM_BROKER : argv[0];
         test.setUp();
         test.test();
+        test.tearDown();
     }
 
     public static junit.framework.Test suite()
     {
+        // TODO: note that this test doesn't use the VMBrokerSetup
+        // test helper class to create and tear down its
+        // VMBroker. This is because the main() above seems to
+        // indicate that it's also used outside of the surefire test
+        // framework. If it isn't, then this test should also be
+        // changed to use VMBrokerSetup here.
         return new junit.framework.TestSuite(ReceiveTest.class);
     }
 }


Reply via email to