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.229 by jsr166, Sun May 14 03:15:37 2017 UTC vs.
Revision 1.230 by jsr166, Mon May 15 16:21:07 2017 UTC

# Line 1083 | Line 1083 | public class JSR166TestCase extends Test
1083      }
1084  
1085      /**
1086 +     * Checks that thread does not terminate within the default
1087 +     * millisecond delay of {@code timeoutMillis()}.
1088 +     * TODO: REMOVEME
1089 +     */
1090 +    void assertThreadStaysAlive(Thread thread) {
1091 +        assertThreadStaysAlive(thread, timeoutMillis());
1092 +    }
1093 +
1094 +    /**
1095 +     * Checks that thread does not terminate within the given millisecond delay.
1096 +     * TODO: REMOVEME
1097 +     */
1098 +    void assertThreadStaysAlive(Thread thread, long millis) {
1099 +        try {
1100 +            // No need to optimize the failing case via Thread.join.
1101 +            delay(millis);
1102 +            assertTrue(thread.isAlive());
1103 +        } catch (InterruptedException fail) {
1104 +            threadFail("Unexpected InterruptedException");
1105 +        }
1106 +    }
1107 +
1108 +    /**
1109       * Checks that future.get times out, with the default timeout of
1110       * {@code timeoutMillis()}.
1111       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines