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"));
}
Aggregations