Exemplo n.º 1
0
  /**
   * In Chicago, the 4.55:59pm on 21 Mar 2002 is java.util.Date(1016751359000L). Use this to check
   * the Second constructor.
   */
  public void testDateConstructor2() {
    TimeZone zone = TimeZone.getTimeZone("America/Chicago");
    Locale locale = Locale.getDefault(); // locale shouldn't matter here
    Second s1 = new Second(new Date(1016751358999L), zone, locale);
    Second s2 = new Second(new Date(1016751359000L), zone, locale);

    assertEquals(58, s1.getSecond());
    assertEquals(1016751358999L, s1.getLastMillisecond(zone));

    assertEquals(59, s2.getSecond());
    assertEquals(1016751359000L, s2.getFirstMillisecond(zone));
  }
Exemplo n.º 2
0
 /** Some checks for the testNext() method. */
 public void testNext() {
   Second s = new Second(55, 30, 1, 12, 12, 2000);
   s = (Second) s.next();
   assertEquals(2000, s.getMinute().getHour().getYear());
   assertEquals(12, s.getMinute().getHour().getMonth());
   assertEquals(12, s.getMinute().getHour().getDayOfMonth());
   assertEquals(1, s.getMinute().getHour().getHour());
   assertEquals(30, s.getMinute().getMinute());
   assertEquals(56, s.getSecond());
   s = new Second(59, 59, 23, 31, 12, 9999);
   assertNull(s.next());
 }