Search in sources :

Example 26 with Report

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

the class StaticElementRenderTest method testRtfRender.

@Test
public void testRtfRender() throws JAXBException, IOException {
    Report r = getStatic();
    RtfReportRenderer renderer = new RtfReportRenderer(TestGeometry.get(), "");
    FileOutputStream fos = new FileOutputStream("target/report-tests/render-static" + renderer.getFileSuffix());
    renderer.render(r, fos);
    fos.close();
}
Also used : Report(org.activityinfo.shared.report.model.Report) RtfReportRenderer(org.activityinfo.server.report.renderer.itext.RtfReportRenderer) FileOutputStream(java.io.FileOutputStream) Test(org.junit.Test)

Example 27 with Report

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

the class StaticElementRenderTest method testHtmlRender.

@Test
public void testHtmlRender() throws JAXBException, IOException {
    Report r = getStatic();
    HtmlReportRenderer renderer = new HtmlReportRenderer(TestGeometry.get(), "", new NullStorageProvider());
    FileOutputStream fos = new FileOutputStream("target/report-tests/render-static" + renderer.getFileSuffix());
    renderer.render(r, fos);
    fos.close();
}
Also used : Report(org.activityinfo.shared.report.model.Report) FileOutputStream(java.io.FileOutputStream) HtmlReportRenderer(org.activityinfo.server.report.renderer.itext.HtmlReportRenderer) Test(org.junit.Test)

Example 28 with Report

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

the class JaxbParseTest method testElements.

@Test
public void testElements() throws JAXBException {
    Report report = parseXml("report-elements.xml");
    dumpXml(report);
    Assert.assertEquals("element count", 7, report.getElements().size());
    Assert.assertTrue("pivotTable", report.getElements().get(0) instanceof PivotTableReportElement);
    Assert.assertTrue("pivotChart", report.getElements().get(1) instanceof PivotChartReportElement);
    Assert.assertTrue("table", report.getElements().get(2) instanceof TableElement);
    Assert.assertTrue("map", report.getElements().get(3) instanceof MapReportElement);
    Assert.assertTrue("static", report.getElements().get(4) instanceof TextReportElement);
    Assert.assertTrue("static", report.getElements().get(5) instanceof TextReportElement);
    Assert.assertTrue("static", report.getElements().get(6) instanceof ImageReportElement);
}
Also used : MapReportElement(org.activityinfo.shared.report.model.MapReportElement) ImageReportElement(org.activityinfo.shared.report.model.ImageReportElement) Report(org.activityinfo.shared.report.model.Report) PivotChartReportElement(org.activityinfo.shared.report.model.PivotChartReportElement) PivotTableReportElement(org.activityinfo.shared.report.model.PivotTableReportElement) TableElement(org.activityinfo.shared.report.model.TableElement) TextReportElement(org.activityinfo.shared.report.model.TextReportElement) Test(org.junit.Test)

Example 29 with Report

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

the class JaxbParseTest method testTable.

@Test
public void testTable() throws Throwable {
    Report report = parseXml("table.xml");
    dumpXml(report);
    TableElement table = report.getElement(0);
    Assert.assertEquals("column count", 8, table.getRootColumn().getChildren().size());
// Assert.assertEquals(TableColumn.SortOrder.Descending,
// table.getSortBy().get(0).getOrder());
// Assert.assertEquals(TableColumn.SortOrder.Ascending,
// table.getSortBy().get(1).getOrder());
}
Also used : Report(org.activityinfo.shared.report.model.Report) TableElement(org.activityinfo.shared.report.model.TableElement) Test(org.junit.Test)

Example 30 with Report

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

the class JaxbParseTest method testReport.

@Test
public void testReport() throws JAXBException {
    Report report = parseXml("report.xml");
    Assert.assertEquals("My Title", report.getTitle());
}
Also used : Report(org.activityinfo.shared.report.model.Report) Test(org.junit.Test)

Aggregations

Report (org.activityinfo.shared.report.model.Report)37 Test (org.junit.Test)22 MapReportElement (org.activityinfo.shared.report.model.MapReportElement)11 ReportContent (org.activityinfo.shared.report.content.ReportContent)9 PivotTableReportElement (org.activityinfo.shared.report.model.PivotTableReportElement)9 PivotChartReportElement (org.activityinfo.shared.report.model.PivotChartReportElement)8 FileOutputStream (java.io.FileOutputStream)5 DummyPivotTableData (org.activityinfo.server.report.DummyPivotTableData)4 TileBaseMap (org.activityinfo.shared.map.TileBaseMap)4 TableElement (org.activityinfo.shared.report.model.TableElement)4 TextReportElement (org.activityinfo.shared.report.model.TextReportElement)4 IOException (java.io.IOException)3 JAXBContext (javax.xml.bind.JAXBContext)3 Unmarshaller (javax.xml.bind.Unmarshaller)3 ReportDefinition (org.activityinfo.server.database.hibernate.entity.ReportDefinition)3 BubbleMapMarker (org.activityinfo.shared.report.content.BubbleMapMarker)3 IconMapMarker (org.activityinfo.shared.report.content.IconMapMarker)3 MapContent (org.activityinfo.shared.report.content.MapContent)3 MapMarker (org.activityinfo.shared.report.content.MapMarker)3 PivotContent (org.activityinfo.shared.report.content.PivotContent)3