use of org.mifos.application.meeting.struts.actionforms.MeetingActionForm in project head by mifos.
the class MeetingActionStrutsTest method testLoad_MonthlyOnWeekMeetingExists.
@Test
public void testLoad_MonthlyOnWeekMeetingExists() throws Exception {
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("officeId", "3");
actionPerform();
Short recurAfter = Short.valueOf("2");
MeetingBO meeting = createMonthlyMeetingOnWeekDay(WeekDay.FRIDAY, RankOfDay.SECOND, recurAfter, new Date());
SessionUtils.setAttribute(CustomerConstants.CUSTOMER_MEETING, meeting, request);
setRequestPathInfo("/meetingAction.do");
addRequestParameter("method", "load");
addRequestParameter("customerLevel", CustomerLevel.CENTER.getValue().toString());
addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
addRequestParameter("input", "create");
actionPerform();
verifyForward(ActionForwards.load_success.toString());
Assert.assertNotNull(SessionUtils.getAttribute(MeetingConstants.WEEKDAYSLIST, request));
Assert.assertNotNull(SessionUtils.getAttribute(MeetingConstants.WEEKRANKLIST, request));
verifyNoActionErrors();
verifyNoActionMessages();
MeetingActionForm actionForm = (MeetingActionForm) request.getSession().getAttribute("meetingActionForm");
Assert.assertEquals(CustomerLevel.CENTER, actionForm.getCustomerLevelValue());
Assert.assertEquals("2", actionForm.getMonthType());
Assert.assertEquals(WeekDay.FRIDAY, actionForm.getMonthWeekValue());
Assert.assertEquals(RankOfDay.SECOND, actionForm.getMonthRankValue());
Assert.assertEquals(recurAfter, actionForm.getRecurMonthValue());
Assert.assertEquals(RecurrenceType.MONTHLY, actionForm.getRecurrenceType());
}
use of org.mifos.application.meeting.struts.actionforms.MeetingActionForm in project head by mifos.
the class MeetingActionStrutsTest method testLoad_WeeklyMeetingExists.
@Test
public void testLoad_WeeklyMeetingExists() throws Exception {
setRequestPathInfo("/centerCustAction.do");
addRequestParameter("method", "load");
addRequestParameter("officeId", "3");
actionPerform();
Short recurAfter = Short.valueOf("1");
MeetingBO meeting = createWeeklyMeeting(WeekDay.MONDAY, recurAfter, new Date());
SessionUtils.setAttribute(CustomerConstants.CUSTOMER_MEETING, meeting, request);
setRequestPathInfo("/meetingAction.do");
addRequestParameter("method", "load");
addRequestParameter("customerLevel", CustomerLevel.CENTER.getValue().toString());
addRequestParameter(Constants.CURRENTFLOWKEY, (String) request.getAttribute(Constants.CURRENTFLOWKEY));
addRequestParameter("input", "create");
actionPerform();
verifyForward(ActionForwards.load_success.toString());
Assert.assertNotNull(SessionUtils.getAttribute(MeetingConstants.WEEKDAYSLIST, request));
Assert.assertNotNull(SessionUtils.getAttribute(MeetingConstants.WEEKRANKLIST, request));
verifyNoActionErrors();
verifyNoActionMessages();
MeetingActionForm actionForm = (MeetingActionForm) request.getSession().getAttribute("meetingActionForm");
Assert.assertEquals(CustomerLevel.CENTER, actionForm.getCustomerLevelValue());
Assert.assertEquals(WeekDay.MONDAY, actionForm.getWeekDayValue());
Assert.assertEquals(recurAfter, actionForm.getRecurWeekValue());
Assert.assertEquals(RecurrenceType.WEEKLY, actionForm.getRecurrenceType());
}
Aggregations