assertFalse(info.isValidEvent());
}
public void testIsValidEvent_MoveStart_6() {
Calendar requiredMonth = this.getRequiredMonth(1998, Calendar.MAY);
DateEventInfo info = this.getDateEventInfoForTest(requiredMonth);
Calendar startEvent = Calendar.getInstance();
startEvent.set(Calendar.YEAR, 1999);
startEvent.set(Calendar.MONTH, Calendar.JANUARY);
startEvent.set(Calendar.DAY_OF_MONTH, 12);
info.setStart(startEvent.getTime());
Calendar endEvent = Calendar.getInstance();
endEvent.set(Calendar.YEAR, 1999);
endEvent.set(Calendar.MONTH, Calendar.FEBRUARY);
endEvent.set(Calendar.DAY_OF_MONTH, 12);
info.setEnd(endEvent.getTime());
assertFalse(info.isValidEvent());
startEvent.set(Calendar.YEAR, 1998);
startEvent.set(Calendar.MONTH, Calendar.JUNE);
startEvent.set(Calendar.DAY_OF_MONTH, 1);
info.setStart(startEvent.getTime());
assertFalse(info.isValidEvent());
startEvent.set(Calendar.YEAR, 1998);
startEvent.set(Calendar.MONTH, Calendar.MAY);
startEvent.set(Calendar.DAY_OF_MONTH, startEvent.getActualMaximum(Calendar.DAY_OF_MONTH));
info.setStart(startEvent.getTime());
assertTrue(info.isValidEvent());
assertEquals(requiredMonth.getActualMaximum(Calendar.DAY_OF_MONTH), info.getStartDay());
assertEquals(requiredMonth.getActualMaximum(Calendar.DAY_OF_MONTH), info.getEndDay());
startEvent.set(Calendar.YEAR, 1998);
startEvent.set(Calendar.MONTH, Calendar.MAY);
startEvent.set(Calendar.DAY_OF_MONTH, 12);
info.setStart(startEvent.getTime());
assertTrue(info.isValidEvent());
assertEquals(12, info.getStartDay());
assertEquals(requiredMonth.getActualMaximum(Calendar.DAY_OF_MONTH), info.getEndDay());
startEvent.set(Calendar.YEAR, 1998);
startEvent.set(Calendar.MONTH, Calendar.MAY);
startEvent.set(Calendar.DAY_OF_MONTH, 1);
info.setStart(startEvent.getTime());
assertTrue(info.isValidEvent());
assertEquals(1, info.getStartDay());
assertEquals(requiredMonth.getActualMaximum(Calendar.DAY_OF_MONTH), info.getEndDay());
startEvent.set(Calendar.YEAR, 1998);
startEvent.set(Calendar.MONTH, Calendar.APRIL);
startEvent.set(Calendar.DAY_OF_MONTH, startEvent.getActualMaximum(Calendar.DAY_OF_MONTH));
info.setStart(startEvent.getTime());
assertTrue(info.isValidEvent());
assertEquals(1, info.getStartDay());
assertEquals(requiredMonth.getActualMaximum(Calendar.DAY_OF_MONTH), info.getEndDay());
startEvent.set(Calendar.YEAR, 1997);
startEvent.set(Calendar.MONTH, Calendar.SEPTEMBER);
startEvent.set(Calendar.DAY_OF_MONTH, 23);
info.setStart(startEvent.getTime());
assertTrue(info.isValidEvent());
assertEquals(1, info.getStartDay());
assertEquals(requiredMonth.getActualMaximum(Calendar.DAY_OF_MONTH), info.getEndDay());
}