use of org.activityinfo.server.util.date.DateUtilCalendarImpl 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());
}
use of org.activityinfo.server.util.date.DateUtilCalendarImpl in project activityinfo by bedatadriven.
the class PivotSitesHandlerTest method testMonths.
@Test
public void testMonths() {
forTotalSiteCounts();
dimensions.add(new DateDimension(DateUnit.MONTH));
filter.setDateRange(new DateUtilCalendarImpl().yearRange(2009));
execute();
assertThat().thereAre(3).buckets();
}
use of org.activityinfo.server.util.date.DateUtilCalendarImpl in project activityinfo by bedatadriven.
the class PivotSitesHandlerLocalTest method testMonths.
@Test(expected = RuntimeException.class)
public void testMonths() {
forTotalSiteCounts();
dimensions.add(new DateDimension(DateUnit.MONTH));
filter.setDateRange(new DateUtilCalendarImpl().yearRange(2009));
execute();
assertThat().thereAre(3).buckets();
}
Aggregations