harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ndbe...@apache.org
Subject svn commit: r479488 - /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BasicSwingTestCase.java
Date Mon, 27 Nov 2006 01:33:26 GMT
Author: ndbeyer
Date: Sun Nov 26 17:33:25 2006
New Revision: 479488

URL: http://svn.apache.org/viewvc?view=rev&rev=479488
Log:
Replace "Thread.stop" use with repeated thread interrupts.

Modified:
    harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BasicSwingTestCase.java

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BasicSwingTestCase.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BasicSwingTestCase.java?view=diff&rev=479488&r1=479487&r2=479488
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BasicSwingTestCase.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/BasicSwingTestCase.java
Sun Nov 26 17:33:25 2006
@@ -140,10 +140,12 @@
         });
         thread.start();
         thread.join(timeoutDelay);
-        if (thread.isAlive()) {
-            // TODO is this stop necessary?
-            thread.stop();
-            fail("Test interrupted due timeout");
+        int interruptAttempts = 0;
+        while (thread.isAlive()){
+            thread.interrupt();
+            if (interruptAttempts++ < 5) {
+                fail("Test interrupted due timeout");
+            }
         }
         if (exception[0] != null) {
             rethrow(exception[0]);



Mime
View raw message