Skip to content

Commit cae4c3d

Browse files
committed
Fix tests after fixing LayoutExceptionMessageConstant.INVALID_CELL_INDEXES exception
DEVSIX-8427
1 parent a7e4a9f commit cae4c3d

File tree

17 files changed

+49
-113
lines changed

17 files changed

+49
-113
lines changed

src/test/java/com/itextpdf/html2pdf/css/grid/GridItemPlacementTest.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,16 +88,20 @@ public void fewCellsPlacement4Test() throws IOException, InterruptedException {
8888
}
8989

9090
@Test
91-
public void fewCellsPlacement5Test() {
92-
Exception e = Assertions.assertThrows(IllegalArgumentException.class, () -> runTest("fewCellsPlacement5"));
93-
Assertions.assertEquals(LayoutExceptionMessageConstant.INVALID_CELL_INDEXES, e.getMessage());
91+
public void fewCellsPlacement5Test() throws IOException, InterruptedException {
92+
runTest("fewCellsPlacement5");
9493
}
9594

9695
@Test
9796
public void fewCellsPlacement6Test() throws IOException, InterruptedException {
9897
runTest("fewCellsPlacement6");
9998
}
10099

100+
@Test
101+
public void fewCellsPlacement7Test() throws IOException, InterruptedException {
102+
runTest("fewCellsPlacement7");
103+
}
104+
101105
@Test
102106
public void rowStartEnd1Test() throws IOException, InterruptedException {
103107
runTest("rowStartEnd1");

src/test/java/com/itextpdf/html2pdf/css/grid/GridTemplatesTest.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ public void maxHeightFlexRowsTest2() throws IOException, InterruptedException {
634634
runTest("maxHeightFlexRowsTest2");
635635
}
636636

637+
@Test
637638
@LogMessages(messages = {
638639
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.INVALID_CSS_PROPERTY_DECLARATION, logLevel =
639640
LogLevelConstants.WARN)})

src/test/java/com/itextpdf/html2pdf/css/multicol/ColumnCountTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,6 @@ public void convertBasicDisplayPropertyTest() throws IOException, InterruptedExc
132132
runTest("basicDisplayPropertyTest");
133133
}
134134

135-
@Disabled("DEVSIX-8427")
136135
@Test
137136
public void convertBasicDisplayPropertyWithNestedColumnsTest() throws IOException, InterruptedException {
138137
runTest("basicDisplayPropertyWithNestedColumnsTest");

src/test/java/com/itextpdf/html2pdf/css/multicol/ColumnWidthTest.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,6 @@ public void convertNestedElementsTest() throws IOException, InterruptedException
108108
runTest("nestedElementsTest");
109109
}
110110

