/*
* 2008-12-29 is written "2009-W01-1"
*
*/
public void testDec_29_2008() {
Iso8601Date d1 = new Iso8601Date(DateConfiguration.YEAR_WEEK_DAY,
2009, 1, 1);
assertEquals(d1.getYear(), 2008);
assertEquals(d1.getWeekCalendarYear(), 2009);
assertEquals(d1.getWeekOfYear(), 1);
assertEquals(d1.getDayOfWeek(), 1);
assertEquals(d1.getMonth(), 12);
assertEquals(d1.getDayOfMonth(), 29);
assertEquals(d1.getDayOfYear(), 364);
GregorianCalendar c1 = d1.getCalendarForDay();
assertNotNull(c1);
assertEquals(c1.get(Calendar.YEAR), 2008);
assertEquals(c1.get(Calendar.MONTH), 11);
assertEquals(c1.get(Calendar.DAY_OF_MONTH), 29);
assertEquals(c1.get(Calendar.WEEK_OF_YEAR), 1);
assertEquals(Iso8601Date.convertCalendarDayOfWeekToIso(
c1.get(Calendar.DAY_OF_WEEK)), 1);
assertEquals(c1.get(Calendar.DAY_OF_YEAR), 364);
Iso8601Date d2 = new Iso8601Date(DateConfiguration.YEAR_MONTH_DAY,
2008, 12, 29);
assertEquals(d2.getCentury(), 20);
assertEquals(d2.getYear(), 2008);
assertEquals(d2.getMonth(), 12);
assertEquals(d2.getDayOfMonth(), 29);
assertEquals(d2.getDayOfYear(), 364);
assertEquals(d2.getWeekOfYear(), 1);
assertEquals(d2.getDayOfWeek(), 1);
GregorianCalendar c2 = d1.getCalendarForDay();
assertNotNull(c2);
assertEquals(c2.get(Calendar.YEAR), 2008);
assertEquals(c2.get(Calendar.MONTH), 11);
assertEquals(c2.get(Calendar.DAY_OF_MONTH), 29);