@@ -3054,6 +3054,74 @@ public void inheritHeaderPropsWhileMinMaxWidthCalculationsTest() throws IOExcept
30543054 sourceFolder + "cmp_" + filename , destinationFolder , "diff" ));
30553055 }
30563056
3057+ @ Test
3058+ @ LogMessages (messages = {
3059+ @ LogMessage (messageTemplate = LogMessageConstant .ELEMENT_DOES_NOT_FIT_AREA )
3060+ })
3061+ public void infiniteLoopOnUnfitCellAndBigRowspanTest () throws IOException , InterruptedException {
3062+ String testName = "infiniteLoopOnUnfitCellAndBigRowspanTest.pdf" ;
3063+ String outFileName = destinationFolder + testName ;
3064+ String cmpFileName = sourceFolder + "cmp_" + testName ;
3065+
3066+ PdfDocument pdfDoc = new PdfDocument (new PdfWriter (outFileName ));
3067+ Document doc = new Document (pdfDoc , PageSize .A4 .rotate ());
3068+
3069+ Table table = new Table (38 );
3070+ table .useAllAvailableWidth ();
3071+ table .setFixedLayout ();
3072+
3073+ Cell cellNum1 = new Cell (1 , 1 );
3074+ table .addCell (cellNum1 );
3075+
3076+ Cell cellNum2 = new Cell (2 , 2 );
3077+ Image img = new Image (ImageDataFactory .create (sourceFolder + "itext.png" ));
3078+ cellNum2 .add (img );
3079+ table .addCell (cellNum2 );
3080+
3081+ Cell cellNum3 = new Cell (2 , 36 );
3082+ cellNum3 .add (new Paragraph ("text" ));
3083+ table .addCell (cellNum3 );
3084+
3085+ doc .add (table );
3086+ doc .close ();
3087+
3088+ Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , testName + "_diff" ));
3089+ }
3090+
3091+ @ Test
3092+ @ LogMessages (messages = {
3093+ @ LogMessage (messageTemplate = LogMessageConstant .ELEMENT_DOES_NOT_FIT_AREA ),
3094+ @ LogMessage (messageTemplate = LogMessageConstant .TABLE_WIDTH_IS_MORE_THAN_EXPECTED_DUE_TO_MIN_WIDTH )
3095+ })
3096+ public void firstRowNotFitBigRowspanTest () throws IOException , InterruptedException {
3097+ String testName = "firstRowNotFitBigRowspanTest.pdf" ;
3098+ String outFileName = destinationFolder + testName ;
3099+ String cmpFileName = sourceFolder + "cmp_" + testName ;
3100+
3101+ PdfDocument pdfDoc = new PdfDocument (new PdfWriter (outFileName ));
3102+ Document doc = new Document (pdfDoc , PageSize .A4 );
3103+
3104+ Table table = new Table (4 );
3105+
3106+ table .addCell ("row 1 col 1" );
3107+
3108+ Cell notFitCell = new Cell (2 , 1 );
3109+ notFitCell .add (new Paragraph ("row 1-2 col 2" ));
3110+ notFitCell .setFontSize (1000 );
3111+ table .addCell (notFitCell );
3112+
3113+ Cell fitCell = new Cell (2 , 2 );
3114+ fitCell .add (new Paragraph ("row 1-2 col 3-4" ));
3115+ table .addCell (fitCell );
3116+
3117+ table .addCell ("row 2 col 1" );
3118+
3119+ doc .add (table );
3120+ doc .close ();
3121+
3122+ Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , testName + "_diff" ));
3123+ }
3124+
30573125 @ Test
30583126 // TODO DEVSIX-5250 The first column should be fully red
30593127 public void bigRowSpanTooFarFullTest () throws IOException , InterruptedException {
0 commit comments