use of org.activityinfo.legacy.shared.reports.util.DateUtil in project activityinfo by bedatadriven.
the class ReportGeneratorTest method testFileName.
@Test
public void testFileName() {
// Input user
User user = new User();
user.setLocale("en");
// Input test data: report model + parameter
Report report = new Report();
report.setFileName("Report ${DATE_RANGE} of Activities");
// Input test data: parameter values
DateUtil dateUtil = new DateUtilCalendarImpl();
DateRange dateRange = dateUtil.monthRange(2009, 1);
// class under test
ReportGenerator generator = new ReportGenerator(null, null, null, null, null);
generator.generate(user, report, null, dateRange);
// VERIFY correct file name
Assert.assertEquals("Report Jan 2009 of Activities", report.getContent().getFileName());
}
Aggregations