Skip to content

Commit 2c39cc2

Browse files
committed
Change the type of expected exception
For the sake of autoportability of the file DEVSIX-3811
1 parent 2571168 commit 2c39cc2

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

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

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ This file is part of the iText (R) project.
6060
import com.itextpdf.layout.renderer.IRenderer;
6161
import com.itextpdf.test.ExtendedITextTest;
6262
import com.itextpdf.test.annotations.type.IntegrationTest;
63+
6364
import org.junit.Assert;
6465
import org.junit.BeforeClass;
6566
import org.junit.Rule;
@@ -90,7 +91,6 @@ public void collapsingMarginsTest01() throws IOException, InterruptedException {
9091
String cmpFileName = sourceFolder + "cmp_collapsingMarginsTest01.pdf";
9192
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
9293

93-
9494
drawPageBorders(pdfDocument, 4);
9595

9696
String textByron =
@@ -140,7 +140,6 @@ public void collapsingMarginsTest02() throws IOException, InterruptedException {
140140
String cmpFileName = sourceFolder + "cmp_collapsingMarginsTest02.pdf";
141141
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
142142

143-
144143
drawPageBorders(pdfDocument, 3);
145144

146145
String textByron =
@@ -196,7 +195,6 @@ public void collapsingMarginsTest03() throws IOException, InterruptedException {
196195
String cmpFileName = sourceFolder + "cmp_collapsingMarginsTest03.pdf";
197196
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
198197

199-
200198
drawPageBorders(pdfDocument, 3);
201199

202200
String textByron =
@@ -249,7 +247,6 @@ public void collapsingMarginsTest04() throws IOException, InterruptedException {
249247
String cmpFileName = sourceFolder + "cmp_collapsingMarginsTest04.pdf";
250248
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
251249

252-
253250
drawPageBorders(pdfDocument, 3);
254251

255252
String textByron =
@@ -307,7 +304,6 @@ public void collapsingMarginsTest05() throws IOException, InterruptedException {
307304
String cmpFileName = sourceFolder + "cmp_collapsingMarginsTest05.pdf";
308305
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
309306

310-
311307
drawPageBorders(pdfDocument, 2);
312308

313309
String textByron =
@@ -357,9 +353,12 @@ private void drawPageBorders(PdfDocument pdfDocument, int pageNum) {
357353
}
358354

359355
@Test
360-
// TODO DEVSIX-2901 the exception should not be thrown
356+
/* TODO DEVSIX-2901 the exception should not be thrown
357+
if after DEVSIX-2901 the exception persists,
358+
change the type of the expected exception to a more specific one to make the test stricter.
359+
*/
361360
public void columnRendererTest() throws IOException, InterruptedException {
362-
junitExpectedException.expect(ArrayIndexOutOfBoundsException.class);
361+
junitExpectedException.expect(Exception.class);
363362
String outFileName = destinationFolder + "columnRendererTest.pdf";
364363
String cmpFileName = sourceFolder + "cmp_columnRendererTest.pdf";
365364
PdfDocument pdfDocument = new PdfDocument(new PdfWriter(outFileName));
@@ -378,7 +377,6 @@ public void columnRendererTest() throws IOException, InterruptedException {
378377
Document doc = new Document(pdfDocument);
379378
doc.setProperty(Property.COLLAPSING_MARGINS, true);
380379

381-
382380
Paragraph p = new Paragraph();
383381
for (int i = 0; i < 10; i++) {
384382
p.add(textByron);

0 commit comments

Comments
 (0)