use of org.joda.time.MutablePeriod in project joda-time by JodaOrg.
the class TestReadablePeriodConverter method testSetInto_Object.
public void testSetInto_Object() throws Exception {
MutablePeriod m = new MutablePeriod(PeriodType.yearMonthDayTime());
ReadablePeriodConverter.INSTANCE.setInto(m, new Period(0, 0, 0, 3, 0, 4, 0, 5), null);
assertEquals(0, m.getYears());
assertEquals(0, m.getMonths());
assertEquals(0, m.getWeeks());
assertEquals(3, m.getDays());
assertEquals(0, m.getHours());
assertEquals(4, m.getMinutes());
assertEquals(0, m.getSeconds());
assertEquals(5, m.getMillis());
}
use of org.joda.time.MutablePeriod in project joda-time by JodaOrg.
the class TestStringConverter method testSetIntoPeriod_Object5.
public void testSetIntoPeriod_Object5() throws Exception {
MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M56.S", null);
assertEquals(2, m.getYears());
assertEquals(4, m.getWeeks());
assertEquals(3, m.getDays());
assertEquals(12, m.getHours());
assertEquals(24, m.getMinutes());
assertEquals(56, m.getSeconds());
assertEquals(0, m.getMillis());
}
use of org.joda.time.MutablePeriod in project joda-time by JodaOrg.
the class TestNullConverter method testSetInto_Object.
public void testSetInto_Object() throws Exception {
MutablePeriod m = new MutablePeriod(PeriodType.millis());
NullConverter.INSTANCE.setInto(m, null, null);
assertEquals(0L, m.getMillis());
}
use of org.joda.time.MutablePeriod in project joda-time by JodaOrg.
the class TestStringConverter method testSetIntoPeriod_Object7.
public void testSetIntoPeriod_Object7() throws Exception {
MutablePeriod m = new MutablePeriod(1, 0, 1, 1, 1, 1, 1, 1, PeriodType.yearWeekDayTime());
StringConverter.INSTANCE.setInto(m, "P2Y4W3D", null);
assertEquals(2, m.getYears());
assertEquals(4, m.getWeeks());
assertEquals(3, m.getDays());
assertEquals(0, m.getHours());
assertEquals(0, m.getMinutes());
assertEquals(0, m.getSeconds());
assertEquals(0, m.getMillis());
}
use of org.joda.time.MutablePeriod in project joda-time by JodaOrg.
the class TestStringConverter method testSetIntoPeriod_Object2.
public void testSetIntoPeriod_Object2() throws Exception {
MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M48S", null);
assertEquals(2, m.getYears());
assertEquals(4, m.getWeeks());
assertEquals(3, m.getDays());
assertEquals(12, m.getHours());
assertEquals(24, m.getMinutes());
assertEquals(48, m.getSeconds());
assertEquals(0, m.getMillis());
}
Aggregations