ViewVC Help
View File | Revision Log | Show Annotations | Download File | Root Listing
root/jsr166/jsr166/src/test/tck/TimeUnitTest.java
(Generate patch)

Comparing jsr166/src/test/tck/TimeUnitTest.java (file contents):
Revision 1.13 by jsr166, Tue Nov 17 06:28:37 2009 UTC vs.
Revision 1.14 by jsr166, Sat Nov 21 02:07:27 2009 UTC

# Line 13 | Line 13 | import java.io.*;
13  
14   public class TimeUnitTest extends JSR166TestCase {
15      public static void main(String[] args) {
16 <        junit.textui.TestRunner.run(suite());
16 >        junit.textui.TestRunner.run(suite());
17      }
18  
19      public static Test suite() {
20 <        return new TestSuite(TimeUnitTest.class);
20 >        return new TestSuite(TimeUnitTest.class);
21      }
22  
23      // (loops to 88888 check increments at all time divisions.)
# Line 357 | Line 357 | public class TimeUnitTest extends JSR166
357       * timedWait throws InterruptedException when interrupted
358       */
359      public void testTimedWait() throws InterruptedException {
360 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
361 <            public void realRun() throws InterruptedException {
360 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
361 >            public void realRun() throws InterruptedException {
362                  Object o = new Object();
363  
364                  TimeUnit tu = TimeUnit.MILLISECONDS;
# Line 366 | Line 366 | public class TimeUnitTest extends JSR166
366                      tu.timedWait(o,MEDIUM_DELAY_MS);
367                  }
368              }});
369 <        t.start();
369 >        t.start();
370          Thread.sleep(SHORT_DELAY_MS);
371          t.interrupt();
372          t.join();
# Line 381 | Line 381 | public class TimeUnitTest extends JSR166
381              public void realRun() throws InterruptedException {
382                  Thread.sleep(MEDIUM_DELAY_MS);
383              }});
384 <        final Thread t = new Thread(new CheckedInterruptedRunnable() {
385 <            public void realRun() throws InterruptedException {
384 >        final Thread t = new Thread(new CheckedInterruptedRunnable() {
385 >            public void realRun() throws InterruptedException {
386                  TimeUnit tu = TimeUnit.MILLISECONDS;
387                  tu.timedJoin(s, MEDIUM_DELAY_MS);
388              }});;
389          s.start();
390 <        t.start();
390 >        t.start();
391          Thread.sleep(SHORT_DELAY_MS);
392          t.interrupt();
393          t.join();
# Line 399 | Line 399 | public class TimeUnitTest extends JSR166
399       *  timedSleep throws InterruptedException when interrupted
400       */
401      public void testTimedSleep() throws InterruptedException {
402 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
403 <            public void realRun() throws InterruptedException {
402 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
403 >            public void realRun() throws InterruptedException {
404                  TimeUnit tu = TimeUnit.MILLISECONDS;
405                  tu.sleep(MEDIUM_DELAY_MS);
406              }});
407  
408 <        t.start();
408 >        t.start();
409          Thread.sleep(SHORT_DELAY_MS);
410          t.interrupt();
411          t.join();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines