Search in sources :

Example 26 with Dimension

use of org.activityinfo.legacy.shared.reports.model.Dimension in project activityinfo by bedatadriven.

the class EmptyChartsTest method generate.

@Test
public void generate() {
    PivotChartReportElement element = new PivotChartReportElement(Type.StackedBar);
    element.setIndicator(1);
    element.addCategoryDimension(new Dimension(DimensionType.Partner));
    element.addSeriesDimension(new Dimension(DimensionType.Database));
    DispatcherSync dispatcher = createMock(DispatcherSync.class);
    expect(dispatcher.execute(isA(PivotSites.class))).andReturn(new PivotSites.PivotResult(Collections.EMPTY_LIST));
    expect(dispatcher.execute(isA(GetDimensionLabels.class))).andReturn(new GetDimensionLabels.DimensionLabels(Collections.EMPTY_MAP));
    replay(dispatcher);
    IndicatorDAO indicatorDAO = createMock(IndicatorDAO.class);
    expect(indicatorDAO.findById(eq(1))).andReturn(new Indicator());
    replay(indicatorDAO);
    PivotChartGenerator generator = new PivotChartGenerator(dispatcher, indicatorDAO);
    generator.generate(new User(), element, new Filter(), new DateRange());
}
Also used : IndicatorDAO(org.activityinfo.server.database.hibernate.dao.IndicatorDAO) GetDimensionLabels(org.activityinfo.legacy.shared.command.GetDimensionLabels) User(org.activityinfo.server.database.hibernate.entity.User) Dimension(org.activityinfo.legacy.shared.reports.model.Dimension) Indicator(org.activityinfo.server.database.hibernate.entity.Indicator) PivotSites(org.activityinfo.legacy.shared.command.PivotSites) DateRange(org.activityinfo.legacy.shared.reports.model.DateRange) Filter(org.activityinfo.legacy.shared.command.Filter) PivotChartGenerator(org.activityinfo.server.report.generator.PivotChartGenerator) PivotChartReportElement(org.activityinfo.legacy.shared.reports.model.PivotChartReportElement) DispatcherSync(org.activityinfo.server.command.DispatcherSync) Test(org.junit.Test)

Aggregations

Dimension (org.activityinfo.legacy.shared.reports.model.Dimension)26 AttributeGroupDimension (org.activityinfo.legacy.shared.reports.model.AttributeGroupDimension)11 AdminDimension (org.activityinfo.legacy.shared.reports.model.AdminDimension)10 DateDimension (org.activityinfo.legacy.shared.reports.model.DateDimension)9 Bucket (org.activityinfo.legacy.shared.command.result.Bucket)7 Test (org.junit.Test)7 PivotSites (org.activityinfo.legacy.shared.command.PivotSites)6 PivotTableReportElement (org.activityinfo.legacy.shared.reports.model.PivotTableReportElement)5 ArrayList (java.util.ArrayList)3 Filter (org.activityinfo.legacy.shared.command.Filter)3 DimensionCategory (org.activityinfo.legacy.shared.reports.content.DimensionCategory)3 EntityCategory (org.activityinfo.legacy.shared.reports.content.EntityCategory)3 PivotTableData (org.activityinfo.legacy.shared.reports.content.PivotTableData)3 DispatcherSync (org.activityinfo.server.command.DispatcherSync)3 User (org.activityinfo.server.database.hibernate.entity.User)3 SqlResultCallback (com.bedatadriven.rebar.sql.client.SqlResultCallback)2 SqlResultSet (com.bedatadriven.rebar.sql.client.SqlResultSet)2 SqlResultSetRow (com.bedatadriven.rebar.sql.client.SqlResultSetRow)2 SqlTransaction (com.bedatadriven.rebar.sql.client.SqlTransaction)2 SiteResult (org.activityinfo.legacy.shared.command.result.SiteResult)2