use of org.mifos.domain.builders.HolidayBuilder in project head by mifos.
the class HolidayAndWorkingDaysAndMoratoriaScheduledDateGenerationTest method biMonthlyByDayScheduleSecondDateInNextWorkingDayHolidayShouldShiftSecondDateToNextWorkingDay.
@Test
public void biMonthlyByDayScheduleSecondDateInNextWorkingDayHolidayShouldShiftSecondDateToNextWorkingDay() {
Holiday twoWeekNextWorkingDayHoliday = new HolidayBuilder().from(date(2011, 7, 4)).to(date(2011, 7, 17)).withNextWorkingDayRule().build();
validateDates(new ScheduleBuilder().withHolidays(twoWeekNextWorkingDayHoliday).withDayOfMonthEvent(2, 6).withStartDate(date(2011, 5, 6)).withNumberOfDates(3).build(), date(2011, 6, 6), date(2011, 8, 8), date(2011, 10, 6));
}
use of org.mifos.domain.builders.HolidayBuilder in project head by mifos.
the class HolidayAndWorkingDaysAndMoratoriaScheduledDateGenerationTest method weeklyScheduledEventWithMoratoriumImmediatelyFollowingNextWorkingDayHoliday.
@Test
public void weeklyScheduledEventWithMoratoriumImmediatelyFollowingNextWorkingDayHoliday() {
Holiday twoWeekNextWorkingDayHoliday = new HolidayBuilder().from(mon_2011_06_27).to(mon_2011_06_27.plusWeeks(2).minusDays(1)).withNextWorkingDayRule().build();
Holiday twoWeekMoratorium = new HolidayBuilder().from(mon_2011_06_27.plusWeeks(2)).to(mon_2011_06_27.plusWeeks(4).minusDays(1)).withRepaymentMoratoriumRule().build();
/*
* Schedule should start on the next Wednesday (2 days from the starting point).
* The second and third unadjusted dates, being in the next-working-day holiday shift to the
* first Monday after the holiday and moratorium. Because the fourth unadjusted date is in the moratorium,
* it and the remaining schedule are shifted two more weeks past the moratorium.
*/
validateDates(new ScheduleBuilder().withHolidays(twoWeekNextWorkingDayHoliday, twoWeekMoratorium).withWeeklyEvent(1, DayOfWeek.wednesday()).withNumberOfDates(6).withStartDate(mon_2011_06_20).build(), wed_2011_06_22, wed_2011_06_22.plusWeeks(5).withDayOfWeek(DayOfWeek.monday()), wed_2011_06_22.plusWeeks(5).withDayOfWeek(DayOfWeek.monday()), wed_2011_06_22.plusWeeks(5), wed_2011_06_22.plusWeeks(6), wed_2011_06_22.plusWeeks(7));
}
use of org.mifos.domain.builders.HolidayBuilder in project head by mifos.
the class HolidayAndWorkingDaysAndMoratoriaScheduledDateGenerationTest method weeklyScheduledEventWithSecondThirdFourthDateInThreeWeekSameDayHolidayExpectNoAdjustment.
@Test
public void weeklyScheduledEventWithSecondThirdFourthDateInThreeWeekSameDayHolidayExpectNoAdjustment() {
Holiday threeWeekSameDay = new HolidayBuilder().from(mon_2011_07_04).to(mon_2011_07_04.plusWeeks(3)).withSameDayAsRule().build();
validateDates(new ScheduleBuilder().withHolidays(threeWeekSameDay).withWeeklyEvent(1, wed_2011_06_29.getDayOfWeek()).withStartDate(wed_2011_06_29.minusDays(1)).withNumberOfDates(5).build(), wed_2011_06_29, wed_2011_06_29.plusWeeks(1), wed_2011_06_29.plusWeeks(2), wed_2011_06_29.plusWeeks(3), wed_2011_06_29.plusWeeks(4));
}
use of org.mifos.domain.builders.HolidayBuilder in project head by mifos.
the class HolidayAndWorkingDaysAndMoratoriaScheduledDateGenerationTest method biMonthlyByDayScheduleSecondDateInNextMeetingHolidayShouldShiftSecondDateByOneMonth.
@Test
public void biMonthlyByDayScheduleSecondDateInNextMeetingHolidayShouldShiftSecondDateByOneMonth() {
Holiday twoWeekNextWorkingDayHoliday = new HolidayBuilder().from(date(2011, 7, 4)).to(date(2011, 7, 17)).withNextMeetingRule().build();
validateDates(new ScheduleBuilder().withHolidays(twoWeekNextWorkingDayHoliday).withDayOfMonthEvent(2, 6).withStartDate(date(2011, 5, 6)).withNumberOfDates(3).build(), date(2011, 6, 6), date(2011, 8, 8), date(2011, 10, 6));
}
use of org.mifos.domain.builders.HolidayBuilder in project head by mifos.
the class HolidayAndWorkingDaysAndMoratoriaScheduledDateGenerationTest method biWeeklyScheduleSecondDateInNextMeetingHolidayShouldShiftSecondDateByTwoWeeks.
@Test
public void biWeeklyScheduleSecondDateInNextMeetingHolidayShouldShiftSecondDateByTwoWeeks() {
Holiday twoWeekNextWorkingDayHoliday = new HolidayBuilder().from(date(2011, 7, 11)).to(date(2011, 7, 17)).withNextMeetingRule().build();
validateDates(new ScheduleBuilder().withHolidays(twoWeekNextWorkingDayHoliday).withWeeklyEvent(2, DateTimeConstants.MONDAY).withStartDate(date(2011, 6, 27)).withNumberOfDates(3).build(), date(2011, 7, 4), date(2011, 7, 18), date(2011, 8, 1));
}
Aggregations