exerciseHoliday(h[1], Locale.getDefault());
}
public void TestIsOn() {
// jb 1901
SimpleHoliday sh = new SimpleHoliday(Calendar.AUGUST, 15, "Doug's Day", 1958, 2058);
Calendar gcal = new GregorianCalendar();
gcal.clear();
gcal.set(Calendar.YEAR, 2000);
gcal.set(Calendar.MONTH, Calendar.AUGUST);
gcal.set(Calendar.DAY_OF_MONTH, 15);
Date d0 = gcal.getTime();
gcal.add(Calendar.SECOND, 1);
Date d1 = gcal.getTime();
gcal.add(Calendar.SECOND, -2);
Date d2 = gcal.getTime();
gcal.add(Calendar.DAY_OF_MONTH, 1);
Date d3 = gcal.getTime();
gcal.add(Calendar.SECOND, 1);
Date d4 = gcal.getTime();
gcal.add(Calendar.SECOND, -2);
gcal.set(Calendar.YEAR, 1957);
Date d5 = gcal.getTime();
gcal.set(Calendar.YEAR, 1958);
Date d6 = gcal.getTime();
gcal.set(Calendar.YEAR, 2058);
Date d7 = gcal.getTime();
gcal.set(Calendar.YEAR, 2059);
Date d8 = gcal.getTime();
Date[] dates = { d0, d1, d2, d3, d4, d5, d6, d7, d8 };
boolean[] isOns = { true, true, false, true, false, false, true, true, false };
for (int i = 0; i < dates.length; ++i) {
Date d = dates[i];
logln("\ndate: " + d);
boolean isOn = sh.isOn(d);
logln("isOnDate: " + isOn);
if (isOn != isOns[i]) {
errln("date: " + d + " should be on Doug's Day!");
}
Date h = sh.firstAfter(d);
logln("firstAfter: " + h);
}
}