Search in sources :

Example 6 with DispatcherSync

use of org.activityinfo.server.command.DispatcherSync 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

DispatcherSync (org.activityinfo.server.command.DispatcherSync)6 Test (org.junit.Test)5 PivotSites (org.activityinfo.legacy.shared.command.PivotSites)3 SiteResult (org.activityinfo.legacy.shared.command.result.SiteResult)3 Dimension (org.activityinfo.legacy.shared.reports.model.Dimension)3 User (org.activityinfo.server.database.hibernate.entity.User)3 ArrayList (java.util.ArrayList)2 Filter (org.activityinfo.legacy.shared.command.Filter)2 Bucket (org.activityinfo.legacy.shared.command.result.Bucket)2 AdminDimension (org.activityinfo.legacy.shared.reports.model.AdminDimension)2 PivotTableReportElement (org.activityinfo.legacy.shared.reports.model.PivotTableReportElement)2 GetBaseMaps (org.activityinfo.legacy.shared.command.GetBaseMaps)1 GetDimensionLabels (org.activityinfo.legacy.shared.command.GetDimensionLabels)1 BaseMapResult (org.activityinfo.legacy.shared.command.result.BaseMapResult)1 SiteDTO (org.activityinfo.legacy.shared.model.SiteDTO)1 TileBaseMap (org.activityinfo.legacy.shared.model.TileBaseMap)1 MapContent (org.activityinfo.legacy.shared.reports.content.MapContent)1 PivotTableData (org.activityinfo.legacy.shared.reports.content.PivotTableData)1 DateRange (org.activityinfo.legacy.shared.reports.model.DateRange)1 MapReportElement (org.activityinfo.legacy.shared.reports.model.MapReportElement)1