Ejemplo n.º 1
0
  public void testWithTime_int_int_int() {
    DateTime test = new DateTime(TEST_TIME1 - 12345L, BUDDHIST_UTC);
    DateTime result = test.withTime(12, 24, 0, 0);
    assertEquals(TEST_TIME1, result.getMillis());
    assertEquals(BUDDHIST_UTC, result.getChronology());

    test = new DateTime(TEST_TIME1);
    try {
      test.withTime(25, 1, 1, 1);
      fail();
    } catch (IllegalArgumentException ex) {
    }
  }