From 6306391f4233209605ef2c173abcdd4e6c5b3d55 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sun, 2 Nov 2025 22:44:46 +0000 Subject: [PATCH] JUnit Jupiter best practices Co-authored-by: Moderne --- .../util/xml/PrettyPrintXMLWriterTest.java | 3 +- .../plexus/util/xml/XmlStreamReaderTest.java | 26 ++++---- .../plexus/util/xml/XmlStreamWriterTest.java | 24 +++---- .../plexus/util/xml/Xpp3DomBuilderTest.java | 10 +-- .../codehaus/plexus/util/xml/Xpp3DomTest.java | 14 ++--- ...onformanceTestSuite_Production24_Test.java | 19 +++--- ...ConformanceTestSuite_Production2_Test.java | 62 +++++++++---------- ...onformanceTestSuite_Production32_Test.java | 16 ++--- ...onformanceTestSuite_Production66_Test.java | 32 +++++----- ...onformanceTestSuite_Production80_Test.java | 13 ++-- .../plexus/util/xml/pull/MXParserTest.java | 40 +++++------- .../util/xml/pull/MXSerializerTest.java | 3 +- ..._BjoernHoehrmannviaHST2013_09_18_Test.java | 16 +++-- 13 files changed, 129 insertions(+), 149 deletions(-) diff --git a/src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java b/src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java index f26631d..940ba37 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java @@ -19,7 +19,6 @@ import javax.swing.text.html.HTML.Tag; import java.io.File; -import java.io.IOException; import java.io.StringWriter; import java.io.Writer; import java.nio.charset.StandardCharsets; @@ -173,7 +172,7 @@ void testendElementAlreadyClosed() { */ @Disabled("This test is only relevant on JDK 1.7, which is not supported anymore") @Test - void issue51DetectJava7ConcatenationBug() throws IOException { + void issue51DetectJava7ConcatenationBug() throws Exception { File dir = new File("target/test-xml"); if (!dir.exists()) { assertTrue(dir.mkdir(), "cannot create directory test-xml"); diff --git a/src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java b/src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java index 17ba924..e775d4b 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java @@ -113,7 +113,7 @@ private static void checkXmlStreamReader(String text, String encoding, String ef * @throws java.io.IOException if any. */ @Test - void noXmlHeader() throws IOException { + void noXmlHeader() throws Exception { String xml = "text with no XML header"; checkXmlContent(xml, "UTF-8"); checkXmlContent(xml, "UTF-8", BOM_UTF8); @@ -125,7 +125,7 @@ void noXmlHeader() throws IOException { * @throws java.io.IOException if any. */ @Test - void defaultEncoding() throws IOException { + void defaultEncoding() throws Exception { checkXmlStreamReader(TEXT_UNICODE, null, "UTF-8"); checkXmlStreamReader(TEXT_UNICODE, null, "UTF-8", BOM_UTF8); } @@ -136,7 +136,7 @@ void defaultEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void utf8Encoding() throws IOException { + void utf8Encoding() throws Exception { checkXmlStreamReader(TEXT_UNICODE, "UTF-8"); checkXmlStreamReader(TEXT_UNICODE, "UTF-8", BOM_UTF8); } @@ -147,7 +147,7 @@ void utf8Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void utf16Encoding() throws IOException { + void utf16Encoding() throws Exception { checkXmlStreamReader(TEXT_UNICODE, "UTF-16", "UTF-16BE", null); checkXmlStreamReader(TEXT_UNICODE, "UTF-16", "UTF-16LE", BOM_UTF16LE); checkXmlStreamReader(TEXT_UNICODE, "UTF-16", "UTF-16BE", BOM_UTF16BE); @@ -159,7 +159,7 @@ void utf16Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void utf16beEncoding() throws IOException { + void utf16beEncoding() throws Exception { checkXmlStreamReader(TEXT_UNICODE, "UTF-16BE"); } @@ -169,7 +169,7 @@ void utf16beEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void utf16leEncoding() throws IOException { + void utf16leEncoding() throws Exception { checkXmlStreamReader(TEXT_UNICODE, "UTF-16LE"); } @@ -179,7 +179,7 @@ void utf16leEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void latin1Encoding() throws IOException { + void latin1Encoding() throws Exception { checkXmlStreamReader(TEXT_LATIN1, "ISO-8859-1"); } @@ -189,7 +189,7 @@ void latin1Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void latin7Encoding() throws IOException { + void latin7Encoding() throws Exception { checkXmlStreamReader(TEXT_LATIN7, "ISO-8859-7"); } @@ -199,7 +199,7 @@ void latin7Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void latin15Encoding() throws IOException { + void latin15Encoding() throws Exception { checkXmlStreamReader(TEXT_LATIN15, "ISO-8859-15"); } @@ -209,7 +209,7 @@ void latin15Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void euc_jpEncoding() throws IOException { + void euc_jpEncoding() throws Exception { checkXmlStreamReader(TEXT_EUC_JP, "EUC-JP"); } @@ -219,7 +219,7 @@ void euc_jpEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void ebcdicEncoding() throws IOException { + void ebcdicEncoding() throws Exception { checkXmlStreamReader("simple text in EBCDIC", "CP1047"); } @@ -242,7 +242,7 @@ void inappropriateEncoding() { * @throws java.io.IOException if any. */ @Test - void encodingAttribute() throws IOException { + void encodingAttribute() throws Exception { String xml = ""; checkXmlContent(xml, "US-ASCII"); @@ -269,7 +269,7 @@ void encodingAttribute() throws IOException { * @throws java.io.IOException if any. */ @Test - void encodingPatternWithManyAttributes() throws IOException { + void encodingPatternWithManyAttributes() throws Exception { // Test with many attributes before encoding to ensure non-greedy matching works String xml = ""; checkXmlContent(xml, "UTF-8"); diff --git a/src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java b/src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java index a7028d9..9c7f799 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java @@ -77,7 +77,7 @@ private static void checkXmlWriter(String text, String encoding) throws IOExcept * @throws java.io.IOException if any. */ @Test - void noXmlHeader() throws IOException { + void noXmlHeader() throws Exception { String xml = "text with no XML header"; checkXmlContent(xml, "UTF-8"); } @@ -88,7 +88,7 @@ void noXmlHeader() throws IOException { * @throws java.io.IOException if any. */ @Test - void empty() throws IOException { + void empty() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); XmlStreamWriter writer = new XmlStreamWriter(out); writer.flush(); @@ -105,7 +105,7 @@ void empty() throws IOException { * @throws java.io.IOException if any. */ @Test - void defaultEncoding() throws IOException { + void defaultEncoding() throws Exception { checkXmlWriter(TEXT_UNICODE, null); } @@ -115,7 +115,7 @@ void defaultEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void utf8Encoding() throws IOException { + void utf8Encoding() throws Exception { checkXmlWriter(TEXT_UNICODE, "UTF-8"); } @@ -125,7 +125,7 @@ void utf8Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void utf16Encoding() throws IOException { + void utf16Encoding() throws Exception { checkXmlWriter(TEXT_UNICODE, "UTF-16"); } @@ -135,7 +135,7 @@ void utf16Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void utf16beEncoding() throws IOException { + void utf16beEncoding() throws Exception { checkXmlWriter(TEXT_UNICODE, "UTF-16BE"); } @@ -145,7 +145,7 @@ void utf16beEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void utf16leEncoding() throws IOException { + void utf16leEncoding() throws Exception { checkXmlWriter(TEXT_UNICODE, "UTF-16LE"); } @@ -155,7 +155,7 @@ void utf16leEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void latin1Encoding() throws IOException { + void latin1Encoding() throws Exception { checkXmlWriter(TEXT_LATIN1, "ISO-8859-1"); } @@ -165,7 +165,7 @@ void latin1Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void latin7Encoding() throws IOException { + void latin7Encoding() throws Exception { checkXmlWriter(TEXT_LATIN7, "ISO-8859-7"); } @@ -175,7 +175,7 @@ void latin7Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void latin15Encoding() throws IOException { + void latin15Encoding() throws Exception { checkXmlWriter(TEXT_LATIN15, "ISO-8859-15"); } @@ -185,7 +185,7 @@ void latin15Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void euc_jpEncoding() throws IOException { + void euc_jpEncoding() throws Exception { checkXmlWriter(TEXT_EUC_JP, "EUC-JP"); } @@ -195,7 +195,7 @@ void euc_jpEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - void ebcdicEncoding() throws IOException { + void ebcdicEncoding() throws Exception { checkXmlWriter("simple text in EBCDIC", "CP1047"); } } diff --git a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomBuilderTest.java b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomBuilderTest.java index a490540..e7e281e 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomBuilderTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomBuilderTest.java @@ -128,11 +128,7 @@ void unclosedXml() { try { Xpp3DomBuilder.build(new StringReader(domString)); } catch (XmlPullParserException expected) { - // correct - assertTrue(true); } catch (IOException expected) { - // this will do too - assertTrue(true); } } @@ -143,7 +139,7 @@ void unclosedXml() { * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - void escapingInContent() throws IOException, XmlPullParserException { + void escapingInContent() throws Exception { Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(getEncodedString())); assertEquals("\"text\"", dom.getChild("el").getValue(), "Check content value"); @@ -162,7 +158,7 @@ void escapingInContent() throws IOException, XmlPullParserException { * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - void escapingInAttributes() throws IOException, XmlPullParserException { + void escapingInAttributes() throws Exception { String s = getAttributeEncodedString(); Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(s)); @@ -181,7 +177,7 @@ void escapingInAttributes() throws IOException, XmlPullParserException { * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - void inputLocationTracking() throws IOException, XmlPullParserException { + void inputLocationTracking() throws Exception { Xpp3DomBuilder.InputLocationBuilder ilb = new Xpp3DomBuilder.InputLocationBuilder() { public Object toInputLocation(XmlPullParser parser) { return parser.getLineNumber(); // store only line number as a simple Integer diff --git a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java index 9c3d85f..4499965 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java @@ -16,7 +16,6 @@ * limitations under the License. */ -import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; import java.util.HashMap; @@ -26,7 +25,6 @@ import org.apache.maven.api.xml.XmlNode; import org.apache.maven.internal.xml.XmlNodeImpl; import org.codehaus.plexus.util.xml.pull.XmlPullParser; -import org.codehaus.plexus.util.xml.pull.XmlPullParserException; import org.junit.jupiter.api.Test; import static org.junit.jupiter.api.Assertions.*; @@ -220,7 +218,7 @@ void equals() { * @throws java.io.IOException if any. */ @Test - void equalsIsNullSafe() throws XmlPullParserException, IOException { + void equalsIsNullSafe() throws Exception { String testDom = "onetwo"; Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(testDom)); @@ -242,7 +240,7 @@ void equalsIsNullSafe() throws XmlPullParserException, IOException { * @throws java.io.IOException if any. */ @Test - void shouldOverwritePluginConfigurationSubItemsByDefault() throws XmlPullParserException, IOException { + void shouldOverwritePluginConfigurationSubItemsByDefault() throws Exception { String parentConfigStr = "onetwo"; Xpp3Dom parentConfig = Xpp3DomBuilder.build(new StringReader(parentConfigStr), new FixedInputLocationBuilder("parent")); @@ -268,7 +266,7 @@ void shouldOverwritePluginConfigurationSubItemsByDefault() throws XmlPullParserE * @throws java.io.IOException if any. */ @Test - void shouldMergePluginConfigurationSubItemsWithMergeAttributeSet() throws XmlPullParserException, IOException { + void shouldMergePluginConfigurationSubItemsWithMergeAttributeSet() throws Exception { String parentConfigStr = "onetwo"; Xpp3Dom parentConfig = Xpp3DomBuilder.build(new StringReader(parentConfigStr), new FixedInputLocationBuilder("parent")); @@ -342,7 +340,7 @@ void shouldCopyRecessiveChildrenNotPresentInTarget() throws Exception { * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - void dupeChildren() throws IOException, XmlPullParserException { + void dupeChildren() throws Exception { String dupes = "xy"; Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(dupes)); assertNotNull(dom); @@ -482,7 +480,7 @@ void combineKeys() throws Exception { } @Test - void preserveDominantBlankValue() throws XmlPullParserException, IOException { + void preserveDominantBlankValue() throws Exception { String lhs = " "; String rhs = "recessive"; @@ -497,7 +495,7 @@ void preserveDominantBlankValue() throws XmlPullParserException, IOException { } @Test - void preserveDominantEmptyNode() throws XmlPullParserException, IOException { + void preserveDominantEmptyNode() throws Exception { String lhs = ""; String rhs = "recessive"; diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production24_Test.java b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production24_Test.java index 2e1fd7f..296282c 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production24_Test.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production24_Test.java @@ -2,7 +2,6 @@ import java.io.File; import java.io.FileReader; -import java.io.IOException; import java.io.Reader; import org.junit.jupiter.api.BeforeEach; @@ -44,7 +43,7 @@ void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n01xml() throws IOException { + void testibm_not_wf_P24_ibm24n01xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n01.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -67,7 +66,7 @@ void testibm_not_wf_P24_ibm24n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n02xml() throws IOException { + void testibm_not_wf_P24_ibm24n02xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n02.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -89,7 +88,7 @@ void testibm_not_wf_P24_ibm24n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n03xml() throws IOException { + void testibm_not_wf_P24_ibm24n03xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n03.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -111,7 +110,7 @@ void testibm_not_wf_P24_ibm24n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n04xml() throws IOException { + void testibm_not_wf_P24_ibm24n04xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n04.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -133,7 +132,7 @@ void testibm_not_wf_P24_ibm24n04xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n05xml() throws IOException { + void testibm_not_wf_P24_ibm24n05xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n05.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -155,7 +154,7 @@ void testibm_not_wf_P24_ibm24n05xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n06xml() throws IOException { + void testibm_not_wf_P24_ibm24n06xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n06.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -176,7 +175,7 @@ void testibm_not_wf_P24_ibm24n06xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n07xml() throws IOException { + void testibm_not_wf_P24_ibm24n07xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n07.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -197,7 +196,7 @@ void testibm_not_wf_P24_ibm24n07xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n08xml() throws IOException { + void testibm_not_wf_P24_ibm24n08xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n08.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -219,7 +218,7 @@ void testibm_not_wf_P24_ibm24n08xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P24_ibm24n09xml() throws IOException { + void testibm_not_wf_P24_ibm24n09xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n09.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) 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 43279b8..1095a50 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 @@ -52,7 +52,7 @@ void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n01xml() throws IOException { + void testibm_not_wf_P02_ibm02n01xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n01.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -73,7 +73,7 @@ void testibm_not_wf_P02_ibm02n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n02xml() throws IOException { + void testibm_not_wf_P02_ibm02n02xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n02.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -94,7 +94,7 @@ void testibm_not_wf_P02_ibm02n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n03xml() throws IOException { + void testibm_not_wf_P02_ibm02n03xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n03.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -115,7 +115,7 @@ void testibm_not_wf_P02_ibm02n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n04xml() throws IOException { + void testibm_not_wf_P02_ibm02n04xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n04.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -136,7 +136,7 @@ void testibm_not_wf_P02_ibm02n04xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n05xml() throws IOException { + void testibm_not_wf_P02_ibm02n05xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n05.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -157,7 +157,7 @@ void testibm_not_wf_P02_ibm02n05xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n06xml() throws IOException { + void testibm_not_wf_P02_ibm02n06xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n06.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -178,7 +178,7 @@ void testibm_not_wf_P02_ibm02n06xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n07xml() throws IOException { + void testibm_not_wf_P02_ibm02n07xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n07.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -199,7 +199,7 @@ void testibm_not_wf_P02_ibm02n07xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n08xml() throws IOException { + void testibm_not_wf_P02_ibm02n08xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n08.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -220,7 +220,7 @@ void testibm_not_wf_P02_ibm02n08xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n09xml() throws IOException { + void testibm_not_wf_P02_ibm02n09xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n09.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -241,7 +241,7 @@ void testibm_not_wf_P02_ibm02n09xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n10xml() throws IOException { + void testibm_not_wf_P02_ibm02n10xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n10.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -262,7 +262,7 @@ void testibm_not_wf_P02_ibm02n10xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n11xml() throws IOException { + void testibm_not_wf_P02_ibm02n11xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n11.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -283,7 +283,7 @@ void testibm_not_wf_P02_ibm02n11xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n12xml() throws IOException { + void testibm_not_wf_P02_ibm02n12xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n12.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -304,7 +304,7 @@ void testibm_not_wf_P02_ibm02n12xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n13xml() throws IOException { + void testibm_not_wf_P02_ibm02n13xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n13.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -325,7 +325,7 @@ void testibm_not_wf_P02_ibm02n13xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n14xml() throws IOException { + void testibm_not_wf_P02_ibm02n14xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n14.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -346,7 +346,7 @@ void testibm_not_wf_P02_ibm02n14xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n15xml() throws IOException { + void testibm_not_wf_P02_ibm02n15xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n15.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -367,7 +367,7 @@ void testibm_not_wf_P02_ibm02n15xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n16xml() throws IOException { + void testibm_not_wf_P02_ibm02n16xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n16.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -388,7 +388,7 @@ void testibm_not_wf_P02_ibm02n16xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n17xml() throws IOException { + void testibm_not_wf_P02_ibm02n17xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n17.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -409,7 +409,7 @@ void testibm_not_wf_P02_ibm02n17xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n18xml() throws IOException { + void testibm_not_wf_P02_ibm02n18xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n18.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -430,7 +430,7 @@ void testibm_not_wf_P02_ibm02n18xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n19xml() throws IOException { + void testibm_not_wf_P02_ibm02n19xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n19.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -451,7 +451,7 @@ void testibm_not_wf_P02_ibm02n19xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n20xml() throws IOException { + void testibm_not_wf_P02_ibm02n20xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n20.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -472,7 +472,7 @@ void testibm_not_wf_P02_ibm02n20xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n21xml() throws IOException { + void testibm_not_wf_P02_ibm02n21xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n21.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -493,7 +493,7 @@ void testibm_not_wf_P02_ibm02n21xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n22xml() throws IOException { + void testibm_not_wf_P02_ibm02n22xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n22.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -514,7 +514,7 @@ void testibm_not_wf_P02_ibm02n22xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n23xml() throws IOException { + void testibm_not_wf_P02_ibm02n23xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n23.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -535,7 +535,7 @@ void testibm_not_wf_P02_ibm02n23xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n24xml() throws IOException { + void testibm_not_wf_P02_ibm02n24xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n24.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -556,7 +556,7 @@ void testibm_not_wf_P02_ibm02n24xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n25xml() throws IOException { + void testibm_not_wf_P02_ibm02n25xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n25.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -577,7 +577,7 @@ void testibm_not_wf_P02_ibm02n25xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n26xml() throws IOException { + void testibm_not_wf_P02_ibm02n26xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n26.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -598,7 +598,7 @@ void testibm_not_wf_P02_ibm02n26xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n27xml() throws IOException { + void testibm_not_wf_P02_ibm02n27xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n27.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -619,7 +619,7 @@ void testibm_not_wf_P02_ibm02n27xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n28xml() throws IOException { + void testibm_not_wf_P02_ibm02n28xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n28.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -640,7 +640,7 @@ void testibm_not_wf_P02_ibm02n28xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n29xml() throws IOException { + void testibm_not_wf_P02_ibm02n29xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P02/ibm02n29.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -710,7 +710,7 @@ public void testibm_not_wf_P02_ibm02n31xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n32xml() throws IOException { + void testibm_not_wf_P02_ibm02n32xml() throws Exception { try (FileInputStream is = new FileInputStream(new File(testResourcesDir, "not-wf/P02/ibm02n32.xml")); InputStreamReader reader = new InputStreamReader(is, StandardCharsets.UTF_8)) { parser.setInput(reader); @@ -732,7 +732,7 @@ void testibm_not_wf_P02_ibm02n32xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P02_ibm02n33xml() throws IOException { + void testibm_not_wf_P02_ibm02n33xml() throws Exception { try (FileInputStream is = new FileInputStream(new File(testResourcesDir, "not-wf/P02/ibm02n33.xml")); InputStreamReader reader = new InputStreamReader(is, StandardCharsets.UTF_8)) { parser.setInput(reader); diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production32_Test.java b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production32_Test.java index cda5f99..bd9dd15 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production32_Test.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production32_Test.java @@ -45,7 +45,7 @@ void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P32_ibm32n01xml() throws IOException { + void testibm_not_wf_P32_ibm32n01xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n01.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -67,7 +67,7 @@ void testibm_not_wf_P32_ibm32n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P32_ibm32n02xml() throws IOException { + void testibm_not_wf_P32_ibm32n02xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n02.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -89,7 +89,7 @@ void testibm_not_wf_P32_ibm32n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P32_ibm32n03xml() throws IOException { + void testibm_not_wf_P32_ibm32n03xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n03.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -110,7 +110,7 @@ void testibm_not_wf_P32_ibm32n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P32_ibm32n04xml() throws IOException { + void testibm_not_wf_P32_ibm32n04xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n04.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -131,7 +131,7 @@ void testibm_not_wf_P32_ibm32n04xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P32_ibm32n05xml() throws IOException { + void testibm_not_wf_P32_ibm32n05xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n05.xml"))) { parser.setInput(reader); @@ -153,7 +153,7 @@ void testibm_not_wf_P32_ibm32n05xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P32_ibm32n06xml() throws IOException { + void testibm_not_wf_P32_ibm32n06xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n06.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -174,7 +174,7 @@ void testibm_not_wf_P32_ibm32n06xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P32_ibm32n07xml() throws IOException { + void testibm_not_wf_P32_ibm32n07xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n07.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -195,7 +195,7 @@ void testibm_not_wf_P32_ibm32n07xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P32_ibm32n08xml() throws IOException { + void testibm_not_wf_P32_ibm32n08xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n08.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production66_Test.java b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production66_Test.java index c08b114..44e860a 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production66_Test.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production66_Test.java @@ -1,9 +1,7 @@ package org.codehaus.plexus.util.xml.pull; import java.io.File; -import java.io.FileNotFoundException; import java.io.FileReader; -import java.io.IOException; import java.io.Reader; import org.junit.jupiter.api.BeforeEach; @@ -45,7 +43,7 @@ void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n01xml() throws IOException { + void testibm_not_wf_P66_ibm66n01xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n01.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -67,7 +65,7 @@ void testibm_not_wf_P66_ibm66n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n02xml() throws IOException { + void testibm_not_wf_P66_ibm66n02xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n02.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -89,7 +87,7 @@ void testibm_not_wf_P66_ibm66n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n03xml() throws IOException { + void testibm_not_wf_P66_ibm66n03xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n03.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -111,7 +109,7 @@ void testibm_not_wf_P66_ibm66n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n04xml() throws IOException { + void testibm_not_wf_P66_ibm66n04xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n04.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -135,7 +133,7 @@ void testibm_not_wf_P66_ibm66n04xml() throws IOException { * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - void testibm_not_wf_P66_ibm66n05xml() throws FileNotFoundException, IOException, XmlPullParserException { + void testibm_not_wf_P66_ibm66n05xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n05.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -157,7 +155,7 @@ void testibm_not_wf_P66_ibm66n05xml() throws FileNotFoundException, IOException, * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n06xml() throws IOException { + void testibm_not_wf_P66_ibm66n06xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n06.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -179,7 +177,7 @@ void testibm_not_wf_P66_ibm66n06xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n07xml() throws IOException { + void testibm_not_wf_P66_ibm66n07xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n07.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -201,7 +199,7 @@ void testibm_not_wf_P66_ibm66n07xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n08xml() throws IOException { + void testibm_not_wf_P66_ibm66n08xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n08.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -223,7 +221,7 @@ void testibm_not_wf_P66_ibm66n08xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n09xml() throws IOException { + void testibm_not_wf_P66_ibm66n09xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n09.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -245,7 +243,7 @@ void testibm_not_wf_P66_ibm66n09xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n10xml() throws IOException { + void testibm_not_wf_P66_ibm66n10xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n10.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -267,7 +265,7 @@ void testibm_not_wf_P66_ibm66n10xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n11xml() throws IOException { + void testibm_not_wf_P66_ibm66n11xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n11.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -289,7 +287,7 @@ void testibm_not_wf_P66_ibm66n11xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n12xml() throws IOException { + void testibm_not_wf_P66_ibm66n12xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n12.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -311,7 +309,7 @@ void testibm_not_wf_P66_ibm66n12xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n13xml() throws IOException { + void testibm_not_wf_P66_ibm66n13xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n13.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -333,7 +331,7 @@ void testibm_not_wf_P66_ibm66n13xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n14xml() throws IOException { + void testibm_not_wf_P66_ibm66n14xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n14.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -355,7 +353,7 @@ void testibm_not_wf_P66_ibm66n14xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P66_ibm66n15xml() throws IOException { + void testibm_not_wf_P66_ibm66n15xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n15.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production80_Test.java b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production80_Test.java index a2b2c16..8fbe74c 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production80_Test.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production80_Test.java @@ -2,7 +2,6 @@ import java.io.File; import java.io.FileReader; -import java.io.IOException; import java.io.Reader; import org.junit.jupiter.api.BeforeEach; @@ -44,7 +43,7 @@ void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P80_ibm80n01xml() throws IOException { + void testibm_not_wf_P80_ibm80n01xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n01.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -66,7 +65,7 @@ void testibm_not_wf_P80_ibm80n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P80_ibm80n02xml() throws IOException { + void testibm_not_wf_P80_ibm80n02xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n02.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -88,7 +87,7 @@ void testibm_not_wf_P80_ibm80n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P80_ibm80n03xml() throws IOException { + void testibm_not_wf_P80_ibm80n03xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n03.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -111,7 +110,7 @@ void testibm_not_wf_P80_ibm80n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P80_ibm80n04xml() throws IOException { + void testibm_not_wf_P80_ibm80n04xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n04.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -133,7 +132,7 @@ void testibm_not_wf_P80_ibm80n04xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P80_ibm80n05xml() throws IOException { + void testibm_not_wf_P80_ibm80n05xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n05.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -155,7 +154,7 @@ void testibm_not_wf_P80_ibm80n05xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testibm_not_wf_P80_ibm80n06xml() throws IOException { + void testibm_not_wf_P80_ibm80n06xml() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n06.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java b/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java index 7a817b9..2979e4b 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/MXParserTest.java @@ -122,7 +122,7 @@ void predefinedEntities() throws Exception { * @throws java.io.IOException if any. */ @Test - void entityReplacementMap() throws XmlPullParserException, IOException { + void entityReplacementMap() throws Exception { EntityReplacementMap erm = new EntityReplacementMap(new String[][] {{"abc", "CDE"}, {"EFG", "HIJ"}}); MXParser parser = new MXParser(erm); @@ -856,13 +856,12 @@ void xmlDeclVersionEncodingStandaloneNoSpace() throws Exception { * @since 3.4.1 */ @Test - void encodingISO88591NewXmlReader() throws IOException { + void encodingISO88591NewXmlReader() throws Exception { try (Reader reader = new XmlStreamReader(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { MXParser parser = new MXParser(); parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) ; - assertTrue(true); } catch (XmlPullParserException e) { fail("should not raise exception: " + e); } @@ -876,14 +875,13 @@ void encodingISO88591NewXmlReader() throws IOException { * @since 3.4.1 */ @Test - void encodingISO88591InputStream() throws IOException { + void encodingISO88591InputStream() throws Exception { try (InputStream input = Files.newInputStream(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { MXParser parser = new MXParser(); parser.setInput(input, null); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) ; - assertTrue(true); } catch (XmlPullParserException e) { fail("should not raise exception: " + e); } @@ -899,7 +897,7 @@ void encodingISO88591InputStream() throws IOException { * @since 3.4.2 */ @Test - void encodingISO88591StringReader() throws IOException { + void encodingISO88591StringReader() throws Exception { String xmlFileContents; try (Reader reader = new XmlStreamReader(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { xmlFileContents = readAllFrom(reader); @@ -911,7 +909,6 @@ void encodingISO88591StringReader() throws IOException { parser.setInput(new StringReader(xmlFileContents)); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) ; - assertTrue(true); }, "should not raise exception: "); } @@ -926,7 +923,7 @@ void encodingISO88591StringReader() throws IOException { * @since 3.5.2 */ @Test - void encodingISO88591NewReader() throws IOException { + void encodingISO88591NewReader() throws Exception { // NOTE: if using Files.newBufferedReader(path, StandardCharsets.UTF-8), the reader will throw an exception // because the decoder created by new InputStreamReader() is lenient while the one created by // Files.newBufferedReader() is not. @@ -937,7 +934,6 @@ void encodingISO88591NewReader() throws IOException { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) ; - assertTrue(true); } catch (XmlPullParserException e) { fail("should not raise exception: " + e); } @@ -953,14 +949,13 @@ void encodingISO88591NewReader() throws IOException { * @since 3.5.2 */ @Test - void encodingISO88591InputStreamEncoded() throws IOException { + void encodingISO88591InputStreamEncoded() throws Exception { try (InputStream input = Files.newInputStream(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { MXParser parser = new MXParser(); parser.setInput(input, StandardCharsets.UTF_8.name()); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) ; - assertTrue(true); } catch (XmlPullParserException e) { fail("should not raise exception: " + e); } @@ -974,13 +969,12 @@ void encodingISO88591InputStreamEncoded() throws IOException { * @since 3.4.1 */ @Test - void encodingUTF8NewXmlReader() throws IOException { + void encodingUTF8NewXmlReader() throws Exception { try (Reader reader = new XmlStreamReader(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { MXParser parser = new MXParser(); parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) ; - assertTrue(true); } catch (XmlPullParserException e) { fail("should not raise exception: " + e); } @@ -1130,7 +1124,7 @@ void customEntityNotFoundInAttrTokenize() throws Exception { * @since 3.4.2 */ @Test - void docdeclTextWithEntitiesUnix() throws IOException { + void docdeclTextWithEntitiesUnix() throws Exception { testDocdeclTextWithEntities("test-entities-UNIX.xml"); } @@ -1146,7 +1140,7 @@ void docdeclTextWithEntitiesUnix() throws IOException { * @since 3.4.2 */ @Test - void docdeclTextWithEntitiesDOS() throws IOException { + void docdeclTextWithEntitiesDOS() throws Exception { testDocdeclTextWithEntities("test-entities-DOS.xml"); } @@ -1183,7 +1177,7 @@ private void testDocdeclTextWithEntities(String filename) throws IOException { * @since 3.4.2 */ @Test - void docdeclTextWithEntitiesInAttributesUnix() throws IOException { + void docdeclTextWithEntitiesInAttributesUnix() throws Exception { testDocdeclTextWithEntitiesInAttributes("test-entities-in-attr-UNIX.xml"); } @@ -1199,7 +1193,7 @@ void docdeclTextWithEntitiesInAttributesUnix() throws IOException { * @since 3.4.2 */ @Test - void docdeclTextWithEntitiesInAttributesDOS() throws IOException { + void docdeclTextWithEntitiesInAttributesDOS() throws Exception { testDocdeclTextWithEntitiesInAttributes("test-entities-in-attr-DOS.xml"); } @@ -1254,7 +1248,7 @@ private void testDocdeclTextWithEntitiesInAttributes(String filename) throws IOE * @since 3.4.2 */ @Test - void entityRefTextUnix() throws IOException { + void entityRefTextUnix() throws Exception { testEntityRefText("\n"); } @@ -1268,7 +1262,7 @@ void entityRefTextUnix() throws IOException { * @since 3.4.2 */ @Test - void entityRefTextDOS() throws IOException { + void entityRefTextDOS() throws Exception { testEntityRefText("\r\n"); } @@ -1333,7 +1327,7 @@ private void testEntityRefText(String newLine) throws IOException { * @since 3.4.2 */ @Test - void entityReplacement() throws IOException { + void entityReplacement() throws Exception { String input = "

  

"; assertDoesNotThrow( @@ -1376,7 +1370,7 @@ void entityReplacement() throws IOException { * @since 3.4.2 */ @Test - void replacementInPCArrayWithShorterCharArray() throws IOException { + void replacementInPCArrayWithShorterCharArray() throws Exception { String input = "]>" + "

&&foo;&tritPos;

"; @@ -1419,7 +1413,7 @@ void replacementInPCArrayWithShorterCharArray() throws IOException { * Ensures emoji can be parsed correctly */ @Test - void unicode() throws IOException { + void unicode() throws Exception { String input = ""; try { @@ -1478,7 +1472,7 @@ void processingInstructionTokenizeAfterXMLDeclAndBeforeFirstTag() throws Excepti @ParameterizedTest @ValueSource(strings = {" ", "\n", "\r", "\r\n", " ", "\n "}) - void blankAtBeginning(String ws) throws XmlPullParserException, IOException { + void blankAtBeginning(String ws) throws Exception { String xml = "nnn"; MXParser parser = new MXParser(); diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/MXSerializerTest.java b/src/test/java/org/codehaus/plexus/util/xml/pull/MXSerializerTest.java index bc5f026..4862672 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/MXSerializerTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/MXSerializerTest.java @@ -1,6 +1,5 @@ package org.codehaus.plexus.util.xml.pull; -import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import java.util.Arrays; @@ -61,7 +60,7 @@ private String expectedOutput() { * Tests MJAVADOC-793. */ @Test - void writeNullValues() throws IOException { + void writeNullValues() throws Exception { // should be no-ops new MXSerializer().writeElementContent(null, null); new MXSerializer().writeAttributeValue(null, null); diff --git a/src/test/java/org/codehaus/plexus/util/xml/pull/eduni_misc_Test_BjoernHoehrmannviaHST2013_09_18_Test.java b/src/test/java/org/codehaus/plexus/util/xml/pull/eduni_misc_Test_BjoernHoehrmannviaHST2013_09_18_Test.java index e362c2f..0c3d26b 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/pull/eduni_misc_Test_BjoernHoehrmannviaHST2013_09_18_Test.java +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/eduni_misc_Test_BjoernHoehrmannviaHST2013_09_18_Test.java @@ -46,7 +46,7 @@ void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - void testhst_bh_001() throws IOException { + void testhst_bh_001() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "001.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -67,7 +67,7 @@ void testhst_bh_001() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testhst_bh_002() throws IOException { + void testhst_bh_002() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "002.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -88,7 +88,7 @@ void testhst_bh_002() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testhst_bh_003() throws IOException { + void testhst_bh_003() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "003.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -109,7 +109,7 @@ void testhst_bh_003() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testhst_bh_004() throws IOException { + void testhst_bh_004() throws Exception { try (Reader reader = new FileReader(new File(testResourcesDir, "004.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -140,7 +140,6 @@ public void testhst_bh_005() throws IOException { ; fail("xmlns:xml is an attribute as far as validation is concerned and must be declared"); } catch (XmlPullParserException e) { - assertTrue(true); } } @@ -163,7 +162,6 @@ public void testhst_bh_006() throws IOException { ; fail("xmlns:foo is an attribute as far as validation is concerned and must be declared"); } catch (XmlPullParserException e) { - assertTrue(true); } } @@ -177,7 +175,7 @@ public void testhst_bh_006() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testhst_lhs_007() throws IOException { + void testhst_lhs_007() throws Exception { try (InputStream is = new FileInputStream(new File(testResourcesDir, "007.xml"))) { parser.setInput(is, null); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -198,7 +196,7 @@ void testhst_lhs_007() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testhst_lhs_008() throws IOException { + void testhst_lhs_008() throws Exception { try (InputStream is = new FileInputStream(new File(testResourcesDir, "008.xml"))) { parser.setInput(is, null); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -219,7 +217,7 @@ void testhst_lhs_008() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - void testhst_lhs_009() throws IOException { + void testhst_lhs_009() throws Exception { try (InputStream is = new FileInputStream(new File(testResourcesDir, "009.xml"))) { parser.setInput(is, null); while (parser.nextToken() != XmlPullParser.END_DOCUMENT)