use of org.activityinfo.shared.report.model.DateDimension in project activityinfo by bedatadriven.
the class PivotSitesHandlerTest method targetFilter.
@Test
public void targetFilter() {
// Pivoting: PivotSites [dimensions=[Date, Partner, Date, Target,
// Activity, Indicator],
// filter=AdminLevel={ 141801 }, Partner={ 130 },
// Indicator={ 747 746 745 744 749 748 739 738 743 740 119 118 3661 125
// 124 123 122 121 }, valueType=INDICATOR]
withPartnerAsDimension();
dimensions.add(new DateDimension(DateUnit.YEAR));
dimensions.add(new Dimension(DimensionType.Target));
dimensions.add(new Dimension(DimensionType.Activity));
dimensions.add(new Dimension(DimensionType.Indicator));
filter.addRestriction(DimensionType.AdminLevel, 141801);
filter.addRestriction(DimensionType.Partner, 130);
filter.addRestriction(DimensionType.Indicator, 1);
execute();
}
use of org.activityinfo.shared.report.model.DateDimension in project activityinfo by bedatadriven.
the class PivotSitesHandlerTest method testSiteCountOnQuarters.
@Test
public void testSiteCountOnQuarters() {
forTotalSiteCounts();
dimensions.add(new DateDimension(DateUnit.QUARTER));
execute();
assertThat().forQuarter(2008, 4).thereIsOneBucketWithValue(1);
assertThat().forQuarter(2009, 1).thereIsOneBucketWithValue(4);
}
use of org.activityinfo.shared.report.model.DateDimension in project activityinfo by bedatadriven.
the class PivotSitesHandlerTest method testYears.
@Test
public void testYears() {
forTotalSiteCounts();
dimensions.add(new DateDimension(DateUnit.YEAR));
execute();
assertThat().forYear(2008).thereIsOneBucketWithValue(1);
assertThat().forYear(2009).thereIsOneBucketWithValue(4);
}
use of org.activityinfo.shared.report.model.DateDimension in project activityinfo by bedatadriven.
the class PivotSitesHandlerTest method testWeeks.
@Test
@OnDataSet("/dbunit/sites-weeks.db.xml")
public void testWeeks() {
final Dimension weekDim = new DateDimension(DateUnit.WEEK_MON);
dimensions.add(weekDim);
filter.addRestriction(DimensionType.Indicator, 1);
execute();
assertEquals(3, buckets.size());
assertEquals(3600, (int) findBucketByWeek(buckets, 2011, 52).doubleValue());
assertEquals(1500, (int) findBucketByWeek(buckets, 2012, 1).doubleValue());
assertEquals(4142, (int) findBucketByWeek(buckets, 2012, 13).doubleValue());
}
use of org.activityinfo.shared.report.model.DateDimension in project activityinfo by bedatadriven.
the class PivotSitesHandlerTest method testQuarters.
@Test
@OnDataSet("/dbunit/sites-quarters.db.xml")
public void testQuarters() {
final Dimension quarterDim = new DateDimension(DateUnit.QUARTER);
dimensions.add(quarterDim);
filter.addRestriction(DimensionType.Indicator, 1);
execute();
assertEquals(3, buckets.size());
assertEquals(1500, (int) findBucketByQuarter(buckets, 2009, 1).doubleValue());
assertEquals(3600, (int) findBucketByQuarter(buckets, 2009, 2).doubleValue());
assertEquals(10000, (int) findBucketByQuarter(buckets, 2008, 4).doubleValue());
}
Aggregations