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.225 by jsr166, Sat May 13 22:36:45 2017 UTC vs.
Revision 1.227 by jsr166, Sun May 14 03:12:05 2017 UTC

# Line 1104 | Line 1104 | public class JSR166TestCase extends Test
1104      }
1105  
1106      /**
1107     * Checks that the threads do not terminate within the default
1108     * millisecond delay of {@code timeoutMillis()}.
1109     */
1110    void assertThreadsStayAlive(Thread... threads) {
1111        assertThreadsStayAlive(timeoutMillis(), threads);
1112    }
1113
1114    /**
1115     * Checks that the threads do not terminate within the given millisecond delay.
1116     */
1117    void assertThreadsStayAlive(long millis, Thread... threads) {
1118        try {
1119            // No need to optimize the failing case via Thread.join.
1120            delay(millis);
1121            for (Thread thread : threads)
1122                assertTrue(thread.isAlive());
1123        } catch (InterruptedException fail) {
1124            threadFail("Unexpected InterruptedException");
1125        }
1126    }
1127
1128    /**
1107       * Checks that future.get times out, with the default timeout of
1108       * {@code timeoutMillis()}.
1109       */
# Line 1635 | Line 1613 | public class JSR166TestCase extends Test
1613          } catch (Throwable fail) {
1614              threadUnexpectedException(fail);
1615          }
1616 +    }
1617 +
1618 +    public void await(CyclicBarrier barrier) {
1619 +        try {
1620 +            barrier.await(LONG_DELAY_MS, MILLISECONDS);
1621 +        } catch (Throwable fail) {
1622 +            threadUnexpectedException(fail);
1623 +        }
1624      }
1625  
1626   //     /**

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines