[jboss-cvs] JBoss Messaging SVN: r3994 - branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/clustering.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Apr 3 06:29:54 EDT 2008


Author: ataylor
Date: 2008-04-03 06:29:54 -0400 (Thu, 03 Apr 2008)
New Revision: 3994

Modified:
   branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/clustering/MultipleFailoverTest.java
Log:
change to test synchronisation

Modified: branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/clustering/MultipleFailoverTest.java
===================================================================
--- branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/clustering/MultipleFailoverTest.java	2008-04-02 21:35:38 UTC (rev 3993)
+++ branches/Branch_JBossMessaging_1_4_0_SP3_CP/tests/src/org/jboss/test/messaging/jms/clustering/MultipleFailoverTest.java	2008-04-03 10:29:54 UTC (rev 3994)
@@ -21,22 +21,14 @@
 */
 package org.jboss.test.messaging.jms.clustering;
 
+import org.jboss.jms.client.JBossConnection;
+import org.jboss.test.messaging.tools.ServerManagement;
+
+import javax.jms.*;
 import java.util.Iterator;
 import java.util.Set;
 import java.util.TreeSet;
 
-import javax.jms.Connection;
-import javax.jms.DeliveryMode;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageListener;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-
-import org.jboss.jms.client.JBossConnection;
-import org.jboss.test.messaging.tools.ServerManagement;
-
 /**
  * A test where we kill multiple nodes and make sure the failover works correctly in these condtions
  * too.
@@ -244,7 +236,7 @@
             
             count++;
             
-            Thread.sleep(5);
+            //Thread.sleep(5);
          }
          
          log.info("done send");
@@ -443,19 +435,25 @@
       	{
       		log.info("here");
       		long toWait = 30000;
-      		while (maxcnt < i && toWait > 0)
+      		while (maxcnt < i)
       		{
-      			long start = System.currentTimeMillis();
       			try
       			{      		
-      				obj.wait(60000);
-      			}
+      				long time = System.currentTimeMillis();
+                  obj.wait(60000);
+                  long pause = System.currentTimeMillis() - time;
+                  if(pause > 60000)
+                  {
+                     //we've time out
+                     break;
+                  }
+               }
       			catch (InterruptedException e)
       			{}
       			if (maxcnt < i)
       			{
-      				toWait -= System.currentTimeMillis() - start;
-      			}            			      
+                  System.out.println("maxcnt = " + maxcnt + " i = " + i);
+               }
       		}
       		return maxcnt == i;
       	}
@@ -466,6 +464,7 @@
       {
          try
          {
+            Thread.sleep(5);
             int cnt = msg.getIntProperty("cnt");
                         
             if (cnt % 100 == 0)
@@ -499,7 +498,7 @@
             msgs.add(new Integer(cnt));
             
             maxcnt = Math.max(maxcnt, cnt);
-            
+
             synchronized (obj)
             {
             	obj.notify();




More information about the jboss-cvs-commits mailing list