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.37 by dl, Tue Aug 4 00:23:18 2009 UTC vs.
Revision 1.39 by jsr166, Tue Nov 17 21:51:45 2009 UTC

# Line 395 | Line 395 | public class JSR166TestCase extends Test
395          public void refresh() {}
396      }
397  
398 +    /**
399 +     * Sleep until the timeout has elapsed, or interrupted.
400 +     * Does <em>NOT</em> throw InterruptedException.
401 +     */
402 +    void sleepTillInterrupted(long timeoutMillis) {
403 +        try {
404 +            Thread.sleep(timeoutMillis);
405 +        } catch (InterruptedException wakeup) {
406 +        }
407 +    }
408 +
409 +    /**
410 +     * Returns a new started Thread running the given runnable.
411 +     */
412 +    Thread newStartedThread(Runnable runnable) {
413 +        Thread t = new Thread(runnable);
414 +        t.start();
415 +        return t;
416 +    }
417  
418      // Some convenient Runnable classes
419  
# Line 547 | Line 566 | public class JSR166TestCase extends Test
566              try {
567                  Thread.sleep(SMALL_DELAY_MS);
568                  done = true;
569 <            } catch (Exception e) {
569 >            } catch (InterruptedException ok) {
570              }
571          }
572      }
# Line 558 | Line 577 | public class JSR166TestCase extends Test
577              try {
578                  Thread.sleep(MEDIUM_DELAY_MS);
579                  done = true;
580 <            } catch (Exception e) {
580 >            } catch (InterruptedException ok) {
581              }
582          }
583      }
# Line 569 | Line 588 | public class JSR166TestCase extends Test
588              try {
589                  Thread.sleep(LONG_DELAY_MS);
590                  done = true;
591 <            } catch (Exception e) {
591 >            } catch (InterruptedException ok) {
592              }
593          }
594      }
# Line 587 | Line 606 | public class JSR166TestCase extends Test
606              try {
607                  Thread.sleep(SMALL_DELAY_MS);
608                  done = true;
609 <            } catch (Exception e) {
609 >            } catch (InterruptedException ok) {
610              }
611              return Boolean.TRUE;
612          }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines