Java Code Examples for org.joda.time.PeriodType#yearWeekDayTime()

The following examples show how to use org.joda.time.PeriodType#yearWeekDayTime() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
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());
}
 
Example 2
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public void testSetIntoPeriod_Object3() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M48.034S", 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(34, m.getMillis());
}
 
Example 3
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public void testSetIntoPeriod_Object4() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M.056S", null);
    assertEquals(2, m.getYears());
    assertEquals(4, m.getWeeks());
    assertEquals(3, m.getDays());
    assertEquals(12, m.getHours());
    assertEquals(24, m.getMinutes());
    assertEquals(0, m.getSeconds());
    assertEquals(56, m.getMillis());
}
 
Example 4
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
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());
}
 
Example 5
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public void testSetIntoPeriod_Object6() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M56.1234567S", 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(123, m.getMillis());
}
 
Example 6
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
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());
}
 
Example 7
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
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());
}
 
Example 8
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public void testSetIntoPeriod_Object3() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M48.034S", 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(34, m.getMillis());
}
 
Example 9
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public void testSetIntoPeriod_Object4() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M.056S", null);
    assertEquals(2, m.getYears());
    assertEquals(4, m.getWeeks());
    assertEquals(3, m.getDays());
    assertEquals(12, m.getHours());
    assertEquals(24, m.getMinutes());
    assertEquals(0, m.getSeconds());
    assertEquals(56, m.getMillis());
}
 
Example 10
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
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());
}
 
Example 11
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
public void testSetIntoPeriod_Object6() throws Exception {
    MutablePeriod m = new MutablePeriod(PeriodType.yearWeekDayTime());
    StringConverter.INSTANCE.setInto(m, "P2Y4W3DT12H24M56.1234567S", 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(123, m.getMillis());
}
 
Example 12
Source File: TestStringConverter.java    From astor with GNU General Public License v2.0 5 votes vote down vote up
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());
}