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.77 by jsr166, Fri May 6 17:26:29 2011 UTC vs.
Revision 1.78 by jsr166, Sat May 7 19:03:26 2011 UTC

# Line 478 | Line 478 | public class JSR166TestCase extends Test
478          }
479      }
480  
481 +    /**
482 +     * Checks that thread does not terminate within timeoutMillis
483 +     * milliseconds (that is, Thread.join times out).
484 +     */
485 +    public void assertThreadJoinTimesOut(Thread thread, long timeoutMillis) {
486 +        try {
487 +            long startTime = System.nanoTime();
488 +            thread.join(timeoutMillis);
489 +            assertTrue(thread.isAlive());
490 +            assertTrue(millisElapsedSince(startTime) >= timeoutMillis);
491 +        } catch (InterruptedException ie) {
492 +            fail("Unexpected InterruptedException");
493 +        }
494 +    }
495  
496      /**
497       * Fails with message "should throw exception".

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines