use of org.activityinfo.shared.report.model.DateRange in project activityinfo by bedatadriven.
the class DateUtilCalendarImplTest method lastCompleteMonth.
@Test
public void lastCompleteMonth() {
Calendar fifth = Calendar.getInstance();
fifth.set(2011, Calendar.MAY, 5);
DateRange range = util.lastCompleteMonthRange(fifth.getTime());
assertThat(range.getMinDate().getDate(), equalTo(1));
assertThat(range.getMaxDate().getDate(), equalTo(30));
}
use of org.activityinfo.shared.report.model.DateRange in project activityinfo by bedatadriven.
the class PivotSitesHandlerTest method testTargetPivot.
@Test
@OnDataSet("/dbunit/sites-simple-target.db.xml")
public void testTargetPivot() {
withIndicatorAsDimension();
dimensions.add(new DateDimension(DateUnit.YEAR));
dimensions.add(new Dimension(DimensionType.Target));
filter.addRestriction(DimensionType.Indicator, 1);
filter.setDateRange(new DateRange(new LocalDate(2008, 1, 1), new LocalDate(2008, 12, 31)));
execute();
assertThat().thereAre(2).buckets();
}
Aggregations