ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/JSR166TestCase.java
(Generate patch)

Comparing jsr166/src/test/tck/JSR166TestCase.java (file contents):
Revision 1.93 by jsr166, Sun Dec 16 17:22:42 2012 UTC vs.
Revision 1.96 by jsr166, Mon Jan 21 19:51:46 2013 UTC

# Line 11 | Line 11 | import java.io.ByteArrayInputStream;
11   import java.io.ByteArrayOutputStream;
12   import java.io.ObjectInputStream;
13   import java.io.ObjectOutputStream;
14 + import java.lang.management.ManagementFactory;
15 + import java.lang.management.ThreadInfo;
16   import java.util.ArrayList;
17   import java.util.Arrays;
18   import java.util.Date;
# Line 145 | Line 147 | public class JSR166TestCase extends Test
147      }
148  
149      /**
150 <     * Runs all JSR166 unit tests using junit.textui.TestRunner
150 >     * Runs all JSR166 unit tests using junit.textui.TestRunner.
151 >     * Optional command line arg provides the number of iterations to
152 >     * repeat running the tests.
153       */
154      public static void main(String[] args) {
155          if (useSecurityManager) {
# Line 510 | Line 514 | public class JSR166TestCase extends Test
514      }
515  
516      /**
517 +     * A debugging tool to print all stack traces, as jstack does.
518 +     */
519 +    static void printAllStackTraces() {
520 +        for (ThreadInfo info :
521 +                 ManagementFactory.getThreadMXBean()
522 +                 .dumpAllThreads(true, true))
523 +            System.err.print(info);
524 +    }
525 +
526 +    /**
527       * Checks that thread does not terminate within the default
528       * millisecond delay of {@code timeoutMillis()}.
529       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines