use of org.joda.time.MutableInterval in project joda-time by JodaOrg.
the class TestStringConverter method testSetIntoIntervalEx_Object_Chronology5.
public void testSetIntoIntervalEx_Object_Chronology5() throws Exception {
MutableInterval m = new MutableInterval(-1000L, 1000L);
try {
StringConverter.INSTANCE.setInto(m, "P1Y/P2Y", null);
fail();
} catch (IllegalArgumentException ex) {
}
}
use of org.joda.time.MutableInterval in project joda-time by JodaOrg.
the class TestStringConverter method testSetIntoInterval_Object_Chronology6.
public void testSetIntoInterval_Object_Chronology6() throws Exception {
MutableInterval m = new MutableInterval(-1000L, 1000L);
StringConverter.INSTANCE.setInto(m, "2003-08-09T+06:00/2004-06-09T+07:00", null);
assertEquals(new DateTime(2003, 8, 9, 0, 0, 0, 0, SIX).withChronology(null), m.getStart());
assertEquals(new DateTime(2004, 6, 9, 0, 0, 0, 0, SEVEN).withChronology(null), m.getEnd());
assertEquals(ISOChronology.getInstance(), m.getChronology());
}
use of org.joda.time.MutableInterval in project joda-time by JodaOrg.
the class TestStringConverter method testSetIntoIntervalEx_Object_Chronology1.
public void testSetIntoIntervalEx_Object_Chronology1() throws Exception {
MutableInterval m = new MutableInterval(-1000L, 1000L);
try {
StringConverter.INSTANCE.setInto(m, "", null);
fail();
} catch (IllegalArgumentException ex) {
}
}
use of org.joda.time.MutableInterval in project joda-time by JodaOrg.
the class TestReadableIntervalConverter method testSetIntoInterval_Object1.
public void testSetIntoInterval_Object1() throws Exception {
Interval i = new Interval(0L, 123L, CopticChronology.getInstance());
MutableInterval m = new MutableInterval(-1000L, 1000L, BuddhistChronology.getInstance());
ReadableIntervalConverter.INSTANCE.setInto(m, i, null);
assertEquals(0L, m.getStartMillis());
assertEquals(123L, m.getEndMillis());
assertEquals(CopticChronology.getInstance(), m.getChronology());
}
use of org.joda.time.MutableInterval in project joda-time by JodaOrg.
the class TestStringConverter method testSetIntoInterval_Object_Chronology3.
public void testSetIntoInterval_Object_Chronology3() throws Exception {
MutableInterval m = new MutableInterval(-1000L, 1000L);
StringConverter.INSTANCE.setInto(m, "2003-08-09/2004-06-09", null);
assertEquals(new DateTime(2003, 8, 9, 0, 0, 0, 0), m.getStart());
assertEquals(new DateTime(2004, 6, 9, 0, 0, 0, 0), m.getEnd());
assertEquals(ISOChronology.getInstance(), m.getChronology());
}
Aggregations