assertEquals("2008-03-01", JodaConvert.serializeLocalDate(new LocalDate(2008, 3, 1)));
}
public void testDeserializeZonedDateMidnight() throws JiBXException {
assertNull("Null input", JodaConvert.deserializeZonedDateMidnight(null));
DateMidnight date = JodaConvert.deserializeZonedDateMidnight("2008-02-28");
DateTimeZone zone = date.getZone();
assertEquals(OFFSET_MILLIS, zone.getOffset(date));
assertEquals("Wrong value", 2008, date.getYear());
assertEquals("Wrong value", 2, date.getMonthOfYear());
assertEquals("Wrong value", 28, date.getDayOfMonth());
assertEquals("Wrong value", 0, date.getHourOfDay());
assertEquals("Wrong value", 0, date.getMinuteOfHour());
assertEquals("Wrong value", 0, date.getSecondOfMinute());
date = JodaConvert.deserializeZonedDateMidnight("2008-02-29Z");
zone = date.getZone();
assertEquals(0, zone.getOffset(date));
assertEquals("Wrong value", 2008, date.getYear());
assertEquals("Wrong value", 2, date.getMonthOfYear());
assertEquals("Wrong value", 29, date.getDayOfMonth());
assertEquals("Wrong value", 0, date.getHourOfDay());
assertEquals("Wrong value", 0, date.getMinuteOfHour());
assertEquals("Wrong value", 0, date.getSecondOfMinute());
date = JodaConvert.deserializeZonedDateMidnight("2008-02-29-12:30");
zone = date.getZone();
assertEquals("Expected -12:30 timezone", -750*60*1000, zone.getOffset(date));
assertEquals("Wrong value", 2008, date.getYear());
assertEquals("Wrong value", 2, date.getMonthOfYear());
assertEquals("Wrong value", 29, date.getDayOfMonth());
assertEquals("Wrong value", 0, date.getHourOfDay());
assertEquals("Wrong value", 0, date.getMinuteOfHour());
assertEquals("Wrong value", 0, date.getSecondOfMinute());
try {
JodaConvert.deserializeZonedDateMidnight("2007-02-29");
fail("Invalid day number");
} catch (JiBXException ex) {}
try {