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.89 by jsr166, Fri Jun 3 05:07:14 2011 UTC vs.
Revision 1.90 by jsr166, Wed Jun 22 07:46:57 2011 UTC

# Line 528 | Line 528 | public class JSR166TestCase extends Test
528      }
529  
530      /**
531 +     * Checks that the threads do not terminate within the default
532 +     * millisecond delay of {@code timeoutMillis()}.
533 +     */
534 +    void assertThreadsStayAlive(Thread... threads) {
535 +        assertThreadsStayAlive(timeoutMillis(), threads);
536 +    }
537 +
538 +    /**
539 +     * Checks that the threads do not terminate within the given millisecond delay.
540 +     */
541 +    void assertThreadsStayAlive(long millis, Thread... threads) {
542 +        try {
543 +            // No need to optimize the failing case via Thread.join.
544 +            delay(millis);
545 +            for (Thread thread : threads)
546 +                assertTrue(thread.isAlive());
547 +        } catch (InterruptedException ie) {
548 +            fail("Unexpected InterruptedException");
549 +        }
550 +    }
551 +
552 +    /**
553       * Checks that future.get times out, with the default timeout of
554       * {@code timeoutMillis()}.
555       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines