use of org.activityinfo.server.database.hibernate.entity.ReportSubscription in project activityinfo by bedatadriven.
the class ReportMailerTest method testLastDayOfMonth.
@Test
public void testLastDayOfMonth() {
ReportSubscription report = new ReportSubscription();
report.setEmailDelivery(EmailDelivery.MONTHLY);
report.setEmailDay(Report.LAST_DAY_OF_MONTH);
Calendar cal = Calendar.getInstance();
cal.set(Calendar.YEAR, 2009);
cal.set(Calendar.MONTH, Calendar.APRIL);
cal.set(Calendar.DATE, 30);
Assert.assertTrue("Report goes out on 4-April", ReportMailerHelper.mailToday(cal.getTime(), report));
cal.set(Calendar.MONTH, Calendar.JANUARY);
cal.set(Calendar.DATE, 31);
Assert.assertTrue("Report goes out on 31-Jan", ReportMailerHelper.mailToday(cal.getTime(), report));
}
Aggregations