@@ -42,6 +42,7 @@ This file is part of the iText (R) project.
42
42
*/
43
43
package com .itextpdf .layout ;
44
44
45
+ import com .itextpdf .io .LogMessageConstant ;
45
46
import com .itextpdf .kernel .colors .ColorConstants ;
46
47
import com .itextpdf .kernel .pdf .PdfDocument ;
47
48
import com .itextpdf .kernel .pdf .PdfWriter ;
@@ -51,6 +52,9 @@ This file is part of the iText (R) project.
51
52
import com .itextpdf .layout .element .Text ;
52
53
import com .itextpdf .layout .property .TextAlignment ;
53
54
import com .itextpdf .test .ExtendedITextTest ;
55
+ import com .itextpdf .test .LogLevelConstants ;
56
+ import com .itextpdf .test .annotations .LogMessage ;
57
+ import com .itextpdf .test .annotations .LogMessages ;
54
58
import com .itextpdf .test .annotations .type .IntegrationTest ;
55
59
import org .junit .Assert ;
56
60
import org .junit .BeforeClass ;
@@ -127,4 +131,30 @@ public void wordWasSplitAndItWillFitOntoNextLineTest01() throws IOException, Int
127
131
128
132
Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , "diff" ));
129
133
}
134
+
135
+ @ Test
136
+ @ LogMessages (messages = {
137
+ @ LogMessage (messageTemplate = LogMessageConstant .RECTANGLE_HAS_NEGATIVE_OR_ZERO_SIZES ,
138
+ logLevel = LogLevelConstants .INFO )
139
+ })
140
+ // TODO DEVSIX-4622
141
+ public void wordWasSplitAndItWillFitOntoNextLineTest02 () throws IOException , InterruptedException {
142
+ String outFileName = destinationFolder + "wordWasSplitAndItWillFitOntoNextLineTest02.pdf" ;
143
+ String cmpFileName = sourceFolder + "cmp_wordWasSplitAndItWillFitOntoNextLineTest02.pdf" ;
144
+ PdfDocument pdfDocument = new PdfDocument (new PdfWriter (outFileName ));
145
+
146
+ Document document = new Document (pdfDocument );
147
+
148
+ Paragraph paragraph = new Paragraph ()
149
+ .add (new Text ("Short" ).setBackgroundColor (ColorConstants .YELLOW ))
150
+ .add (new Text (" Loooooooooooooooooooong" ).setBackgroundColor (ColorConstants .RED ))
151
+ .setWidth (90 )
152
+ .setBorder (new SolidBorder (1 ));
153
+
154
+ document .add (paragraph );
155
+
156
+ document .close ();
157
+
158
+ Assert .assertNull (new CompareTool ().compareByContent (outFileName , cmpFileName , destinationFolder , "diff" ));
159
+ }
130
160
}
0 commit comments