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.16 by jsr166, Thu Sep 16 03:57:13 2010 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 309 | Line 309 | public class TimeUnitTest extends JSR166
309          assertEquals(Long.MIN_VALUE,
310                       TimeUnit.NANOSECONDS.convert(-Long.MAX_VALUE / 4,
311                                                    TimeUnit.DAYS));
312
312      }
313  
314      /**
# Line 357 | Line 356 | public class TimeUnitTest extends JSR166
356       * timedWait throws InterruptedException when interrupted
357       */
358      public void testTimedWait() throws InterruptedException {
359 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
360 <            public void realRun() throws InterruptedException {
359 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
360 >            public void realRun() throws InterruptedException {
361                  Object o = new Object();
362  
363                  TimeUnit tu = TimeUnit.MILLISECONDS;
364 <                synchronized(o) {
364 >                synchronized (o) {
365                      tu.timedWait(o,MEDIUM_DELAY_MS);
366                  }
367              }});
368 <        t.start();
368 >        t.start();
369          Thread.sleep(SHORT_DELAY_MS);
370          t.interrupt();
371          t.join();
# Line 381 | Line 380 | public class TimeUnitTest extends JSR166
380              public void realRun() throws InterruptedException {
381                  Thread.sleep(MEDIUM_DELAY_MS);
382              }});
383 <        final Thread t = new Thread(new CheckedInterruptedRunnable() {
384 <            public void realRun() throws InterruptedException {
383 >        final Thread t = new Thread(new CheckedInterruptedRunnable() {
384 >            public void realRun() throws InterruptedException {
385                  TimeUnit tu = TimeUnit.MILLISECONDS;
386                  tu.timedJoin(s, MEDIUM_DELAY_MS);
387              }});;
388          s.start();
389 <        t.start();
389 >        t.start();
390          Thread.sleep(SHORT_DELAY_MS);
391          t.interrupt();
392          t.join();
# Line 399 | Line 398 | public class TimeUnitTest extends JSR166
398       *  timedSleep throws InterruptedException when interrupted
399       */
400      public void testTimedSleep() throws InterruptedException {
401 <        Thread t = new Thread(new CheckedInterruptedRunnable() {
402 <            public void realRun() throws InterruptedException {
401 >        Thread t = new Thread(new CheckedInterruptedRunnable() {
402 >            public void realRun() throws InterruptedException {
403                  TimeUnit tu = TimeUnit.MILLISECONDS;
404                  tu.sleep(MEDIUM_DELAY_MS);
405              }});
406  
407 <        t.start();
407 >        t.start();
408          Thread.sleep(SHORT_DELAY_MS);
409          t.interrupt();
410          t.join();

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines