示例#1
0
 public void testToMutableDateTimeISO() {
   DateTime test = new DateTime(TEST_TIME1, PARIS);
   MutableDateTime result = test.toMutableDateTimeISO();
   assertSame(MutableDateTime.class, result.getClass());
   assertSame(ISOChronology.class, result.getChronology().getClass());
   assertEquals(test.getMillis(), result.getMillis());
   assertEquals(ISO_PARIS, result.getChronology());
 }
示例#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());
  }
示例#3
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());
  }
示例#4
0
 /**
  * Gets the chronology of the datetime that this property is linked to.
  *
  * @return the chronology
  * @since 1.4
  */
 protected Chronology getChronology() {
   return iInstant.getChronology();
 }