From 8a0598707e60dd505b89b26098ac78baab6911e2 Mon Sep 17 00:00:00 2001 From: Gabriel Belingueres Date: Thu, 21 Jan 2021 17:26:06 -0300 Subject: [PATCH 1/2] Fixed MXParser do not fail when encountering invalid characters in comments (#126) --- .../plexus/util/xml/pull/MXParser.java | 19 +- ...ConformanceTestSuite_Production2_Test.java | 901 ++++++++++++++++++ .../xmlconf/ibm/not-wf/P02/ibm02n01.xml | Bin 0 -> 91 bytes .../xmlconf/ibm/not-wf/P02/ibm02n02.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n03.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n04.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n05.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n06.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n07.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n08.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n09.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n10.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n11.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n12.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n13.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n14.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n15.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n16.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n17.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n18.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n19.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n20.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n21.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n22.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n23.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n24.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n25.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n26.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n27.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n28.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n29.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n30.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n31.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n32.xml | 6 + .../xmlconf/ibm/not-wf/P02/ibm02n33.xml | 6 + 35 files changed, 1111 insertions(+), 1 deletion(-) create mode 100644 src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test.java create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n01.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n02.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n03.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n04.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n05.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n06.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n07.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n08.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n09.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n10.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n11.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n12.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n13.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n14.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n15.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n16.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n17.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n18.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n19.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n20.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n21.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n22.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n23.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n24.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n25.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n26.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n27.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n28.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n29.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n30.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n31.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n32.xml create mode 100755 src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n33.xml diff --git a/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java b/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java index 40a12a21..a9f88752 100644 --- a/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java +++ b/src/main/java/org/codehaus/plexus/util/xml/pull/MXParser.java @@ -2865,6 +2865,19 @@ else if ( len == 4 && buf[posStart] == 'q' && buf[posStart + 1] == 'u' && buf[po } } + /** + * Check if the provided parameter is a valid Char, according to: {@link https://www.w3.org/TR/REC-xml/#NT-Char} + * + * @param codePoint the numeric value to check + * @return true if it is a valid numeric character reference. False otherwise. + */ + private static boolean isValidCodePoint( int codePoint ) + { + // Char ::= #x9 | #xA | #xD | [#x20-#xD7FF] | [#xE000-#xFFFD] | [#x10000-#x10FFFF] + return codePoint == 0x9 || codePoint == 0xA || codePoint == 0xD || ( 0x20 <= codePoint && codePoint <= 0xD7FF ) + || ( 0xE000 <= codePoint && codePoint <= 0xFFFD ) || ( 0x10000 <= codePoint && codePoint <= 0x10FFFF ); + } + private char[] lookuEntityReplacement( int entityNameLen ) throws XmlPullParserException, IOException @@ -2954,10 +2967,14 @@ else if ( ch == '>' ) } seenDash = false; } - else + else if (isValidCodePoint( ch )) { seenDash = false; } + else + { + throw new XmlPullParserException( "Illegal character 0x" + Integer.toHexString(((int) ch)) + " found in comment", this, null ); + } if ( normalizeIgnorableWS ) { if ( ch == '\r' ) diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test.java b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test.java new file mode 100644 index 00000000..6bd331ee --- /dev/null +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test.java @@ -0,0 +1,901 @@ +package org.codehaus.plexus.util.xml.pull; + +import static org.junit.Assert.assertTrue; +import static org.junit.Assert.fail; + +import java.io.BufferedReader; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileReader; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.Reader; +import java.nio.charset.Charset; +import java.nio.file.Files; +import java.nio.file.Paths; + +import org.junit.Before; +import org.junit.Test; + +/** + * Test class that execute a particular set of tests associated to a TESCASES tag from the XML W3C Conformance Tests. + * TESCASES PROFILE:
IBM XML Conformance Test Suite - Production 2
+ * XML test files base folder:
xmlconf/ibm/
+ * + * @author Gabriel Belingueres + */ +public class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test { + + final static File testResourcesDir = new File("src/test/resources/", "xmlconf/ibm/"); + + MXParser parser; + + @Before + public void setUp() { + parser = new MXParser(); + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n01.xml
+ * Test URI:
not-wf/P02/ibm02n01.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x00
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n01xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n01.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x00" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x0 found in comment" ) ); + } + } + + + /** + * Test ID:
ibm-not-wf-P02-ibm02n02.xml
+ * Test URI:
not-wf/P02/ibm02n02.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x01
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n02xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n02.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x01" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x1 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n03.xml
+ * Test URI:
not-wf/P02/ibm02n03.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x02
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n03xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n03.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x02" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x2 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n04.xml
+ * Test URI:
not-wf/P02/ibm02n04.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x03
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n04xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n04.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x03" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x3 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n05.xml
+ * Test URI:
not-wf/P02/ibm02n05.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x04
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n05xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n05.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x04" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x4 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n06.xml
+ * Test URI:
not-wf/P02/ibm02n06.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x05
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n06xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n06.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x05" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x5 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n07.xml
+ * Test URI:
not-wf/P02/ibm02n07.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x06
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n07xml() throws IOException { + try(Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n07.xml"))) { + parser.setInput(reader); + while (parser.nextToken() != XmlPullParser.END_DOCUMENT); + fail("Tests a comment which contains an illegal Char: #x06"); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x6 found in comment" ) ); + } + } + + + /** + * Test ID:
ibm-not-wf-P02-ibm02n08.xml
+ * Test URI:
not-wf/P02/ibm02n08.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x07
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n08xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n08.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x07" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x7 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n09.xml
+ * Test URI:
not-wf/P02/ibm02n09.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x08
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n09xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n09.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x08" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x8 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n10.xml
+ * Test URI:
not-wf/P02/ibm02n10.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x0B
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n10xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n10.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x0B" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0xb found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n11.xml
+ * Test URI:
not-wf/P02/ibm02n11.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x0C
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n11xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n11.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x0C" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0xc found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n12.xml
+ * Test URI:
not-wf/P02/ibm02n12.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x0E
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n12xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n12.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x0E" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0xe found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n13.xml
+ * Test URI:
not-wf/P02/ibm02n13.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x0F
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n13xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n13.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x0F" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0xf found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n14.xml
+ * Test URI:
not-wf/P02/ibm02n14.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x10
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n14xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n14.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x10" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x10 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n15.xml
+ * Test URI:
not-wf/P02/ibm02n15.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x11
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n15xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n15.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x11" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x11 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n16.xml
+ * Test URI:
not-wf/P02/ibm02n16.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x12
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n16xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n16.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x12" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x12 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n17.xml
+ * Test URI:
not-wf/P02/ibm02n17.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x13
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n17xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n17.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x13" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x13 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n18.xml
+ * Test URI:
not-wf/P02/ibm02n18.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x14
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n18xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n18.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x14" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x14 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n19.xml
+ * Test URI:
not-wf/P02/ibm02n19.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x15
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n19xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n19.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x15" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x15 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n20.xml
+ * Test URI:
not-wf/P02/ibm02n20.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x16
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n20xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n20.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x16" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x16 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n21.xml
+ * Test URI:
not-wf/P02/ibm02n21.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x17
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n21xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n21.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x17" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x17 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n22.xml
+ * Test URI:
not-wf/P02/ibm02n22.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x18
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n22xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n22.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x18" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x18 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n23.xml
+ * Test URI:
not-wf/P02/ibm02n23.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x19
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n23xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n23.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x19" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x19 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n24.xml
+ * Test URI:
not-wf/P02/ibm02n24.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x1A
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n24xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n24.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x1A" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x1a found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n25.xml
+ * Test URI:
not-wf/P02/ibm02n25.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x1B
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n25xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n25.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x1B" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x1b found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n26.xml
+ * Test URI:
not-wf/P02/ibm02n26.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x1C
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n26xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n26.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x1C" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x1c found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n27.xml
+ * Test URI:
not-wf/P02/ibm02n27.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x1D
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n27xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n27.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x1D" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x1d found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n28.xml
+ * Test URI:
not-wf/P02/ibm02n28.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x1E
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n28xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n28.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x1E" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x1e found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n29.xml
+ * Test URI:
not-wf/P02/ibm02n29.xml
+ * Comment:
Tests a comment which contains an illegal Char: #x1F
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n29xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n29.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #x1F" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0x1f found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n30.xml
+ * Test URI:
not-wf/P02/ibm02n30.xml
+ * Comment:
Tests a comment which contains an illegal Char: #xD800
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + * + * NOTE: This test file is malformed into the original test suite, so I skip it. + */ + //@Test + public void testibm_not_wf_P02_ibm02n30xml() + throws IOException + { + try ( BufferedReader reader = + Files.newBufferedReader( Paths.get( testResourcesDir.getCanonicalPath(), "not-wf/P02/ibm02n30.xml" ), + Charset.forName( "ISO-8859-15" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #xD800" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0xd800 found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n31.xml
+ * Test URI:
not-wf/P02/ibm02n31.xml
+ * Comment:
Tests a comment which contains an illegal Char: #xDFFF
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + * + * NOTE: This test file is malformed into the original test suite, so I skip it. + */ + //@Test + public void testibm_not_wf_P02_ibm02n31xml() + throws IOException + { + try ( FileInputStream is = new FileInputStream( new File( testResourcesDir, "not-wf/P02/ibm02n31.xml" ) ); + InputStreamReader reader = new InputStreamReader( is, "ISO-8859-15" ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #xDFFF" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0xdfff found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n32.xml
+ * Test URI:
not-wf/P02/ibm02n32.xml
+ * Comment:
Tests a comment which contains an illegal Char: #xFFFE
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n32xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n32.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #xFFFE" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0xfffe found in comment" ) ); + } + } + + /** + * Test ID:
ibm-not-wf-P02-ibm02n33.xml
+ * Test URI:
not-wf/P02/ibm02n33.xml
+ * Comment:
Tests a comment which contains an illegal Char: #xFFFF
+ * Sections:
2.2
+ * Version: + * + * @throws IOException if there is an I/O error + */ + @Test + public void testibm_not_wf_P02_ibm02n33xml() + throws IOException + { + try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n33.xml" ) ) ) + { + parser.setInput( reader ); + while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) + ; + fail( "Tests a comment which contains an illegal Char: #xFFFF" ); + } + catch ( XmlPullParserException e ) + { + assertTrue( e.getMessage().contains( "Illegal character 0xffff found in comment" ) ); + } + } + +} diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n01.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n01.xml new file mode 100755 index 0000000000000000000000000000000000000000..867386a2554372d074e54c84da733df0c905174d GIT binary patch literal 91 zcmcCfbn$l%i41U6NXpO8R*2^1vQc#ParJfe3xS9@`bFCDa>W9%jiRouf@e-nYIM_Lxr literal 0 HcmV?d00001 diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n02.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n02.xml new file mode 100755 index 00000000..09845356 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n02.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n03.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n03.xml new file mode 100755 index 00000000..8fb98db7 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n03.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n04.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n04.xml new file mode 100755 index 00000000..35ebb812 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n04.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n05.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n05.xml new file mode 100755 index 00000000..4847c52f --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n05.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n06.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n06.xml new file mode 100755 index 00000000..f4b3fea9 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n06.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n07.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n07.xml new file mode 100755 index 00000000..70b39a42 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n07.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n08.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n08.xml new file mode 100755 index 00000000..d6a07f97 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n08.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n09.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n09.xml new file mode 100755 index 00000000..868f4f75 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n09.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n10.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n10.xml new file mode 100755 index 00000000..127b117d --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n10.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n11.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n11.xml new file mode 100755 index 00000000..3e9b2637 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n11.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n12.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n12.xml new file mode 100755 index 00000000..3aa6b223 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n12.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n13.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n13.xml new file mode 100755 index 00000000..b5da2def --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n13.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n14.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n14.xml new file mode 100755 index 00000000..fb475617 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n14.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n15.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n15.xml new file mode 100755 index 00000000..90e4ce29 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n15.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n16.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n16.xml new file mode 100755 index 00000000..ef0bd5b5 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n16.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n17.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n17.xml new file mode 100755 index 00000000..cb6d61f9 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n17.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n18.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n18.xml new file mode 100755 index 00000000..6d6277d6 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n18.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n19.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n19.xml new file mode 100755 index 00000000..96580223 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n19.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n20.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n20.xml new file mode 100755 index 00000000..0257c823 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n20.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n21.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n21.xml new file mode 100755 index 00000000..89a0b1ad --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n21.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n22.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n22.xml new file mode 100755 index 00000000..3bf0e2d1 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n22.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n23.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n23.xml new file mode 100755 index 00000000..7ce8a85f --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n23.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n24.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n24.xml new file mode 100755 index 00000000..5a2ea3ec --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n24.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n25.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n25.xml new file mode 100755 index 00000000..fb6454ea --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n25.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n26.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n26.xml new file mode 100755 index 00000000..004f5e04 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n26.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n27.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n27.xml new file mode 100755 index 00000000..0cab04e7 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n27.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n28.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n28.xml new file mode 100755 index 00000000..34b1e0a2 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n28.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n29.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n29.xml new file mode 100755 index 00000000..70b9f721 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n29.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n30.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n30.xml new file mode 100755 index 00000000..67a849f6 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n30.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n31.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n31.xml new file mode 100755 index 00000000..c39e5008 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n31.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n32.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n32.xml new file mode 100755 index 00000000..37df65c0 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n32.xml @@ -0,0 +1,6 @@ + +]> + + diff --git a/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n33.xml b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n33.xml new file mode 100755 index 00000000..8ff5faf6 --- /dev/null +++ b/src/test/resources/xmlconf/ibm/not-wf/P02/ibm02n33.xml @@ -0,0 +1,6 @@ + +]> + + From 99058404ffa17e34176dff455caae7e5adb97eea Mon Sep 17 00:00:00 2001 From: Gabriel Belingueres Date: Thu, 21 Jan 2021 19:43:54 -0300 Subject: [PATCH 2/2] Force tests testibm_not_wf_P02_ibm02n32xml and testibm_not_wf_P02_ibm02n33xml to open XML file with UTF-8 encoding, since Windows default encoding (cp1252) decodes another char. --- ...s_Test_IBMXMLConformanceTestSuite_Production2_Test.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test.java b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test.java index 6bd331ee..65ee879f 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production2_Test.java @@ -11,6 +11,7 @@ import java.io.InputStreamReader; import java.io.Reader; import java.nio.charset.Charset; +import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.nio.file.Paths; @@ -859,7 +860,8 @@ public void testibm_not_wf_P02_ibm02n31xml() public void testibm_not_wf_P02_ibm02n32xml() throws IOException { - try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n32.xml" ) ) ) + try ( FileInputStream is = new FileInputStream( new File( testResourcesDir, "not-wf/P02/ibm02n32.xml" ) ); + InputStreamReader reader = new InputStreamReader( is, StandardCharsets.UTF_8 ) ) { parser.setInput( reader ); while ( parser.nextToken() != XmlPullParser.END_DOCUMENT ) @@ -885,7 +887,8 @@ public void testibm_not_wf_P02_ibm02n32xml() public void testibm_not_wf_P02_ibm02n33xml() throws IOException { - try ( Reader reader = new FileReader( new File( testResourcesDir, "not-wf/P02/ibm02n33.xml" ) ) ) + try ( FileInputStream is = new FileInputStream( new File( testResourcesDir, "not-wf/P02/ibm02n33.xml" ) ); + InputStreamReader reader = new InputStreamReader( is, StandardCharsets.UTF_8 ) ) { parser.setInput( reader ); while ( parser.nextToken() != XmlPullParser.END_DOCUMENT )