Skip to content

Commit dd982a6

Browse files
AlexanderRasolkoiText-CI
authored andcommitted
Add System out println for compare Xmls method
1 parent 765865d commit dd982a6

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

kernel/src/main/java/com/itextpdf/kernel/utils/CompareTool.java

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,17 @@ public boolean compareXmls(byte[] xml1, byte[] xml2) throws ParserConfigurationE
694694
/**
695695
* Utility method that provides simple comparison of the two xml files.
696696
*
697-
* @param xmlFilePath1 absolute path to the first xml file to compare.
698-
* @param xmlFilePath2 absolute path to the second xml file to compare.
697+
* @param outXmlFile absolute path to the out xml file to compare.
698+
* @param cmpXmlFile absolute path to the cmp xml file to compare.
699699
* @return true if xml structures are identical, false otherwise.
700700
* @throws ParserConfigurationException
701701
* @throws SAXException
702702
* @throws IOException
703703
*/
704-
public boolean compareXmls(String xmlFilePath1, String xmlFilePath2) throws ParserConfigurationException, SAXException, IOException {
705-
return XmlUtils.compareXmls(new FileInputStream(xmlFilePath1), new FileInputStream(xmlFilePath2));
704+
public boolean compareXmls(String outXmlFile, String cmpXmlFile) throws ParserConfigurationException, SAXException, IOException {
705+
System.out.println("Out xml: file:///" + UrlUtil.toNormalizedURI(outXmlFile).getPath());
706+
System.out.println("Cmp xml: file:///" + UrlUtil.toNormalizedURI(cmpXmlFile).getPath() + "\n");
707+
return XmlUtils.compareXmls(new FileInputStream(outXmlFile), new FileInputStream(cmpXmlFile));
706708
}
707709

708710
/**

kernel/src/test/java/com/itextpdf/kernel/utils/CompareToolTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ public void compareToolErrorReportTest01() throws InterruptedException, IOExcept
7575
System.out.println(result);
7676
Assert.assertNotNull("CompareTool must return differences found between the files", result);
7777
// Comparing the report to the reference one.
78-
Assert.assertTrue("CompareTool report differs from the reference one", compareTool.compareXmls(sourceFolder + "cmp_report01.xml", destinationFolder + "simple_pdf.report.xml"));
78+
Assert.assertTrue("CompareTool report differs from the reference one", compareTool.compareXmls(destinationFolder + "simple_pdf.report.xml", sourceFolder + "cmp_report01.xml"));
7979
}
8080

8181
@Test
@@ -89,7 +89,7 @@ public void compareToolErrorReportTest02() throws IOException, InterruptedExcept
8989
System.out.println(result);
9090
Assert.assertNotNull("CompareTool must return differences found between the files", result);
9191
// Comparing the report to the reference one.
92-
Assert.assertTrue("CompareTool report differs from the reference one", compareTool.compareXmls(sourceFolder + "cmp_report02.xml", destinationFolder + "tagged_pdf.report.xml"));
92+
Assert.assertTrue("CompareTool report differs from the reference one", compareTool.compareXmls(destinationFolder + "tagged_pdf.report.xml", sourceFolder + "cmp_report02.xml"));
9393
}
9494

9595
@Test
@@ -103,7 +103,7 @@ public void compareToolErrorReportTest03() throws InterruptedException, IOExcept
103103
System.out.println(result);
104104
Assert.assertNotNull("CompareTool must return differences found between the files", result);
105105
// Comparing the report to the reference one.
106-
Assert.assertTrue("CompareTool report differs from the reference one", compareTool.compareXmls(sourceFolder + "cmp_report03.xml", destinationFolder + "screenAnnotation.report.xml"));
106+
Assert.assertTrue("CompareTool report differs from the reference one", compareTool.compareXmls(destinationFolder + "screenAnnotation.report.xml", sourceFolder + "cmp_report03.xml"));
107107
}
108108

109109

@@ -119,7 +119,7 @@ public void compareToolErrorReportTest04() throws InterruptedException, IOExcept
119119
System.out.println(result);
120120
Assert.assertNotNull("CompareTool must return differences found between the files", result);
121121
// Comparing the report to the reference one.
122-
Assert.assertTrue("CompareTool report differs from the reference one", compareTool.compareXmls(sourceFolder + "cmp_report01.xml", destinationFolder + "simple_pdf.report.xml"));
122+
Assert.assertTrue("CompareTool report differs from the reference one", compareTool.compareXmls(destinationFolder + "simple_pdf.report.xml", sourceFolder + "cmp_report01.xml"));
123123

124124
}
125125

0 commit comments

Comments
 (0)