Search in sources :

Example 6 with TableElement

use of org.activityinfo.shared.report.model.TableElement in project activityinfo by bedatadriven.

the class TableGeneratorTest method simpleTable.

@Test
public void simpleTable() {
    TableElement table = new TableElement();
    TableColumn column = new TableColumn("Location", "location.name");
    table.addColumn(column);
    TableGenerator gtor = new TableGenerator(createDispatcher(), null);
    gtor.generate(user, table, null, null);
    Assert.assertNotNull("content is set", table.getContent());
    TableData data = table.getContent().getData();
    List<SiteDTO> rows = data.getRows();
    Assert.assertEquals("row count", 1, rows.size());
    SiteDTO row = rows.get(0);
    assertThat((String) row.get(column.getSitePropertyName()), equalTo("tampa bay"));
}
Also used : SiteDTO(org.activityinfo.shared.dto.SiteDTO) TableData(org.activityinfo.shared.report.content.TableData) TableColumn(org.activityinfo.shared.report.model.TableColumn) TableElement(org.activityinfo.shared.report.model.TableElement) Test(org.junit.Test)

Aggregations

TableElement (org.activityinfo.shared.report.model.TableElement)6 Test (org.junit.Test)5 Report (org.activityinfo.shared.report.model.Report)4 MapReportElement (org.activityinfo.shared.report.model.MapReportElement)3 SiteDTO (org.activityinfo.shared.dto.SiteDTO)2 PivotChartReportElement (org.activityinfo.shared.report.model.PivotChartReportElement)2 PivotTableReportElement (org.activityinfo.shared.report.model.PivotTableReportElement)2 TableColumn (org.activityinfo.shared.report.model.TableColumn)2 ArabicNumberSequence (org.activityinfo.shared.report.model.labeling.ArabicNumberSequence)2 BubbleMapLayer (org.activityinfo.shared.report.model.layers.BubbleMapLayer)2 DispatcherSync (org.activityinfo.server.command.DispatcherSync)1 GetBaseMaps (org.activityinfo.shared.command.GetBaseMaps)1 BaseMapResult (org.activityinfo.shared.command.result.BaseMapResult)1 SiteResult (org.activityinfo.shared.command.result.SiteResult)1 TileBaseMap (org.activityinfo.shared.map.TileBaseMap)1 MapContent (org.activityinfo.shared.report.content.MapContent)1 TableData (org.activityinfo.shared.report.content.TableData)1 ImageReportElement (org.activityinfo.shared.report.model.ImageReportElement)1 TextReportElement (org.activityinfo.shared.report.model.TextReportElement)1 CircledMapLayer (org.activityinfo.shared.report.model.layers.CircledMapLayer)1