[jboss-svn-commits] JBL Code SVN: r27949 - labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jul 13 07:40:16 EDT 2009


Author: adinn
Date: 2009-07-13 07:40:16 -0400 (Mon, 13 Jul 2009)
New Revision: 27949

Modified:
   labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/ActionTestClient.java
Log:
modified ActionTestClient to remove fixed wait -- fixes for JBTM-576

Modified: labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/ActionTestClient.java
===================================================================
--- labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/ActionTestClient.java	2009-07-13 11:09:35 UTC (rev 27948)
+++ labs/jbosstm/trunk/ArjunaCore/arjuna/tests/classes/com/hp/mwtests/ts/arjuna/recovery/ActionTestClient.java	2009-07-13 11:40:16 UTC (rev 27949)
@@ -235,8 +235,26 @@
         catch (Exception ex) {
             System.err.println(" FAILED " + ex);
         }
+        finally
+        {
+            synchronized (this) {
+                finished = true;
+                notify();
+            }
+        }
     }
 
+    public synchronized void waitForFinished()
+    {
+        while (!finished) {
+            try {
+                wait();
+            } catch (InterruptedException e) {
+                // ignore
+            }
+        }
+    }
+
     private static TransactionStatusConnector _tsc;
 
     private static BufferedReader _in;
@@ -244,6 +262,8 @@
 
     public static int _tests_passed = 0;
     public static int _tests_failed = 0;
+    private boolean finished = false;
+
 }
 
 public class ActionTestClient
@@ -258,7 +278,7 @@
 
         listener.start();
         
-        Thread.sleep(1000);  // allow time for test to run
+        test_service.waitForFinished();
 
         listener.stopListener();
         




More information about the jboss-svn-commits mailing list