harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mloe...@apache.org
Subject svn commit: r482617 - /harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
Date Tue, 05 Dec 2006 12:18:20 GMT
Author: mloenko
Date: Tue Dec  5 04:18:18 2006
New Revision: 482617

URL: http://svn.apache.org/viewvc?view=rev&rev=482617
Log:
update to simplify intermittent failure analysis - we will see the stack trace

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

Modified: harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java?view=diff&rev=482617&r1=482616&r2=482617
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/swing/src/test/api/java/common/javax/swing/Timer_MultithreadedTest.java
Tue Dec  5 04:18:18 2006
@@ -372,9 +372,13 @@
     public void testSetLogTimers() {
         class LogOutputStream extends OutputStream {
             public boolean written = false;
+            public boolean log_allowed = false;
 
             @Override
             public void write(int b) throws IOException {
+                //if we fail we know who is logging by stack trace
+                assertTrue("log must not be written", log_allowed);
+
                 written = true;
             }
         }
@@ -391,10 +395,11 @@
             assertFalse("[1] doesn't log timers", Timer.getLogTimers());
             listener.waitAction(250);
             assertTrue("[1] action performed ", listener.performed);
-            assertFalse("[1] log's not written", logOut.written);
             timer.stop();
             listener.reset();
+
             Timer.setLogTimers(true);
+            logOut.log_allowed = true;
             timer.start();
             listener.waitAction(250);
             assertTrue("[2] logs timers ", Timer.getLogTimers());
@@ -403,13 +408,14 @@
             timer.stop();
             listener.waitAction(200);
             listener.reset();
+
             Timer.setLogTimers(false);
             logOut.written = false;
+            logOut.log_allowed = false;
             timer.start();
             listener.waitAction(50);
             assertFalse("[3] doesn't log timers ", Timer.getLogTimers());
             assertTrue("[3] action performed", listener.performed);
-            assertFalse("[3] log's not written", logOut.written);
         } finally {
             System.setOut(oldOut);
             Timer.setLogTimers(false);



Mime
View raw message