111-
@Disabled("DEVSIX-8427")
112111
@Test
113112
public void convertBasicDisplayPropertyTest() throws IOException, InterruptedException {
114113
runTest("basicDisplayPropertyTest");

src/test/java/com/itextpdf/html2pdf/css/w3c/css_grid/grid_model/GridFloat002Test.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,7 @@ This file is part of the iText (R) project.
2727
import com.itextpdf.test.annotations.LogMessage;
2828
import com.itextpdf.test.annotations.LogMessages;
2929

30-
import org.junit.jupiter.api.Disabled;
31-
3230
//TODO DEVSIX-2449 z-index is not supported
33-
//TODO DEVSIX-8427: Fix LayoutExceptionMessageConstant.INVALID_CELL_INDEXES exception
34-
@Disabled("DEVSIX-8427")
3531
@LogMessages(messages = {
3632
@LogMessage(messageTemplate = Html2PdfLogMessageConstant.NO_WORKER_FOUND_FOR_TAG, count = 3)})
3733
public class GridFloat002Test extends W3CCssTest {

src/test/java/com/itextpdf/html2pdf/css/w3c/css_multicol/BalanceGridContainerRefTest.java

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -22,62 +22,11 @@ This file is part of the iText (R) project.
2222
*/
2323
package com.itextpdf.html2pdf.css.w3c.css_multicol;
2424

25-
import com.itextpdf.html2pdf.HtmlConverter;
2625
import com.itextpdf.html2pdf.css.w3c.W3CCssTest;
27-
import com.itextpdf.io.util.UrlUtil;
28-
import com.itextpdf.kernel.utils.CompareTool;
29-
import org.junit.jupiter.api.Assertions;
30-
import org.junit.jupiter.api.Disabled;
31-
import org.junit.jupiter.api.Test;
32-
33-
import java.io.File;
34-
import java.io.IOException;
3526

3627
public class BalanceGridContainerRefTest extends W3CCssTest {
37-
private static final String baseDestinationFolder = "./target/test/com/itextpdf/html2pdf/css/w3c/";
38-
private static final String baseSourceFolder = "./src/test/resources/com/itextpdf/html2pdf/css/w3c/";
39-
//after completing DEVSIX-8427, remove everything from this class except for getHtmlFileName() method
4028
@Override
4129
protected String getHtmlFileName() {
4230
return "balance-grid-container-ref.html";
4331
}
44-
45-
@Override
46-
@Disabled("DEVSIX-8427")
47-
@Test
48-
public void test() throws IOException, InterruptedException {
49-
String sourceFolder = getSourceFolder();
50-
String destinationFolder = getDestinationFolder();
51-
String htmlFilePath = sourceFolder + getHtmlFileName();
52-
String outFilePath = destinationFolder + getOutPdfFileName();
53-
String cmpFilePath = sourceFolder + getOutPdfFileName();
54-
System.out.println("html: " + UrlUtil.getNormalizedFileUriString(htmlFilePath) + "\n");
55-
HtmlConverter.convertToPdf(new File(htmlFilePath), new File(outFilePath), getConverterProperties());
56-
Assertions.assertNull(new CompareTool().compareByContent(outFilePath, cmpFilePath, destinationFolder, "diff_"));
57-
}
58-
59-
private String getOutPdfFileName() {
60-
String htmlFileName = getHtmlFileName();
61-
return htmlFileName.replaceAll("\\.[a-zA-Z]+?$", ".pdf");
62-
}
63-
64-
private String getDestinationFolder() {
65-
String localPackage = getLocalPackage();
66-
return baseDestinationFolder + localPackage + File.separatorChar + getTestClassName() + File.separatorChar;
67-
}
68-
69-
private String getSourceFolder() {
70-
String localPackage = getLocalPackage();
71-
return baseSourceFolder + localPackage + File.separatorChar;
72-
}
73-
74-
private String getLocalPackage() {
75-
String packageName = getClass().getPackage().getName();
76-
String basePackageName = W3CCssTest.class.getPackage().getName();
77-
return packageName.substring(basePackageName.length()).replace('.', File.separatorChar);
78-
}
79-
80-
private String getTestClassName() {
81-
return getClass().getSimpleName();
82-
}
8332
}

src/test/java/com/itextpdf/html2pdf/css/w3c/css_multicol/BalanceGridContainerTest.java

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -22,63 +22,11 @@ This file is part of the iText (R) project.
2222
*/
2323
package com.itextpdf.html2pdf.css.w3c.css_multicol;
2424

25-
import com.itextpdf.html2pdf.HtmlConverter;
2625
import com.itextpdf.html2pdf.css.w3c.W3CCssTest;
27-
import com.itextpdf.io.util.UrlUtil;
28-
import com.itextpdf.kernel.utils.CompareTool;
29-
import org.junit.jupiter.api.Assertions;
30-
import org.junit.jupiter.api.Disabled;
31-
import org.junit.jupiter.api.Test;
32-
33-
import java.io.File;
34-
import java.io.IOException;
3526

3627
public class BalanceGridContainerTest extends W3CCssTest {
37-
private static final String baseDestinationFolder = "./target/test/com/itextpdf/html2pdf/css/w3c/";
38-
private static final String baseSourceFolder = "./src/test/resources/com/itextpdf/html2pdf/css/w3c/";
39-
40-
//after completing DEVSIX-8427, remove everything from this class except for getHtmlFileName() method
4128
@Override
4229
protected String getHtmlFileName() {
4330
return "balance-grid-container.html";
4431
}
45-
46-
@Override
47-
@Disabled("DEVSIX-8427")
48-
@Test
49-
public void test() throws IOException, InterruptedException {
50-
String sourceFolder = getSourceFolder();
51-
String destinationFolder = getDestinationFolder();
52-
String htmlFilePath = sourceFolder + getHtmlFileName();
53-
String outFilePath = destinationFolder + getOutPdfFileName();
54-
String cmpFilePath = sourceFolder + getOutPdfFileName();
55-
System.out.println("html: " + UrlUtil.getNormalizedFileUriString(htmlFilePath) + "\n");
56-
HtmlConverter.convertToPdf(new File(htmlFilePath), new File(outFilePath), getConverterProperties());
57-
Assertions.assertNull(new CompareTool().compareByContent(outFilePath, cmpFilePath, destinationFolder, "diff_"));
58-
}
59-
60-
private String getOutPdfFileName() {
61-
String htmlFileName = getHtmlFileName();
62-
return htmlFileName.replaceAll("\\.[a-zA-Z]+?$", ".pdf");
63-
}
64-
65-
private String getDestinationFolder() {
66-
String localPackage = getLocalPackage();
67-
return baseDestinationFolder + localPackage + File.separatorChar + getTestClassName() + File.separatorChar;
68-
}
69-
70-
private String getSourceFolder() {
71-
String localPackage = getLocalPackage();
72-
return baseSourceFolder + localPackage + File.separatorChar;
73-
}
74-
75-
private String getLocalPackage() {
76-
String packageName = getClass().getPackage().getName();
77-
String basePackageName = W3CCssTest.class.getPackage().getName();
78-
return packageName.substring(basePackageName.length()).replace('.', File.separatorChar);
79-
}
80-
81-
private String getTestClassName() {
82-
return getClass().getSimpleName();
83-
}
8432
}

src/test/resources/com/itextpdf/html2pdf/css/grid/GridItemPlacementTest/fewCellsPlacement5.html

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
.wrapper > div {
1313
border: 2px solid darkblue;
14-
background-color: lightblue;
1514
}
1615

1716
.wrapper > div:nth-of-type(2) {

0 commit comments

Comments
 (0)