@Test public void testShallowInlineSubReportDetection() { SubReport srInner = new SubReport(); SubReport sr = new SubReport(); sr.getReportHeader().addElement( srInner ); MasterReport report = new MasterReport(); report.getReportHeader().addElement( sr ); ReportStructureValidator v = new ReportStructureValidator(); Assert.assertFalse( v.isValidForFastProcessing( report ) ); }
@Test public void testRowLayoutAtRunTime() throws Exception { MasterReport report = new MasterReport(); ReportHeader reportHeader = report.getReportHeader(); reportHeader.setLayout( BandStyleKeys.LAYOUT_ROW ); reportHeader.getStyle().setStyleProperty( ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, false ); reportHeader.addElement( createElement( true ) ); reportHeader.addElement( createElement( false ) ); reportHeader.addElement( createElement( true ) ); LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBand( report, reportHeader ); RenderNode[] elementsByElementType = MatchFactory.findElementsByNodeType( logicalPageBox, LayoutNodeTypes.TYPE_BOX_PARAGRAPH ); Assert.assertEquals( 2, elementsByElementType.length ); Assert.assertEquals( 0, elementsByElementType[0].getX() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[0].getWidth() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[1].getX() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[1].getWidth() ); }
@Test public void testRowLayoutAtDesignTime() throws Exception { LogFactory.getLog( "test" ).error( "Test" ); MasterReport report = new MasterReport(); ReportHeader reportHeader = report.getReportHeader(); reportHeader.setLayout( BandStyleKeys.LAYOUT_ROW ); reportHeader.getStyle().setStyleProperty( ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, false ); reportHeader.addElement( createElement( true ) ); reportHeader.addElement( createElement( false ) ); reportHeader.addElement( createElement( true ) ); LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBandInDesignTime( report, reportHeader ); RenderNode[] elementsByElementType = MatchFactory.findElementsByNodeType( logicalPageBox, LayoutNodeTypes.TYPE_BOX_PARAGRAPH ); Assert.assertEquals( 3, elementsByElementType.length ); Assert.assertEquals( 0, elementsByElementType[0].getX() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[0].getWidth() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[1].getX() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[1].getWidth() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[2].getX() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[2].getWidth() ); }
@Test public void testRowLayoutAtDesignTimeInv() throws Exception { LogFactory.getLog( "test" ).error( "Test" ); MasterReport report = new MasterReport(); ReportHeader reportHeader = report.getReportHeader(); reportHeader.setLayout( BandStyleKeys.LAYOUT_ROW ); reportHeader.getStyle().setStyleProperty( ElementStyleKeys.INVISIBLE_CONSUMES_SPACE, true ); reportHeader.addElement( createElement( true ) ); reportHeader.addElement( createElement( false ) ); reportHeader.addElement( createElement( true ) ); LogicalPageBox logicalPageBox = DebugReportRunner.layoutSingleBandInDesignTime( report, reportHeader ); RenderNode[] elementsByElementType = MatchFactory.findElementsByNodeType( logicalPageBox, LayoutNodeTypes.TYPE_BOX_PARAGRAPH ); Assert.assertEquals( 3, elementsByElementType.length ); Assert.assertEquals( 0, elementsByElementType[0].getX() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[0].getWidth() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[1].getX() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[1].getWidth() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 200 ), elementsByElementType[2].getX() ); Assert.assertEquals( StrictGeomUtility.toInternalValue( 100 ), elementsByElementType[2].getWidth() ); }
@Test public void testDeepInlineSubReportDetection() { SubReport srInner = new SubReport(); SubReport sr = new SubReport(); sr.getReportHeader().addElement( srInner ); MasterReport report = new MasterReport(); report.getReportHeader().addSubReport( sr ); ReportStructureValidator v = new ReportStructureValidator(); Assert.assertFalse( v.isValidForFastProcessing( report ) ); }
@Test public void testDeepSubBandInlineSubReportDetection() { SubReport srInner = new SubReport(); Band band = new Band(); band.addElement( srInner ); SubReport sr = new SubReport(); sr.getReportHeader().addElement( band ); MasterReport report = new MasterReport(); report.getReportHeader().addSubReport( sr ); ReportStructureValidator v = new ReportStructureValidator(); Assert.assertFalse( v.isValidForFastProcessing( report ) ); }