Ejemplo n.º 1
0
  public void testFactory_Zone_RI() {
    GJChronology chrono = GJChronology.getInstance(TOKYO, new Instant(0L));
    assertEquals(TOKYO, chrono.getZone());
    assertEquals(new Instant(0L), chrono.getGregorianCutover());
    assertSame(GJChronology.class, GJChronology.getInstance(TOKYO, new Instant(0L)).getClass());

    DateTime cutover = new DateTime(1582, 10, 15, 0, 0, 0, 0, DateTimeZone.UTC);
    chrono = GJChronology.getInstance(TOKYO, null);
    assertEquals(TOKYO, chrono.getZone());
    assertEquals(cutover.toInstant(), chrono.getGregorianCutover());
  }
Ejemplo n.º 2
0
  public void testFactory_Zone_RI_int() {
    GJChronology chrono = GJChronology.getInstance(TOKYO, new Instant(0L), 2);
    assertEquals(TOKYO, chrono.getZone());
    assertEquals(new Instant(0L), chrono.getGregorianCutover());
    assertEquals(2, chrono.getMinimumDaysInFirstWeek());
    assertSame(GJChronology.class, GJChronology.getInstance(TOKYO, new Instant(0L), 2).getClass());

    DateTime cutover = new DateTime(1582, 10, 15, 0, 0, 0, 0, DateTimeZone.UTC);
    chrono = GJChronology.getInstance(TOKYO, null, 2);
    assertEquals(TOKYO, chrono.getZone());
    assertEquals(cutover.toInstant(), chrono.getGregorianCutover());
    assertEquals(2, chrono.getMinimumDaysInFirstWeek());

    try {
      GJChronology.getInstance(TOKYO, new Instant(0L), 0);
      fail();
    } catch (IllegalArgumentException ex) {
    }
    try {
      GJChronology.getInstance(TOKYO, new Instant(0L), 8);
      fail();
    } catch (IllegalArgumentException ex) {
    }
  }
Ejemplo n.º 3
0
  public void testFactory_Zone_long_int() {
    GJChronology chrono = GJChronology.getInstance(TOKYO, 0L, 2);
    assertEquals(TOKYO, chrono.getZone());
    assertEquals(new Instant(0L), chrono.getGregorianCutover());
    assertEquals(2, chrono.getMinimumDaysInFirstWeek());
    assertSame(GJChronology.class, GJChronology.getInstance(TOKYO, 0L, 2).getClass());

    try {
      GJChronology.getInstance(TOKYO, 0L, 0);
      fail();
    } catch (IllegalArgumentException ex) {
    }
    try {
      GJChronology.getInstance(TOKYO, 0L, 8);
      fail();
    } catch (IllegalArgumentException ex) {
    }
  }