Ejemplo n.º 1
0
  public void testToMutableDateTime_DateTimeZone() {
    DateTime test = new DateTime(TEST_TIME1);
    MutableDateTime result = test.toMutableDateTime(LONDON);
    assertEquals(test.getMillis(), result.getMillis());
    assertEquals(ISO_DEFAULT, result.getChronology());

    test = new DateTime(TEST_TIME1);
    result = test.toMutableDateTime(PARIS);
    assertEquals(test.getMillis(), result.getMillis());
    assertEquals(ISO_PARIS, result.getChronology());

    test = new DateTime(TEST_TIME1, PARIS);
    result = test.toMutableDateTime((DateTimeZone) null);
    assertEquals(test.getMillis(), result.getMillis());
    assertEquals(ISO_DEFAULT, result.getChronology());

    test = new DateTime(TEST_TIME1);
    result = test.toMutableDateTime((DateTimeZone) null);
    assertEquals(test.getMillis(), result.getMillis());
    assertEquals(ISO_DEFAULT, result.getChronology());
  }
Ejemplo n.º 2
0
  public void testToMutableDateTime_Chronology() {
    DateTime test = new DateTime(TEST_TIME1);
    MutableDateTime result = test.toMutableDateTime(ISO_DEFAULT);
    assertEquals(test.getMillis(), result.getMillis());
    assertEquals(ISO_DEFAULT, result.getChronology());

    test = new DateTime(TEST_TIME1);
    result = test.toMutableDateTime(GREGORIAN_PARIS);
    assertEquals(test.getMillis(), result.getMillis());
    assertEquals(GREGORIAN_PARIS, result.getChronology());

    test = new DateTime(TEST_TIME1, GREGORIAN_PARIS);
    result = test.toMutableDateTime((Chronology) null);
    assertEquals(test.getMillis(), result.getMillis());
    assertEquals(ISO_DEFAULT, result.getChronology());

    test = new DateTime(TEST_TIME1);
    result = test.toMutableDateTime((Chronology) null);
    assertEquals(test.getMillis(), result.getMillis());
    assertEquals(ISO_DEFAULT, result.getChronology());
  }
Ejemplo n.º 3
0
 public void testToMutableDateTime() {
   DateTime test = new DateTime(TEST_TIME1, PARIS);
   MutableDateTime result = test.toMutableDateTime();
   assertEquals(test.getMillis(), result.getMillis());
   assertEquals(ISO_PARIS, result.getChronology());
 }