Skip to content

Commit d8aa793

Browse files
ar3emiText-CI
authored andcommitted
Add test on infinite loop during table creating in layout
DEVSIX-3356
1 parent d15bd79 commit d8aa793

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

layout/src/test/java/com/itextpdf/layout/TableTest.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ This file is part of the iText (R) project.
8282
import com.itextpdf.test.annotations.type.IntegrationTest;
8383
import org.junit.Assert;
8484
import org.junit.BeforeClass;
85+
import org.junit.Ignore;
8586
import org.junit.Rule;
8687
import org.junit.Test;
8788
import org.junit.experimental.categories.Category;
@@ -2883,6 +2884,36 @@ public void skipLastFooterOnShortPageTest01() throws IOException, InterruptedExc
28832884
Assert.assertNull(new CompareTool().compareByContent(outFileName, cmpFileName, destinationFolder, testName + "_diff"));
28842885
}
28852886

2887+
@Test
2888+
@Ignore("Ignored because the test enters an infinite loop when closing a document. Remove ignore after fixing DEVSIX-3356")
2889+
// TODO remove ignore after fixing DEVSIX-3356
2890+
public void infiniteLoopOnUnfitCellAndBigRowspanTest() throws IOException {
2891+
String testName = "infiniteLoopOnUnfitCellAndBigRowspanTest.pdf";
2892+
String outFileName = destinationFolder + testName;
2893+
2894+
PdfDocument pdfDoc = new PdfDocument(new PdfWriter(outFileName));
2895+
Document doc = new Document(pdfDoc, PageSize.A4.rotate());
2896+
2897+
Table table = new Table(38);
2898+
table.useAllAvailableWidth();
2899+
table.setFixedLayout();
2900+
2901+
Cell cellNum1 = new Cell(1, 1);
2902+
table.addCell(cellNum1);
2903+
2904+
Cell cellNum2 = new Cell(2, 2);
2905+
Image img = new Image(ImageDataFactory.create(sourceFolder + "itext.png"));
2906+
cellNum2.add(img);
2907+
table.addCell(cellNum2);
2908+
2909+
Cell cellNum3 = new Cell(2, 36);
2910+
cellNum3.add(new Paragraph("text"));
2911+
table.addCell(cellNum3);
2912+
2913+
doc.add(table);
2914+
doc.close();
2915+
}
2916+
28862917
private static class RotatedDocumentRenderer extends DocumentRenderer {
28872918
private final PdfDocument pdfDoc;
28882919

0 commit comments

Comments
 (0)