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.195 by jsr166, Sat Jun 4 23:49:29 2016 UTC vs.
Revision 1.199 by jsr166, Sat Aug 6 16:24:05 2016 UTC

# Line 13 | Line 13
13   * @build *
14   * @run junit/othervm/timeout=1000 -Djsr166.testImplementationDetails=true JSR166TestCase
15   * @run junit/othervm/timeout=1000 -Djava.util.concurrent.ForkJoinPool.common.parallelism=0 -Djsr166.testImplementationDetails=true JSR166TestCase
16 + * @run junit/othervm/timeout=1000 -Djava.util.concurrent.ForkJoinPool.common.parallelism=1 -Djava.util.secureRandomSeed=true JSR166TestCase
17   */
18  
19   import static java.util.concurrent.TimeUnit.MILLISECONDS;
# Line 521 | Line 522 | public class JSR166TestCase extends Test
522          // Java9+ test classes
523          if (atLeastJava9()) {
524              String[] java9TestClassNames = {
525 +                "AtomicBoolean9Test",
526 +                "AtomicInteger9Test",
527 +                "AtomicIntegerArray9Test",
528 +                "AtomicLong9Test",
529 +                "AtomicLongArray9Test",
530 +                "AtomicReference9Test",
531 +                "AtomicReferenceArray9Test",
532                  "ExecutorCompletionService9Test",
533              };
534              addNamedTestClasses(suite, java9TestClassNames);
# Line 948 | Line 956 | public class JSR166TestCase extends Test
956          }
957      }
958  
959 <    /** Like Runnable, but with the freedom to throw anything */
959 >    /**
960 >     * Like Runnable, but with the freedom to throw anything.
961 >     * junit folks had the same idea:
962 >     * http://junit.org/junit5/docs/snapshot/api/org/junit/gen5/api/Executable.html
963 >     */
964      interface Action { public void run() throws Throwable; }
965  
966      /**
# Line 1239 | Line 1251 | public class JSR166TestCase extends Test
1251       * thread to enter a wait state: BLOCKED, WAITING, or TIMED_WAITING.
1252       */
1253      void waitForThreadToEnterWaitState(Thread thread, long timeoutMillis) {
1254 <        long startTime = System.nanoTime();
1254 >        long startTime = 0L;
1255          for (;;) {
1256              Thread.State s = thread.getState();
1257              if (s == Thread.State.BLOCKED ||
# Line 1248 | Line 1260 | public class JSR166TestCase extends Test
1260                  return;
1261              else if (s == Thread.State.TERMINATED)
1262                  fail("Unexpected thread termination");
1263 +            else if (startTime == 0L)
1264 +                startTime = System.nanoTime();
1265              else if (millisElapsedSince(startTime) > timeoutMillis) {
1266                  threadAssertTrue(thread.isAlive());
1267                  return;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines