every0_15_30_Sec_At_9_30_PM.month("Nov-Feb");
every0_15_30_Sec_At_9_30_PM.second("0,15,30");
every0_15_30_Sec_At_9_30_PM.minute(30);
every0_15_30_Sec_At_9_30_PM.hour("21");
CalendarBasedTimeout calendarTimeout = new CalendarBasedTimeout(every0_15_30_Sec_At_9_30_PM);
Calendar firstTimeout = calendarTimeout.getFirstTimeout();
Assert.assertNotNull(timeZoneDisplayName, firstTimeout);
// logger.debug("First timeout is " + firstTimeoutDate);
int minute = firstTimeout.get(Calendar.MINUTE);
int second = firstTimeout.get(Calendar.SECOND);
int hour = firstTimeout.get(Calendar.HOUR_OF_DAY);
int amOrPm = firstTimeout.get(Calendar.AM_PM);
int dayOfMonth = firstTimeout.get(Calendar.DAY_OF_MONTH);
int month = firstTimeout.get(Calendar.MONTH);
Assert.assertEquals(timeZoneDisplayName, 0, second);
Assert.assertEquals(timeZoneDisplayName, 30, minute);
Assert.assertEquals(timeZoneDisplayName, 21, hour);
Assert.assertEquals(timeZoneDisplayName, Calendar.PM, amOrPm);
Assert.assertEquals(timeZoneDisplayName, 31, dayOfMonth);
List<Integer> validMonths = new ArrayList<Integer>();
validMonths.add(Calendar.NOVEMBER);
validMonths.add(Calendar.DECEMBER);
validMonths.add(Calendar.JANUARY);
validMonths.add(Calendar.FEBRUARY);
Assert.assertTrue(timeZoneDisplayName, validMonths.contains(month));
Calendar nextTimeout = calendarTimeout.getNextTimeout(firstTimeout);
long diff = nextTimeout.getTimeInMillis() - firstTimeout.getTimeInMillis();
Assert.assertEquals(timeZoneDisplayName, 15 * 1000, diff);
Calendar date = new GregorianCalendar(2014,3,18);
Calendar nextTimeoutFromNow = calendarTimeout.getNextTimeout(date);
// logger.debug("Next timeout from now is " + nextTimeoutFromNow.getTime());
int nextMinute = nextTimeoutFromNow.get(Calendar.MINUTE);
int nextSecond = nextTimeoutFromNow.get(Calendar.SECOND);
int nextHour = nextTimeoutFromNow.get(Calendar.HOUR_OF_DAY);
int nextAmOrPM = nextTimeoutFromNow.get(Calendar.AM_PM);