Search in sources :

Example 16 with Bucket

use of org.activityinfo.shared.command.result.Bucket in project activityinfo by bedatadriven.

the class PivotSitesHandlerLocalTest method testIndicatorOrder.

@Test
public void testIndicatorOrder() {
    withIndicatorAsDimension();
    filter.addRestriction(DimensionType.Indicator, 1);
    filter.addRestriction(DimensionType.Indicator, 2);
    execute();
    assertEquals(2, buckets.size());
    Bucket indicator1 = findBucketsByCategory(buckets, indicatorDim, new EntityCategory(1)).get(0);
    Bucket indicator2 = findBucketsByCategory(buckets, indicatorDim, new EntityCategory(2)).get(0);
    EntityCategory cat1 = (EntityCategory) indicator1.getCategory(indicatorDim);
    EntityCategory cat2 = (EntityCategory) indicator2.getCategory(indicatorDim);
    assertEquals(2, cat1.getSortOrder().intValue());
    assertEquals(OWNER_USER_ID, cat2.getSortOrder().intValue());
}
Also used : Bucket(org.activityinfo.shared.command.result.Bucket) EntityCategory(org.activityinfo.shared.report.content.EntityCategory) Test(org.junit.Test)

Aggregations

Bucket (org.activityinfo.shared.command.result.Bucket)16 Dimension (org.activityinfo.shared.report.model.Dimension)11 EntityCategory (org.activityinfo.shared.report.content.EntityCategory)9 AdminDimension (org.activityinfo.shared.report.model.AdminDimension)9 Test (org.junit.Test)8 AttributeGroupDimension (org.activityinfo.shared.report.model.AttributeGroupDimension)6 DateDimension (org.activityinfo.shared.report.model.DateDimension)6 PivotSites (org.activityinfo.shared.command.PivotSites)5 ArrayList (java.util.ArrayList)4 OnDataSet (org.activityinfo.server.database.OnDataSet)4 Comparator (java.util.Comparator)3 List (java.util.List)2 DispatcherSync (org.activityinfo.server.command.DispatcherSync)2 User (org.activityinfo.server.database.hibernate.entity.User)2 CommandException (org.activityinfo.shared.exception.CommandException)2 PivotTableData (org.activityinfo.shared.report.content.PivotTableData)2 PivotTableReportElement (org.activityinfo.shared.report.model.PivotTableReportElement)2 SqlResultCallback (com.bedatadriven.rebar.sql.client.SqlResultCallback)1 SqlResultSet (com.bedatadriven.rebar.sql.client.SqlResultSet)1 SqlResultSetRow (com.bedatadriven.rebar.sql.client.SqlResultSetRow)1