} catch (JiBXException ex) {}
}
public void testDeserializeUTCDateTime() throws JiBXException {
assertNull("Null input", JodaConvert.deserializeUTCDateTime(null));
DateTime time = JodaConvert.deserializeUTCDateTime("2008-02-28T01:02:03");
DateTimeZone zone = time.getZone();
assertEquals("UTC timezone expected", "UTC", zone.getID());
assertEquals("Wrong value", 2008, time.getYear());
assertEquals("Wrong value", 2, time.getMonthOfYear());
assertEquals("Wrong value", 28, time.getDayOfMonth());
assertEquals("Wrong value", 1, time.getHourOfDay());
assertEquals("Wrong value", 2, time.getMinuteOfHour());
assertEquals("Wrong value", 3, time.getSecondOfMinute());
time = JodaConvert.deserializeUTCDateTime("2008-02-28T01:02:03Z");
zone = time.getZone();
assertEquals("UTC timezone expected", "UTC", zone.getID());
assertEquals("Wrong value", 2008, time.getYear());
assertEquals("Wrong value", 2, time.getMonthOfYear());
assertEquals("Wrong value", 28, time.getDayOfMonth());
assertEquals("Wrong value", 1, time.getHourOfDay());
assertEquals("Wrong value", 2, time.getMinuteOfHour());
assertEquals("Wrong value", 3, time.getSecondOfMinute());
time = JodaConvert.deserializeUTCDateTime("2008-02-29T02:05:06.123-02:00");
assertEquals("Wrong value", 2008, time.getYear());
assertEquals("Wrong value", 2, time.getMonthOfYear());
assertEquals("Wrong value", 29, time.getDayOfMonth());
assertEquals("Wrong value", 4, time.getHourOfDay());
assertEquals("Wrong value", 5, time.getMinuteOfHour());
assertEquals("Wrong value", 6, time.getSecondOfMinute());
assertEquals("Wrong value", 123, time.getMillisOfSecond());
try {
JodaConvert.deserializeUTCDateTime("2007-02-29T02:05:06.123-02:00");
fail("Invalid day number");
} catch (JiBXException ex) {}
try {