Ejemplo n.º 1
0
  // -----------------------------------------------------------------------
  public void testWithDate_int_int_int() {
    DateTime test = new DateTime(2002, 4, 5, 1, 2, 3, 4, ISO_UTC);
    DateTime result = test.withDate(2003, 5, 6);
    DateTime expected = new DateTime(2003, 5, 6, 1, 2, 3, 4, ISO_UTC);
    assertEquals(expected, result);

    test = new DateTime(TEST_TIME1);
    try {
      test.withDate(2003, 13, 1);
      fail();
    } catch (IllegalArgumentException ex) {
    }
  }