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.19 by jsr166, Tue Mar 15 19:47:07 2011 UTC vs.
Revision 1.20 by jsr166, Fri May 27 19:12:09 2011 UTC

# Line 6 | Line 6
6   * Pat Fisher, Mike Judd.
7   */
8  
9
9   import junit.framework.*;
10   import java.util.concurrent.*;
11   import java.io.*;
# Line 49 | Line 48 | public class TimeUnitTest extends JSR166
48                           TimeUnit.SECONDS.convert(1000000000L*t,
49                                                    TimeUnit.NANOSECONDS));
50  
52
51              assertEquals(1000L*t*60*60*24,
52                           TimeUnit.MILLISECONDS.convert(t,
53                                                    TimeUnit.DAYS));
# Line 279 | Line 277 | public class TimeUnitTest extends JSR166
277          }
278      }
279  
282
280      /**
281       * convert saturates positive too-large values to Long.MAX_VALUE
282       * and negative to LONG.MIN_VALUE
# Line 322 | Line 319 | public class TimeUnitTest extends JSR166
319                       TimeUnit.MILLISECONDS.toNanos(-Long.MAX_VALUE / 3));
320      }
321  
325
322      /**
323 <     * toString returns string containing common name of unit
323 >     * toString returns name of unit
324       */
325      public void testToString() {
326 <        String s = TimeUnit.SECONDS.toString();
331 <        assertTrue(s.indexOf("ECOND") >= 0);
326 >        assertEquals("SECONDS", TimeUnit.SECONDS.toString());
327      }
328  
329 +    /**
330 +     * name returns name of unit
331 +     */
332 +    public void testName() {
333 +        assertEquals("SECONDS", TimeUnit.SECONDS.name());
334 +    }
335  
336      /**
337       * Timed wait without holding lock throws
# Line 371 | Line 372 | public class TimeUnitTest extends JSR166
372          t.join();
373      }
374  
374
375      /**
376       * timedJoin throws InterruptedException when interrupted
377       */

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines