From 72c06a0a2d0793a79b1ea6b68eb453cc1ee9c867 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Tue, 4 Jul 2023 10:14:21 +0200 Subject: [PATCH 01/45] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 35d72bc..32cff2a 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ limitations under the License. plexus-xml - 4.0.2 + 4.0.3-SNAPSHOT Plexus XML Utilities A collection of various utility classes to ease working with XML. @@ -33,7 +33,7 @@ limitations under the License. scm:git:https://github.com/codehaus-plexus/plexus-xml.git ${project.scm.connection} - plexus-xml-4.0.2 + master https://github.com/codehaus-plexus/plexus-xml/tree/${project.scm.tag}/ @@ -48,7 +48,7 @@ limitations under the License. - 2023-07-04T08:14:13Z + 2023-07-04T08:14:21Z From bcf34dcd790955f6381efe442f2d24dbe2b8170e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Sat, 9 Sep 2023 14:46:23 +0200 Subject: [PATCH 02/45] describe plexus-xml update to maven-xml-impl --- README.md | 4 +++- src/site/markdown/index.md | 8 ++++++++ src/site/site.xml | 3 +++ 3 files changed, 14 insertions(+), 1 deletion(-) create mode 100644 src/site/markdown/index.md diff --git a/README.md b/README.md index 379ac1e..89bb19d 100644 --- a/README.md +++ b/README.md @@ -4,7 +4,9 @@ Plexus-Xml [![Build Status](https://github.com/codehaus-plexus/plexus-xml/actions/workflows/maven.yml/badge.svg)](https://github.com/codehaus-plexus/plexus-xml/actions) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) -This library consists of XML classes (`org.codehaus.plexus.util.xml`, and `ReaderFactory`/`WriterFactory` moved from `org.codehaus.plexus.util`) that have been extracted from [`plexus-utils`](https://github.com/codehaus-plexus/plexus-utils/) 4. +This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`) that: +1. have been extracted from [`plexus-utils`](https://github.com/codehaus-plexus/plexus-utils/) 4, +2. then updated to use [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/maven-xml-impl) For publishing [the site](https://codehaus-plexus.github.io/plexus-xml/) do the following: diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md new file mode 100644 index 0000000..823a3b2 --- /dev/null +++ b/src/site/markdown/index.md @@ -0,0 +1,8 @@ +## Plexus XML Utilities + +A collection of various utility classes to ease working with XML. + +This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`): +1. that have been extracted from [`plexus-utils`](../plexus-utils/) 4, +2. then updated to use [`maven-xml-api`](https://maven.apache.org/ref/4.0.0-alpha-7/api/maven-api-xml/)/[`maven-xml-impl`](https://maven.apache.org/ref/4.0.0-alpha-7/maven-xml-impl/index.html) + diff --git a/src/site/site.xml b/src/site/site.xml index 3cb8f1a..43170c2 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -4,6 +4,9 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd"> + + + From 07f63919296984b2c5f5d30a433411c0715b2e9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Mon, 11 Sep 2023 22:42:12 +0200 Subject: [PATCH 03/45] explain 3 vs 4 --- README.md | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 89bb19d..73f800c 100644 --- a/README.md +++ b/README.md @@ -2,11 +2,18 @@ Plexus-Xml ============ [![Build Status](https://github.com/codehaus-plexus/plexus-xml/actions/workflows/maven.yml/badge.svg)](https://github.com/codehaus-plexus/plexus-xml/actions) +[![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`) that: -1. have been extracted from [`plexus-utils`](https://github.com/codehaus-plexus/plexus-utils/) 4, -2. then updated to use [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/maven-xml-impl) + +1. have been extracted from [`plexus-utils`](https://github.com/codehaus-plexus/plexus-utils/) 4:\ + this step is released as `plexus-xml` 3, maintained in [3.x branch](tree/3.x)\ + [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml), + +2. then updated to use [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/maven-xml-impl):\ + this is the `master` branch from which `plexus-xml` 4 is released\ + [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) For publishing [the site](https://codehaus-plexus.github.io/plexus-xml/) do the following: From 7bfeb09596b87f4a28add4699bbd663fe6dcbd6e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Tue, 12 Sep 2023 08:08:47 +0200 Subject: [PATCH 04/45] clarify "Maven 4-specific" --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 73f800c..ce4cf7a 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.co this step is released as `plexus-xml` 3, maintained in [3.x branch](tree/3.x)\ [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml), -2. then updated to use [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/maven-xml-impl):\ +2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/maven-xml-impl):\ this is the `master` branch from which `plexus-xml` 4 is released\ [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) From aa82ed33a2e8c178fcd2a2106f57023d6947d84e Mon Sep 17 00:00:00 2001 From: Tamas Cservenak Date: Wed, 13 Dec 2023 06:57:39 +0100 Subject: [PATCH 05/45] Update dependencies (#26) * Update dependencies Changes: * parent POM to 16 * remove sole use of hamcrest * jmh update * nullcheck --- pom.xml | 14 ++++---------- .../plexus/util/xml/pull/MXParserTest.java | 16 ++++++++-------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/pom.xml b/pom.xml index 32cff2a..f554aeb 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.codehaus.plexus plexus - 13 + 16 plexus-xml @@ -55,7 +55,7 @@ limitations under the License. org.apache.maven maven-xml-impl - 4.0.0-alpha-7 + 4.0.0-alpha-8 org.eclipse.sisu @@ -66,13 +66,13 @@ limitations under the License. org.openjdk.jmh jmh-core - 1.36 + 1.37 test org.openjdk.jmh jmh-generator-annprocess - 1.36 + 1.37 test @@ -80,12 +80,6 @@ limitations under the License. junit-jupiter test - - org.hamcrest - hamcrest - 2.2 - test - org.codehaus.plexus plexus-utils 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 f7c9d68..0359b8c 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 @@ -33,8 +33,6 @@ import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; -import static org.hamcrest.MatcherAssert.*; -import static org.hamcrest.Matchers.*; import static org.junit.jupiter.api.Assertions.*; /** @@ -1485,14 +1483,16 @@ void testBlankAtBeginning(String ws) throws XmlPullParserException, IOException MXParser parser = new MXParser(); parser.setInput(new StringReader(ws + xml)); - assertThat( - assertThrows(XmlPullParserException.class, parser::next).getMessage(), - containsString("XMLDecl is only allowed as first characters in input")); + + String message; + message = assertThrows(XmlPullParserException.class, parser::next).getMessage(); + assertNotNull(message); + assertTrue(message.contains("XMLDecl is only allowed as first characters in input"), message); parser.setInput(new StringReader(ws + xml)); assertEquals(XmlPullParser.IGNORABLE_WHITESPACE, parser.nextToken()); - assertThat( - assertThrows(XmlPullParserException.class, parser::nextToken).getMessage(), - containsString("processing instruction can not have PITarget with reserved xml name")); + message = assertThrows(XmlPullParserException.class, parser::nextToken).getMessage(); + assertNotNull(message); + assertTrue(message.contains("processing instruction can not have PITarget with reserved xml name"), message); } } From e6a6427dd4c1e0b40832ea027f5c102cd739ef85 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Wed, 13 Dec 2023 20:59:12 +0100 Subject: [PATCH 06/45] Upgrade to Maven 4.0.0-alpha-9 (#27) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f554aeb..489292b 100644 --- a/pom.xml +++ b/pom.xml @@ -55,7 +55,7 @@ limitations under the License. org.apache.maven maven-xml-impl - 4.0.0-alpha-8 + 4.0.0-alpha-9 org.eclipse.sisu From 784ff955e0944bea8b3a15254ad7ce06ae72dc20 Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Wed, 13 Dec 2023 21:00:16 +0100 Subject: [PATCH 07/45] [maven-release-plugin] prepare release plexus-xml-4.0.3 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 489292b..f8a0bf3 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ limitations under the License. plexus-xml - 4.0.3-SNAPSHOT + 4.0.3 Plexus XML Utilities A collection of various utility classes to ease working with XML. @@ -33,7 +33,7 @@ limitations under the License. scm:git:https://github.com/codehaus-plexus/plexus-xml.git ${project.scm.connection} - master + plexus-xml-4.0.3 https://github.com/codehaus-plexus/plexus-xml/tree/${project.scm.tag}/ @@ -48,7 +48,7 @@ limitations under the License. - 2023-07-04T08:14:21Z + 2023-12-13T20:00:11Z From 0407d057cc482589f6e4047c60baa738a4276ffd Mon Sep 17 00:00:00 2001 From: Guillaume Nodet Date: Wed, 13 Dec 2023 21:00:19 +0100 Subject: [PATCH 08/45] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index f8a0bf3..d8c91ae 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ limitations under the License. plexus-xml - 4.0.3 + 4.0.4-SNAPSHOT Plexus XML Utilities A collection of various utility classes to ease working with XML. @@ -33,7 +33,7 @@ limitations under the License. scm:git:https://github.com/codehaus-plexus/plexus-xml.git ${project.scm.connection} - plexus-xml-4.0.3 + master https://github.com/codehaus-plexus/plexus-xml/tree/${project.scm.tag}/ @@ -48,7 +48,7 @@ limitations under the License. - 2023-12-13T20:00:11Z + 2023-12-13T20:00:19Z From c9d72affa12e1109be3003911af1b12e6d79026a Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 16:09:36 +0200 Subject: [PATCH 09/45] Remove special chars from xml output (#28) --------- Co-authored-by: Michael Osipov <1983-01-06@gmx.net> --- .../plexus/util/xml/PrettyPrintXMLWriter.java | 25 ++++++-- .../plexus/util/xml/pull/MXSerializer.java | 17 ++---- .../plexus/util/xml/Xpp3DomWriterTest.java | 12 +++- .../util/xml/pull/MXSerializerTest.java | 58 +++++++++++++++++++ 4 files changed, 93 insertions(+), 19 deletions(-) create mode 100644 src/test/java/org/codehaus/plexus/util/xml/pull/MXSerializerTest.java diff --git a/src/main/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriter.java b/src/main/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriter.java index e089c5c..cd35289 100644 --- a/src/main/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriter.java +++ b/src/main/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriter.java @@ -24,9 +24,9 @@ import java.util.regex.Pattern; /** - * Implementation of XMLWriter which emits nicely formatted documents. - * + *

Implementation of XMLWriter which emits nicely formatted documents.

* + *

C0n control characters except \n, \r, and \t are omitted from output

*/ public class PrettyPrintXMLWriter implements XMLWriter { /** Line separator ("\n" on UNIX) */ @@ -186,7 +186,7 @@ private void writeText(String text, boolean escapeXml) { finishTag(); if (escapeXml) { - text = escapeXml(text); + text = escapeXmlText(text); } write(StringUtils.unifyLineSeparators(text, lineSeparator)); @@ -226,10 +226,12 @@ private static String escapeXml(String text) { private static final Pattern crlf = Pattern.compile(crlf_str); - private static final Pattern lowers = Pattern.compile("([\000-\037])"); + private static final Pattern lowers = Pattern.compile("([\\x00-\\x1F])"); + + private static final Pattern illegalC0Characters = Pattern.compile("([\\x00-\\x08\\x0B-\\x0C\\x0E-\\x1F])"); private static String escapeXmlAttribute(String text) { - text = escapeXml(text); + text = escapeXmlText(text); // Windows Matcher crlfmatcher = crlf.matcher(text); @@ -247,6 +249,19 @@ private static String escapeXmlAttribute(String text) { return b.toString(); } + private static String escapeXmlText(String text) { + text = escapeXml(text); + + Matcher matcher = illegalC0Characters.matcher(text); + StringBuffer b = new StringBuffer(); + while (matcher.find()) { + matcher = matcher.appendReplacement(b, ""); + } + matcher.appendTail(b); + + return b.toString(); + } + /** {@inheritDoc} */ @Override public void addAttribute(String key, String value) { diff --git a/src/main/java/org/codehaus/plexus/util/xml/pull/MXSerializer.java b/src/main/java/org/codehaus/plexus/util/xml/pull/MXSerializer.java index e69d28f..ffd0ede 100644 --- a/src/main/java/org/codehaus/plexus/util/xml/pull/MXSerializer.java +++ b/src/main/java/org/codehaus/plexus/util/xml/pull/MXSerializer.java @@ -24,6 +24,7 @@ *
  • PROPERTY_SERIALIZER_INDENTATION *
  • PROPERTY_SERIALIZER_LINE_SEPARATOR * + *

    C0n control characters except \n, \r, and \t are omitted from output

    */ public class MXSerializer implements XmlSerializer { protected static final String XML_URI = "http://www.w3.org/XML/1998/namespace"; @@ -943,19 +944,9 @@ protected void writeElementContent(String text, Writer out) throws IOException { // out.write(';'); // pos = i + 1; } else { - throw new IllegalStateException( - "character " + Integer.toString(ch) + " is not allowed in output" + getLocation()); - // in XML 1.1 legal are [#x1-#xD7FF] - // if(ch > 0) { - // if(i > pos) out.write(text.substring(pos, i)); - // out.write("&#"); - // out.write(Integer.toString(ch)); - // out.write(';'); - // pos = i + 1; - // } else { - // throw new IllegalStateException( - // "character zero is not allowed in XML 1.1 output"+getLocation()); - // } + // skip special char + if (i > pos) out.write(text.substring(pos, i)); + pos = i + 1; } } if (seenBracket) { diff --git a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomWriterTest.java b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomWriterTest.java index 7f7f321..233bdd5 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomWriterTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomWriterTest.java @@ -82,6 +82,12 @@ private String createExpectedXML(boolean escape) { buf.append(LS); buf.append(" "); buf.append(LS); + if (escape) { + buf.append(" special-char-"); + } else { + buf.append(" special-char-" + (char) 7 + ""); + } + buf.append(LS); buf.append(""); return buf.toString(); @@ -95,7 +101,7 @@ private Xpp3Dom createXpp3Dom() { dom.addChild(el1); Xpp3Dom el2 = new Xpp3Dom("el2"); - el2.setAttribute("att2", "attribute2\nnextline"); + el2.setAttribute("att2", "attribute2\nnextline" + (char) 7); dom.addChild(el2); Xpp3Dom el3 = new Xpp3Dom("el3"); @@ -119,6 +125,10 @@ private Xpp3Dom createXpp3Dom() { el7.setValue("element7\n&\"\'<>"); el6.addChild(el7); + Xpp3Dom el8 = new Xpp3Dom("el8"); + el8.setValue("special-char-" + (char) 7); + + dom.addChild(el8); return dom; } } 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 new file mode 100644 index 0000000..8b66c23 --- /dev/null +++ b/src/test/java/org/codehaus/plexus/util/xml/pull/MXSerializerTest.java @@ -0,0 +1,58 @@ +package org.codehaus.plexus.util.xml.pull; + +import java.io.StringReader; +import java.io.StringWriter; +import java.util.Arrays; + +import org.junit.jupiter.api.Test; + +import static org.junit.jupiter.api.Assertions.assertEquals; + +class MXSerializerTest { + + @Test + void testSerialize() throws Exception { + + StringWriter writer = new StringWriter(); + + MXSerializer sr = new MXSerializer(); + sr.setOutput(writer); + + sr.startDocument(null, Boolean.TRUE); + sr.startTag(null, "root"); + for (int i : Arrays.asList(8, 9, 10, 11, 13, 15)) { + sr.startTag(null, "char"); + sr.text(Character.getName(i) + ": " + ((char) i)); + sr.endTag(null, "char"); + } + + sr.endTag(null, "root"); + sr.endDocument(); + assertEquals(expectedOutput(), writer.toString()); + } + + @Test + void testDeserialize() throws Exception { + MXParser parser = new MXParser(); + parser.setInput(new StringReader(expectedOutput())); + int eventType = parser.getEventType(); + + while (eventType != XmlPullParser.END_DOCUMENT) { + eventType = parser.next(); + } + } + + private String expectedOutput() { + StringBuilder out = new StringBuilder(); + out.append(""); + out.append(""); + out.append("BACKSPACE: "); + out.append("CHARACTER TABULATION: \t"); + out.append("LINE FEED (LF): \n"); + out.append("LINE TABULATION: "); + out.append("CARRIAGE RETURN (CR): \r"); + out.append("SHIFT IN: "); + out.append(""); + return out.toString(); + } +} From b459efdba485e89fedc9aaba16da4c29bbd7d18c Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 16:46:48 +0200 Subject: [PATCH 10/45] Release drafter for master and 3.x branch --- .github/release-drafter.yml | 3 ++- .github/workflows/release-drafter-3x.yml | 14 ++++++++++++++ ...ease-drafter.yml => release-drafter-master.yml} | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/release-drafter-3x.yml rename .github/workflows/{release-drafter.yml => release-drafter-master.yml} (84%) diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index c7f5948..e85fffb 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,2 +1,3 @@ _extends: .github -tag-template: plexus-utils-$NEXT_MINOR_VERSION +tag-template: plexus-xml-$NEXT_MINOR_VERSION +filter-by-commitish: true \ No newline at end of file diff --git a/.github/workflows/release-drafter-3x.yml b/.github/workflows/release-drafter-3x.yml new file mode 100644 index 0000000..4f0194e --- /dev/null +++ b/.github/workflows/release-drafter-3x.yml @@ -0,0 +1,14 @@ +name: Release Drafter +on: + push: + branches: + - 3.x +jobs: + update_release_draft: + runs-on: ubuntu-latest + steps: + - uses: release-drafter/release-drafter@v5 + with: + commitish: '3.x' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter-master.yml similarity index 84% rename from .github/workflows/release-drafter.yml rename to .github/workflows/release-drafter-master.yml index 4000f8c..1975882 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter-master.yml @@ -8,5 +8,7 @@ jobs: runs-on: ubuntu-latest steps: - uses: release-drafter/release-drafter@v5 + with: + commitish: 'master' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From e9ce97841e3f5ad6d2392f3f31c7521fd01e59e1 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 17:30:34 +0200 Subject: [PATCH 11/45] Add dependabot for 3.x branch --- .github/dependabot.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/dependabot.yml b/.github/dependabot.yml index b76b895..99bc7a7 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,9 +2,24 @@ version: 2 updates: - package-ecosystem: "maven" directory: "/" + target-branch: "master" schedule: interval: "daily" + + - package-ecosystem: "maven" + directory: "/" + target-branch: "3.x" + schedule: + interval: "daily" + + - package-ecosystem: "github-actions" + directory: "/" + target-branch: "master" + schedule: + interval: "daily" + - package-ecosystem: "github-actions" directory: "/" + target-branch: "3.x" schedule: interval: "daily" From ba61f627b9a56e933e3264cb1217bf19b688bbd6 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 17:46:58 +0200 Subject: [PATCH 12/45] Separate release-drafter config per branch --- .github/release-drafter-3.x.yml | 6 ++++++ .github/release-drafter-master.yml | 6 ++++++ .github/release-drafter.yml | 3 --- .github/workflows/release-drafter-3x.yml | 2 +- .github/workflows/release-drafter-master.yml | 2 +- 5 files changed, 14 insertions(+), 5 deletions(-) create mode 100644 .github/release-drafter-3.x.yml create mode 100644 .github/release-drafter-master.yml delete mode 100644 .github/release-drafter.yml diff --git a/.github/release-drafter-3.x.yml b/.github/release-drafter-3.x.yml new file mode 100644 index 0000000..1eb29b3 --- /dev/null +++ b/.github/release-drafter-3.x.yml @@ -0,0 +1,6 @@ +_extends: .github +name-template: '3.$MINOR.$PATCH' +tag-template: 'plexus-xml-3.$MINOR.$PATCH' +version-template: '3.$MINOR.$PATCH' +commitish: '3.x' +filter-by-commitish: true diff --git a/.github/release-drafter-master.yml b/.github/release-drafter-master.yml new file mode 100644 index 0000000..4634f2c --- /dev/null +++ b/.github/release-drafter-master.yml @@ -0,0 +1,6 @@ +_extends: .github +name-template: '4.$MINOR.$PATCH' +tag-template: 'plexus-xml-4.$MINOR.$PATCH' +version-template: '4.$MINOR.$PATCH' +commitish: 'master' +filter-by-commitish: true diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml deleted file mode 100644 index e85fffb..0000000 --- a/.github/release-drafter.yml +++ /dev/null @@ -1,3 +0,0 @@ -_extends: .github -tag-template: plexus-xml-$NEXT_MINOR_VERSION -filter-by-commitish: true \ No newline at end of file diff --git a/.github/workflows/release-drafter-3x.yml b/.github/workflows/release-drafter-3x.yml index 4f0194e..2a61684 100644 --- a/.github/workflows/release-drafter-3x.yml +++ b/.github/workflows/release-drafter-3x.yml @@ -9,6 +9,6 @@ jobs: steps: - uses: release-drafter/release-drafter@v5 with: - commitish: '3.x' + config-name: 'release-drafter-3.x.yml' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter-master.yml b/.github/workflows/release-drafter-master.yml index 1975882..caead2f 100644 --- a/.github/workflows/release-drafter-master.yml +++ b/.github/workflows/release-drafter-master.yml @@ -9,6 +9,6 @@ jobs: steps: - uses: release-drafter/release-drafter@v5 with: - commitish: 'master' + config-name: 'release-drafter-master.yml' env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From d3fe89dcbdb0d033588036ca65e90fbdc63d9c31 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 17:53:48 +0200 Subject: [PATCH 13/45] Fix release-drafter global file name --- .github/release-drafter-3.x.yml | 2 +- .github/release-drafter-master.yml | 2 +- .github/workflows/release-drafter-3x.yml | 2 +- .github/workflows/release-drafter-master.yml | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/release-drafter-3.x.yml b/.github/release-drafter-3.x.yml index 1eb29b3..8f6cf63 100644 --- a/.github/release-drafter-3.x.yml +++ b/.github/release-drafter-3.x.yml @@ -1,4 +1,4 @@ -_extends: .github +_extends: .github:.github/release-drafter.yml name-template: '3.$MINOR.$PATCH' tag-template: 'plexus-xml-3.$MINOR.$PATCH' version-template: '3.$MINOR.$PATCH' diff --git a/.github/release-drafter-master.yml b/.github/release-drafter-master.yml index 4634f2c..f509f28 100644 --- a/.github/release-drafter-master.yml +++ b/.github/release-drafter-master.yml @@ -1,4 +1,4 @@ -_extends: .github +_extends: .github:.github/release-drafter.yml name-template: '4.$MINOR.$PATCH' tag-template: 'plexus-xml-4.$MINOR.$PATCH' version-template: '4.$MINOR.$PATCH' diff --git a/.github/workflows/release-drafter-3x.yml b/.github/workflows/release-drafter-3x.yml index 2a61684..4f26406 100644 --- a/.github/workflows/release-drafter-3x.yml +++ b/.github/workflows/release-drafter-3x.yml @@ -1,4 +1,4 @@ -name: Release Drafter +name: Release Drafter 3.x on: push: branches: diff --git a/.github/workflows/release-drafter-master.yml b/.github/workflows/release-drafter-master.yml index caead2f..b9401ad 100644 --- a/.github/workflows/release-drafter-master.yml +++ b/.github/workflows/release-drafter-master.yml @@ -1,4 +1,4 @@ -name: Release Drafter +name: Release Drafter Master on: push: branches: From 1977a0b146e54b54820764e3fdcb3d309cf4e22c Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 17:58:47 +0200 Subject: [PATCH 14/45] Fix release-drafter config --- .github/release-drafter-3.x.yml | 8 ++++---- .github/release-drafter-master.yml | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/release-drafter-3.x.yml b/.github/release-drafter-3.x.yml index 8f6cf63..fb6e79d 100644 --- a/.github/release-drafter-3.x.yml +++ b/.github/release-drafter-3.x.yml @@ -1,6 +1,6 @@ _extends: .github:.github/release-drafter.yml -name-template: '3.$MINOR.$PATCH' -tag-template: 'plexus-xml-3.$MINOR.$PATCH' -version-template: '3.$MINOR.$PATCH' -commitish: '3.x' +name-template: 3.$MINOR.$PATCH +tag-template: plexus-xml-3.$MINOR.$PATCH +version-template: 3.$MINOR.$PATCH +commitish: 3.x filter-by-commitish: true diff --git a/.github/release-drafter-master.yml b/.github/release-drafter-master.yml index f509f28..fe998d8 100644 --- a/.github/release-drafter-master.yml +++ b/.github/release-drafter-master.yml @@ -1,6 +1,6 @@ _extends: .github:.github/release-drafter.yml -name-template: '4.$MINOR.$PATCH' -tag-template: 'plexus-xml-4.$MINOR.$PATCH' -version-template: '4.$MINOR.$PATCH' -commitish: 'master' +name-template: 4.$MINOR.$PATCH' +tag-template: plexus-xml-4.$MINOR.$PATCH +version-template: 4.$MINOR.$PATCH +commitish: master filter-by-commitish: true From 14d3067a15b4f444db45efe904fcf6d4ec295b50 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 18:04:40 +0200 Subject: [PATCH 15/45] Fix release-drafter config --- .github/release-drafter-3.x.yml | 2 -- .github/release-drafter-master.yml | 2 -- 2 files changed, 4 deletions(-) diff --git a/.github/release-drafter-3.x.yml b/.github/release-drafter-3.x.yml index fb6e79d..54ffe36 100644 --- a/.github/release-drafter-3.x.yml +++ b/.github/release-drafter-3.x.yml @@ -1,6 +1,4 @@ _extends: .github:.github/release-drafter.yml -name-template: 3.$MINOR.$PATCH -tag-template: plexus-xml-3.$MINOR.$PATCH version-template: 3.$MINOR.$PATCH commitish: 3.x filter-by-commitish: true diff --git a/.github/release-drafter-master.yml b/.github/release-drafter-master.yml index fe998d8..920fd96 100644 --- a/.github/release-drafter-master.yml +++ b/.github/release-drafter-master.yml @@ -1,6 +1,4 @@ _extends: .github:.github/release-drafter.yml -name-template: 4.$MINOR.$PATCH' -tag-template: plexus-xml-4.$MINOR.$PATCH version-template: 4.$MINOR.$PATCH commitish: master filter-by-commitish: true From b97a574847f0769f697cca871983920eae3bd0df Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 18:06:29 +0200 Subject: [PATCH 16/45] Fix release-drafter config --- .github/release-drafter-3.x.yml | 1 + .github/release-drafter-master.yml | 1 + 2 files changed, 2 insertions(+) diff --git a/.github/release-drafter-3.x.yml b/.github/release-drafter-3.x.yml index 54ffe36..2b81e3e 100644 --- a/.github/release-drafter-3.x.yml +++ b/.github/release-drafter-3.x.yml @@ -1,4 +1,5 @@ _extends: .github:.github/release-drafter.yml +tag-template: plexus-xml-$NEXT_PATCH_VERSION version-template: 3.$MINOR.$PATCH commitish: 3.x filter-by-commitish: true diff --git a/.github/release-drafter-master.yml b/.github/release-drafter-master.yml index 920fd96..6c322a8 100644 --- a/.github/release-drafter-master.yml +++ b/.github/release-drafter-master.yml @@ -1,4 +1,5 @@ _extends: .github:.github/release-drafter.yml +tag-template: plexus-xml-$NEXT_PATCH_VERSION version-template: 4.$MINOR.$PATCH commitish: master filter-by-commitish: true From d56dbc91dec6ed4f380b89d5a626777b9a1473ec Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Mon, 20 May 2024 21:16:27 +0200 Subject: [PATCH 17/45] Config release-drafter on master --- .github/workflows/release-drafter-3x.yml | 14 -------------- ...ease-drafter-master.yml => release-drafter.yml} | 2 +- 2 files changed, 1 insertion(+), 15 deletions(-) delete mode 100644 .github/workflows/release-drafter-3x.yml rename .github/workflows/{release-drafter-master.yml => release-drafter.yml} (74%) diff --git a/.github/workflows/release-drafter-3x.yml b/.github/workflows/release-drafter-3x.yml deleted file mode 100644 index 4f26406..0000000 --- a/.github/workflows/release-drafter-3x.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Release Drafter 3.x -on: - push: - branches: - - 3.x -jobs: - update_release_draft: - runs-on: ubuntu-latest - steps: - - uses: release-drafter/release-drafter@v5 - with: - config-name: 'release-drafter-3.x.yml' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/release-drafter-master.yml b/.github/workflows/release-drafter.yml similarity index 74% rename from .github/workflows/release-drafter-master.yml rename to .github/workflows/release-drafter.yml index b9401ad..ab919cb 100644 --- a/.github/workflows/release-drafter-master.yml +++ b/.github/workflows/release-drafter.yml @@ -9,6 +9,6 @@ jobs: steps: - uses: release-drafter/release-drafter@v5 with: - config-name: 'release-drafter-master.yml' + config-name: 'release-drafter-master.yml' # located in .github/ in default branch env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 4ee6e6319ce10d3fba92015e143f59ba1f749d7d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 20 May 2024 21:04:34 +0000 Subject: [PATCH 18/45] --- updated-dependencies: - dependency-name: release-drafter/release-drafter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- .github/workflows/release-drafter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release-drafter.yml b/.github/workflows/release-drafter.yml index ab919cb..e10bac4 100644 --- a/.github/workflows/release-drafter.yml +++ b/.github/workflows/release-drafter.yml @@ -7,7 +7,7 @@ jobs: update_release_draft: runs-on: ubuntu-latest steps: - - uses: release-drafter/release-drafter@v5 + - uses: release-drafter/release-drafter@v6 with: config-name: 'release-drafter-master.yml' # located in .github/ in default branch env: From e0a18411cd1309c82b5e1867c144008c1dccf0c8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 00:13:00 +0200 Subject: [PATCH 19/45] Bump org.codehaus.plexus:plexus-utils from 4.0.0 to 4.0.1 (#37) updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-utils dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d8c91ae..63e6872 100644 --- a/pom.xml +++ b/pom.xml @@ -83,7 +83,7 @@ limitations under the License. org.codehaus.plexus plexus-utils - 4.0.0 + 4.0.1 test From d84cafe193583cc1e5295c0ab5c98485fc42b48d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 00:20:59 +0200 Subject: [PATCH 20/45] Bump org.codehaus.plexus:plexus from 16 to 17 (#35) updated-dependencies: - dependency-name: org.codehaus.plexus:plexus dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 63e6872..ab13bd1 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.codehaus.plexus plexus - 16 + 17 plexus-xml From 6bccd346ebe060dc427d8cf16097966eb2e7bf3c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 21 May 2024 22:42:32 +0200 Subject: [PATCH 21/45] Bump org.codehaus.plexus:plexus from 17 to 18 (#39) updated-dependencies: - dependency-name: org.codehaus.plexus:plexus dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ab13bd1..b565192 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.codehaus.plexus plexus - 17 + 18 plexus-xml From 43dbdca6780fd60371e63f7e94d938b482e2edc9 Mon Sep 17 00:00:00 2001 From: Gary Gregory Date: Mon, 20 May 2024 10:33:23 -0400 Subject: [PATCH 22/45] Allow nulls for write elements in MXSerializer https://issues.apache.org/jira/browse/MJAVADOC-793 --- .../plexus/util/xml/pull/MXSerializer.java | 6 ++++++ .../plexus/util/xml/pull/MXSerializerTest.java | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/main/java/org/codehaus/plexus/util/xml/pull/MXSerializer.java b/src/main/java/org/codehaus/plexus/util/xml/pull/MXSerializer.java index ffd0ede..54e48dc 100644 --- a/src/main/java/org/codehaus/plexus/util/xml/pull/MXSerializer.java +++ b/src/main/java/org/codehaus/plexus/util/xml/pull/MXSerializer.java @@ -854,6 +854,9 @@ public void flush() throws IOException { // --- utility methods protected void writeAttributeValue(String value, Writer out) throws IOException { + if (value == null) { + return; + } // .[apostrophe and <, & escaped], final char quot = attributeUseApostrophe ? '\'' : '"'; final String quotEntity = attributeUseApostrophe ? "'" : """; @@ -908,6 +911,9 @@ protected void writeAttributeValue(String value, Writer out) throws IOException } protected void writeElementContent(String text, Writer out) throws IOException { + if (text == null) { + return; + } // escape '<', '&', ']]>', <32 if necessary int pos = 0; for (int i = 0; i < text.length(); i++) { 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 8b66c23..0b1d3d7 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,5 +1,6 @@ package org.codehaus.plexus.util.xml.pull; +import java.io.IOException; import java.io.StringReader; import java.io.StringWriter; import java.util.Arrays; @@ -55,4 +56,19 @@ private String expectedOutput() { out.append(""); return out.toString(); } + + /** + * Tests MJAVADOC-793. + */ + @Test + public void testWriteNullValues() throws IOException { + // should be no-ops + new MXSerializer().writeElementContent(null, null); + new MXSerializer().writeAttributeValue(null, null); + final StringWriter stringWriter = new StringWriter(); + new MXSerializer().writeElementContent(null, stringWriter); + assertEquals("", stringWriter.toString()); + new MXSerializer().writeAttributeValue(null, stringWriter); + assertEquals("", stringWriter.toString()); + } } From f25521bc31d321c2ffb57cf26ae17f745c2c35a6 Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Tue, 21 May 2024 23:02:13 +0200 Subject: [PATCH 23/45] [maven-release-plugin] prepare release plexus-xml-4.0.4 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index b565192..cbcddc5 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ limitations under the License. plexus-xml - 4.0.4-SNAPSHOT + 4.0.4 Plexus XML Utilities A collection of various utility classes to ease working with XML. @@ -33,7 +33,7 @@ limitations under the License. scm:git:https://github.com/codehaus-plexus/plexus-xml.git ${project.scm.connection} - master + plexus-xml-4.0.4 https://github.com/codehaus-plexus/plexus-xml/tree/${project.scm.tag}/ @@ -48,7 +48,7 @@ limitations under the License. - 2023-12-13T20:00:19Z + 2024-05-21T21:02:09Z From 0890afc673f58f2efa0091cdfa7a2f65d9fc3e3a Mon Sep 17 00:00:00 2001 From: Slawomir Jaranowski Date: Tue, 21 May 2024 23:02:17 +0200 Subject: [PATCH 24/45] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index cbcddc5..d277bf3 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ limitations under the License. plexus-xml - 4.0.4 + 4.0.5-SNAPSHOT Plexus XML Utilities A collection of various utility classes to ease working with XML. @@ -33,7 +33,7 @@ limitations under the License. scm:git:https://github.com/codehaus-plexus/plexus-xml.git ${project.scm.connection} - plexus-xml-4.0.4 + master https://github.com/codehaus-plexus/plexus-xml/tree/${project.scm.tag}/ @@ -48,7 +48,7 @@ limitations under the License. - 2024-05-21T21:02:09Z + 2024-05-21T21:02:17Z From 05f3c9fe8680f8bb79f78f61a3b929a7034cda58 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sun, 16 Jun 2024 19:35:40 +0200 Subject: [PATCH 25/45] Require Java 17 and upgrade maven-xml-impl to 4.0.0-beta-3 --- .github/workflows/maven.yml | 7 +++++++ README.md | 1 + pom.xml | 5 +++-- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml index 09feae4..e8a6041 100644 --- a/.github/workflows/maven.yml +++ b/.github/workflows/maven.yml @@ -23,6 +23,13 @@ jobs: build: name: Build it uses: codehaus-plexus/.github/.github/workflows/maven.yml@master + with: + # Works with Java 17+ + matrix-exclude: > + [ + {"jdk": "8"}, + {"jdk": "11"} + ] deploy: name: Deploy diff --git a/README.md b/README.md index ce4cf7a..d819ce6 100644 --- a/README.md +++ b/README.md @@ -13,6 +13,7 @@ This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.co 2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/maven-xml-impl):\ this is the `master` branch from which `plexus-xml` 4 is released\ + Version 4.x requires Java 17 (like Maven 4) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) For publishing [the site](https://codehaus-plexus.github.io/plexus-xml/) do the following: diff --git a/pom.xml b/pom.xml index d277bf3..1560031 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ limitations under the License. plexus-xml - 4.0.5-SNAPSHOT + 4.1.0-SNAPSHOT Plexus XML Utilities A collection of various utility classes to ease working with XML. @@ -48,6 +48,7 @@ limitations under the License. + 17 2024-05-21T21:02:17Z @@ -55,7 +56,7 @@ limitations under the License. org.apache.maven maven-xml-impl - 4.0.0-alpha-9 + 4.0.0-beta-3 org.eclipse.sisu From aec86f0b3b8b354a53289f9671363996ed7d9135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20Boutemy?= Date: Mon, 19 Aug 2024 02:00:57 +0200 Subject: [PATCH 26/45] use new Reproducible Central badge endpoint --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index d819ce6..2bd6888 100644 --- a/README.md +++ b/README.md @@ -4,6 +4,7 @@ Plexus-Xml [![Build Status](https://github.com/codehaus-plexus/plexus-xml/actions/workflows/maven.yml/badge.svg)](https://github.com/codehaus-plexus/plexus-xml/actions) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) +[![Reproducible Builds](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/jvm-repo-rebuild/reproducible-central/master/content/org/codehaus/plexus/plexus-xml/badge.json)](https://github.com/jvm-repo-rebuild/reproducible-central/blob/master/content/org/codehaus/plexus/plexus-xml/README.md) This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`) that: From d592f2b0c6ebe5c834bd5e970a39686ba346c82b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Sep 2024 15:20:25 +0000 Subject: [PATCH 27/45] Bump org.apache.maven:maven-xml-impl from 4.0.0-beta-3 to 4.0.0-beta-4 Bumps [org.apache.maven:maven-xml-impl](https://github.com/apache/maven) from 4.0.0-beta-3 to 4.0.0-beta-4. - [Release notes](https://github.com/apache/maven/releases) - [Commits](https://github.com/apache/maven/compare/maven-4.0.0-beta-3...maven-4.0.0-beta-4) --- updated-dependencies: - dependency-name: org.apache.maven:maven-xml-impl dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1560031..1e4fd08 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ limitations under the License. org.apache.maven maven-xml-impl - 4.0.0-beta-3 + 4.0.0-beta-4 org.eclipse.sisu From 356a7785d621e8b222ae5c276ea3a8913c014c86 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 24 Sep 2024 16:01:41 +0000 Subject: [PATCH 28/45] Bump org.codehaus.plexus:plexus-utils from 4.0.1 to 4.0.2 Bumps [org.codehaus.plexus:plexus-utils](https://github.com/codehaus-plexus/plexus-utils) from 4.0.1 to 4.0.2. - [Release notes](https://github.com/codehaus-plexus/plexus-utils/releases) - [Commits](https://github.com/codehaus-plexus/plexus-utils/compare/plexus-utils-4.0.1...plexus-utils-4.0.2) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus-utils dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 1e4fd08..727096a 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ limitations under the License. org.codehaus.plexus plexus-utils - 4.0.1 + 4.0.2 test From 3b0c0a2d06743b11d8b03ba961fb650fb80301af Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sun, 6 Oct 2024 23:04:02 +0200 Subject: [PATCH 29/45] Update README to beta-4 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 2bd6888..8545243 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.co this step is released as `plexus-xml` 3, maintained in [3.x branch](tree/3.x)\ [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml), -2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-alpha-7/maven-xml-impl):\ +2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-beta-4/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-beta-4/maven-xml-impl):\ this is the `master` branch from which `plexus-xml` 4 is released\ Version 4.x requires Java 17 (like Maven 4) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) From e7265457eef7944672f2fdb8e577764b471995a0 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sun, 6 Oct 2024 23:05:25 +0200 Subject: [PATCH 30/45] Update index.md to beta-4 --- src/site/markdown/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index 823a3b2..03b37fe 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -4,5 +4,5 @@ A collection of various utility classes to ease working with XML. This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`): 1. that have been extracted from [`plexus-utils`](../plexus-utils/) 4, -2. then updated to use [`maven-xml-api`](https://maven.apache.org/ref/4.0.0-alpha-7/api/maven-api-xml/)/[`maven-xml-impl`](https://maven.apache.org/ref/4.0.0-alpha-7/maven-xml-impl/index.html) +2. then updated to use [`maven-xml-api`](https://maven.apache.org/ref/4.0.0-beta-4/api/maven-api-xml/)/[`maven-xml-impl`](https://maven.apache.org/ref/4.0.0-beta-4/maven-xml-impl/index.html) From 0eb30c19b93fc74f89d247e7f2ee0134bae2f6cc Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 15:23:41 +0000 Subject: [PATCH 31/45] Bump org.apache.maven:maven-xml-impl from 4.0.0-beta-4 to 4.0.0-beta-5 Bumps [org.apache.maven:maven-xml-impl](https://github.com/apache/maven) from 4.0.0-beta-4 to 4.0.0-beta-5. - [Release notes](https://github.com/apache/maven/releases) - [Commits](https://github.com/apache/maven/compare/maven-4.0.0-beta-4...maven-4.0.0-beta-5) --- updated-dependencies: - dependency-name: org.apache.maven:maven-xml-impl dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 727096a..eb2fbcb 100644 --- a/pom.xml +++ b/pom.xml @@ -56,7 +56,7 @@ limitations under the License. org.apache.maven maven-xml-impl - 4.0.0-beta-4 + 4.0.0-beta-5 org.eclipse.sisu From ead39ddf9c76295250a29e53c3361015fe624b4a Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 26 Sep 2024 15:17:28 +0000 Subject: [PATCH 32/45] Bump org.codehaus.plexus:plexus from 18 to 19 Bumps [org.codehaus.plexus:plexus](https://github.com/codehaus-plexus/plexus-pom) from 18 to 19. - [Release notes](https://github.com/codehaus-plexus/plexus-pom/releases) - [Commits](https://github.com/codehaus-plexus/plexus-pom/commits) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eb2fbcb..3443aec 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.codehaus.plexus plexus - 18 + 19 plexus-xml From f411cdd227444f92647b15a130e8aa88d79c7631 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sun, 6 Oct 2024 23:30:03 +0200 Subject: [PATCH 33/45] Adjust to new model --- src/site/markdown/index.md | 2 +- src/site/site.xml | 22 ++++++++++++++++++---- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index 03b37fe..30bb189 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -1,4 +1,4 @@ -## Plexus XML Utilities +# Plexus XML Utilities A collection of various utility classes to ease working with XML. diff --git a/src/site/site.xml b/src/site/site.xml index 43170c2..075f5ec 100644 --- a/src/site/site.xml +++ b/src/site/site.xml @@ -1,8 +1,22 @@ + + - @@ -22,4 +36,4 @@ - \ No newline at end of file + From f6fc5ed773395f3c019975c52acab1523f96123e Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sat, 2 Nov 2024 11:43:58 +0100 Subject: [PATCH 34/45] Bump descriptions to Maven beta-5 --- README.md | 2 +- src/site/markdown/index.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 8545243..c7ea09d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.co this step is released as `plexus-xml` 3, maintained in [3.x branch](tree/3.x)\ [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml), -2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-beta-4/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-beta-4/maven-xml-impl):\ +2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-beta-5/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-beta-5/maven-xml-impl):\ this is the `master` branch from which `plexus-xml` 4 is released\ Version 4.x requires Java 17 (like Maven 4) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index 30bb189..4e77c87 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -4,5 +4,5 @@ A collection of various utility classes to ease working with XML. This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`): 1. that have been extracted from [`plexus-utils`](../plexus-utils/) 4, -2. then updated to use [`maven-xml-api`](https://maven.apache.org/ref/4.0.0-beta-4/api/maven-api-xml/)/[`maven-xml-impl`](https://maven.apache.org/ref/4.0.0-beta-4/maven-xml-impl/index.html) +2. then updated to use [`maven-xml-api`](https://maven.apache.org/ref/4.0.0-beta-5/api/maven-api-xml/)/[`maven-xml-impl`](https://maven.apache.org/ref/4.0.0-beta-5/maven-xml-impl/index.html) From 5a1f0a35c3fe17d0a3c96648ff85b9f8f596711f Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Mon, 16 Dec 2024 00:38:10 +0100 Subject: [PATCH 35/45] Cleanup tests --- .../util/xml/PrettyPrintXMLWriterTest.java | 31 +- .../plexus/util/xml/XmlStreamReaderTest.java | 28 +- .../plexus/util/xml/XmlStreamWriterTest.java | 26 +- .../codehaus/plexus/util/xml/XmlUtilTest.java | 11 +- .../plexus/util/xml/XmlWriterUtilTest.java | 101 ++-- .../plexus/util/xml/Xpp3DomBuilderTest.java | 16 +- .../codehaus/plexus/util/xml/Xpp3DomTest.java | 49 +- .../plexus/util/xml/Xpp3DomWriterTest.java | 6 +- ...onformanceTestSuite_Production24_Test.java | 21 +- ...ConformanceTestSuite_Production2_Test.java | 64 +-- ...onformanceTestSuite_Production32_Test.java | 18 +- ...onformanceTestSuite_Production66_Test.java | 33 +- ...onformanceTestSuite_Production80_Test.java | 15 +- .../plexus/util/xml/pull/MXParserTest.java | 473 +++++++++--------- .../util/xml/pull/MXSerializerTest.java | 6 +- ..._BjoernHoehrmannviaHST2013_09_18_Test.java | 16 +- 16 files changed, 460 insertions(+), 454 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 9e23c42..00f4079 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java @@ -45,7 +45,7 @@ * @version $Id: $Id * @since 3.4.0 */ -public class PrettyPrintXMLWriterTest { +class PrettyPrintXMLWriterTest { StringWriter w; PrettyPrintXMLWriter writer; @@ -54,7 +54,7 @@ public class PrettyPrintXMLWriterTest { *

    setUp.

    */ @BeforeEach - public void setUp() { + void setUp() { initWriter(); } @@ -62,7 +62,7 @@ public void setUp() { *

    tearDown.

    */ @AfterEach - public void tearDown() { + void tearDown() { writer = null; w = null; } @@ -76,7 +76,7 @@ private void initWriter() { *

    testDefaultPrettyPrintXMLWriter.

    */ @Test - public void testDefaultPrettyPrintXMLWriter() { + void defaultPrettyPrintXMLWriter() { writer.startElement(Tag.HTML.toString()); writeXhtmlHead(writer); @@ -92,7 +92,7 @@ public void testDefaultPrettyPrintXMLWriter() { *

    testPrettyPrintXMLWriterWithGivenLineSeparator.

    */ @Test - public void testPrettyPrintXMLWriterWithGivenLineSeparator() { + void prettyPrintXMLWriterWithGivenLineSeparator() { writer.setLineSeparator("\n"); writer.startElement(Tag.HTML.toString()); @@ -110,7 +110,7 @@ public void testPrettyPrintXMLWriterWithGivenLineSeparator() { *

    testPrettyPrintXMLWriterWithGivenLineIndenter.

    */ @Test - public void testPrettyPrintXMLWriterWithGivenLineIndenter() { + void prettyPrintXMLWriterWithGivenLineIndenter() { writer.setLineIndenter(" "); writer.startElement(Tag.HTML.toString()); @@ -128,7 +128,7 @@ public void testPrettyPrintXMLWriterWithGivenLineIndenter() { *

    testEscapeXmlAttribute.

    */ @Test - public void testEscapeXmlAttribute() { + void escapeXmlAttribute() { // Windows writer.startElement(Tag.DIV.toString()); writer.addAttribute("class", "sect\r\nion"); @@ -154,13 +154,14 @@ public void testEscapeXmlAttribute() { *

    testendElementAlreadyClosed.

    */ @Test - public void testendElementAlreadyClosed() { - assertThrows(NoSuchElementException.class, () -> { - writer.startElement(Tag.DIV.toString()); - writer.addAttribute("class", "someattribute"); - writer.endElement(); // Tag.DIV closed - writer.endElement(); // Tag.DIV already closed, and there is no other outer tag! - }); + void testendElementAlreadyClosed() { + writer.startElement(Tag.DIV.toString()); + writer.addAttribute("class", "someattribute"); + writer.endElement(); + assertThrows( + NoSuchElementException.class, + () -> // Tag.DIV closed + writer.endElement()); } /** @@ -173,7 +174,7 @@ public void testendElementAlreadyClosed() { */ @Disabled("This test is only relevant on JDK 1.7, which is not supported anymore") @Test - public void testIssue51DetectJava7ConcatenationBug() throws IOException { + void issue51DetectJava7ConcatenationBug() throws IOException { 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 4ffe7a9..c87f9f7 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java @@ -35,7 +35,7 @@ * @version $Id: $Id * @since 3.4.0 */ -public class XmlStreamReaderTest { +class XmlStreamReaderTest { /** french */ private static final String TEXT_LATIN1 = "eacute: \u00E9"; @@ -115,7 +115,7 @@ private static void checkXmlStreamReader(String text, String encoding, String ef * @throws java.io.IOException if any. */ @Test - public void testNoXmlHeader() throws IOException { + void noXmlHeader() throws IOException { String xml = "text with no XML header"; checkXmlContent(xml, "UTF-8"); checkXmlContent(xml, "UTF-8", BOM_UTF8); @@ -127,7 +127,7 @@ public void testNoXmlHeader() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testDefaultEncoding() throws IOException { + void defaultEncoding() throws IOException { checkXmlStreamReader(TEXT_UNICODE, null, "UTF-8"); checkXmlStreamReader(TEXT_UNICODE, null, "UTF-8", BOM_UTF8); } @@ -138,7 +138,7 @@ public void testDefaultEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testUTF8Encoding() throws IOException { + void utf8Encoding() throws IOException { checkXmlStreamReader(TEXT_UNICODE, "UTF-8"); checkXmlStreamReader(TEXT_UNICODE, "UTF-8", BOM_UTF8); } @@ -149,7 +149,7 @@ public void testUTF8Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testUTF16Encoding() throws IOException { + void utf16Encoding() throws IOException { 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); @@ -161,7 +161,7 @@ public void testUTF16Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testUTF16BEEncoding() throws IOException { + void utf16beEncoding() throws IOException { checkXmlStreamReader(TEXT_UNICODE, "UTF-16BE"); } @@ -171,7 +171,7 @@ public void testUTF16BEEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testUTF16LEEncoding() throws IOException { + void utf16leEncoding() throws IOException { checkXmlStreamReader(TEXT_UNICODE, "UTF-16LE"); } @@ -181,7 +181,7 @@ public void testUTF16LEEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testLatin1Encoding() throws IOException { + void latin1Encoding() throws IOException { checkXmlStreamReader(TEXT_LATIN1, "ISO-8859-1"); } @@ -191,7 +191,7 @@ public void testLatin1Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testLatin7Encoding() throws IOException { + void latin7Encoding() throws IOException { checkXmlStreamReader(TEXT_LATIN7, "ISO-8859-7"); } @@ -201,7 +201,7 @@ public void testLatin7Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testLatin15Encoding() throws IOException { + void latin15Encoding() throws IOException { checkXmlStreamReader(TEXT_LATIN15, "ISO-8859-15"); } @@ -211,7 +211,7 @@ public void testLatin15Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testEUC_JPEncoding() throws IOException { + void euc_jpEncoding() throws IOException { checkXmlStreamReader(TEXT_EUC_JP, "EUC-JP"); } @@ -221,7 +221,7 @@ public void testEUC_JPEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testEBCDICEncoding() throws IOException { + void ebcdicEncoding() throws IOException { checkXmlStreamReader("simple text in EBCDIC", "CP1047"); } @@ -231,7 +231,7 @@ public void testEBCDICEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testInappropriateEncoding() throws IOException { + void inappropriateEncoding() throws IOException { // expected failure, since the encoding does not contain some characters assertThrows( AssertionFailedError.class, @@ -245,7 +245,7 @@ public void testInappropriateEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testEncodingAttribute() throws IOException { + void encodingAttribute() throws IOException { String xml = ""; checkXmlContent(xml, "US-ASCII"); 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 c2803b5..19b4027 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java @@ -30,7 +30,7 @@ * @version $Id: $Id * @since 3.4.0 */ -public class XmlStreamWriterTest { +class XmlStreamWriterTest { /** french */ private static final String TEXT_LATIN1 = "eacute: \u00E9"; @@ -78,7 +78,7 @@ private static void checkXmlWriter(String text, String encoding) throws IOExcept * @throws java.io.IOException if any. */ @Test - public void testNoXmlHeader() throws IOException { + void noXmlHeader() throws IOException { String xml = "text with no XML header"; checkXmlContent(xml, "UTF-8"); } @@ -89,7 +89,7 @@ public void testNoXmlHeader() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testEmpty() throws IOException { + void empty() throws IOException { ByteArrayOutputStream out = new ByteArrayOutputStream(); XmlStreamWriter writer = new XmlStreamWriter(out); writer.flush(); @@ -106,7 +106,7 @@ public void testEmpty() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testDefaultEncoding() throws IOException { + void defaultEncoding() throws IOException { checkXmlWriter(TEXT_UNICODE, null); } @@ -116,7 +116,7 @@ public void testDefaultEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testUTF8Encoding() throws IOException { + void utf8Encoding() throws IOException { checkXmlWriter(TEXT_UNICODE, "UTF-8"); } @@ -126,7 +126,7 @@ public void testUTF8Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testUTF16Encoding() throws IOException { + void utf16Encoding() throws IOException { checkXmlWriter(TEXT_UNICODE, "UTF-16"); } @@ -136,7 +136,7 @@ public void testUTF16Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testUTF16BEEncoding() throws IOException { + void utf16beEncoding() throws IOException { checkXmlWriter(TEXT_UNICODE, "UTF-16BE"); } @@ -146,7 +146,7 @@ public void testUTF16BEEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testUTF16LEEncoding() throws IOException { + void utf16leEncoding() throws IOException { checkXmlWriter(TEXT_UNICODE, "UTF-16LE"); } @@ -156,7 +156,7 @@ public void testUTF16LEEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testLatin1Encoding() throws IOException { + void latin1Encoding() throws IOException { checkXmlWriter(TEXT_LATIN1, "ISO-8859-1"); } @@ -166,7 +166,7 @@ public void testLatin1Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testLatin7Encoding() throws IOException { + void latin7Encoding() throws IOException { checkXmlWriter(TEXT_LATIN7, "ISO-8859-7"); } @@ -176,7 +176,7 @@ public void testLatin7Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testLatin15Encoding() throws IOException { + void latin15Encoding() throws IOException { checkXmlWriter(TEXT_LATIN15, "ISO-8859-15"); } @@ -186,7 +186,7 @@ public void testLatin15Encoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testEUC_JPEncoding() throws IOException { + void euc_jpEncoding() throws IOException { checkXmlWriter(TEXT_EUC_JP, "EUC-JP"); } @@ -196,7 +196,7 @@ public void testEUC_JPEncoding() throws IOException { * @throws java.io.IOException if any. */ @Test - public void testEBCDICEncoding() throws IOException { + void ebcdicEncoding() throws IOException { checkXmlWriter("simple text in EBCDIC", "CP1047"); } } diff --git a/src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java b/src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java index eb6db5e..4805cd6 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java @@ -29,7 +29,8 @@ import org.codehaus.plexus.util.StringUtils; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertTrue; /** * Test the {@link org.codehaus.plexus.util.xml.XmlUtil} class. @@ -68,7 +69,7 @@ private File getTestOutputFile(String relPath) throws IOException { * @throws java.lang.Exception if any. */ @Test - public void testPrettyFormatInputStreamOutputStream() throws Exception { + void prettyFormatInputStreamOutputStream() throws Exception { File testDocument = new File(getBasedir(), "src/test/resources/testDocument.xhtml"); assertTrue(testDocument.exists()); @@ -89,7 +90,7 @@ public void testPrettyFormatInputStreamOutputStream() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testPrettyFormatReaderWriter() throws Exception { + void prettyFormatReaderWriter() throws Exception { File testDocument = new File(getBasedir(), "src/test/resources/testDocument.xhtml"); assertTrue(testDocument.exists()); @@ -109,7 +110,7 @@ public void testPrettyFormatReaderWriter() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testPrettyFormatString() throws Exception { + void prettyFormatString() throws Exception { File testDocument = new File(getBasedir(), "src/test/resources/testDocument.xhtml"); assertTrue(testDocument.exists()); @@ -135,7 +136,7 @@ public void testPrettyFormatString() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testPrettyFormatReaderWriter2() throws Exception { + void prettyFormatReaderWriter2() throws Exception { File testDocument = new File(getBasedir(), "src/test/resources/test.xdoc.xhtml"); assertTrue(testDocument.exists()); diff --git a/src/test/java/org/codehaus/plexus/util/xml/XmlWriterUtilTest.java b/src/test/java/org/codehaus/plexus/util/xml/XmlWriterUtilTest.java index 35ca0a2..d0b94f8 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlWriterUtilTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlWriterUtilTest.java @@ -25,7 +25,8 @@ import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; -import static org.junit.jupiter.api.Assertions.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; /** *

    XmlWriterUtilTest class.

    @@ -34,7 +35,7 @@ * @version $Id: $Id * @since 3.4.0 */ -public class XmlWriterUtilTest { +class XmlWriterUtilTest { private OutputStream output; private Writer writer; @@ -47,7 +48,7 @@ public class XmlWriterUtilTest { * @throws java.lang.Exception if any. */ @BeforeEach - public void setUp() throws Exception { + void setUp() throws Exception { output = new ByteArrayOutputStream(); writer = new XmlStreamWriter(output); xmlWriter = new PrettyPrintXMLWriter(writer); @@ -59,7 +60,7 @@ public void setUp() throws Exception { * @throws java.lang.Exception if any. */ @AfterEach - public void tearDown() throws Exception { + void tearDown() throws Exception { xmlWriter = null; writer = null; output = null; @@ -72,10 +73,10 @@ public void tearDown() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteLineBreakXMLWriter() throws Exception { + void writeLineBreakXMLWriter() throws Exception { XmlWriterUtil.writeLineBreak(xmlWriter); writer.close(); - assertTrue(StringUtils.countMatches(output.toString(), XmlWriterUtil.LS) == 1); + assertEquals(1, StringUtils.countMatches(output.toString(), XmlWriterUtil.LS)); } /** @@ -85,10 +86,10 @@ public void testWriteLineBreakXMLWriter() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteLineBreakXMLWriterInt() throws Exception { + void writeLineBreakXMLWriterInt() throws Exception { XmlWriterUtil.writeLineBreak(xmlWriter, 10); writer.close(); - assertTrue(StringUtils.countMatches(output.toString(), XmlWriterUtil.LS) == 10); + assertEquals(10, StringUtils.countMatches(output.toString(), XmlWriterUtil.LS)); } /** @@ -98,13 +99,14 @@ public void testWriteLineBreakXMLWriterInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteLineBreakXMLWriterIntInt() throws Exception { + void writeLineBreakXMLWriterIntInt() throws Exception { XmlWriterUtil.writeLineBreak(xmlWriter, 10, 2); writer.close(); - assertTrue(StringUtils.countMatches(output.toString(), XmlWriterUtil.LS) == 10); - assertTrue(StringUtils.countMatches( - output.toString(), StringUtils.repeat(" ", 2 * XmlWriterUtil.DEFAULT_INDENTATION_SIZE)) - == 1); + assertEquals(10, StringUtils.countMatches(output.toString(), XmlWriterUtil.LS)); + assertEquals( + 1, + StringUtils.countMatches( + output.toString(), StringUtils.repeat(" ", 2 * XmlWriterUtil.DEFAULT_INDENTATION_SIZE))); } /** @@ -114,11 +116,11 @@ public void testWriteLineBreakXMLWriterIntInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteLineBreakXMLWriterIntIntInt() throws Exception { + void writeLineBreakXMLWriterIntIntInt() throws Exception { XmlWriterUtil.writeLineBreak(xmlWriter, 10, 2, 4); writer.close(); - assertTrue(StringUtils.countMatches(output.toString(), XmlWriterUtil.LS) == 10); - assertTrue(StringUtils.countMatches(output.toString(), StringUtils.repeat(" ", 2 * 4)) == 1); + assertEquals(10, StringUtils.countMatches(output.toString(), XmlWriterUtil.LS)); + assertEquals(1, StringUtils.countMatches(output.toString(), StringUtils.repeat(" ", 2 * 4))); } /** @@ -128,14 +130,14 @@ public void testWriteLineBreakXMLWriterIntIntInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentLineBreakXMLWriter() throws Exception { + void writeCommentLineBreakXMLWriter() throws Exception { XmlWriterUtil.writeCommentLineBreak(xmlWriter); writer.close(); StringBuilder sb = new StringBuilder(); sb.append("") .append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() == XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length()); + assertEquals(output.toString().length(), XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length()); } /** @@ -145,7 +147,7 @@ public void testWriteCommentLineBreakXMLWriter() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentLineBreakXMLWriterInt() throws Exception { + void writeCommentLineBreakXMLWriterInt() throws Exception { XmlWriterUtil.writeCommentLineBreak(xmlWriter, 20); writer.close(); assertEquals(output.toString(), "" + XmlWriterUtil.LS); @@ -165,14 +167,14 @@ public void testWriteCommentLineBreakXMLWriterInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentXMLWriterString() throws Exception { + void writeCommentXMLWriterString() throws Exception { XmlWriterUtil.writeComment(xmlWriter, "hello"); writer.close(); StringBuffer sb = new StringBuffer(); sb.append("") .append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() == XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length()); + assertEquals(output.toString().length(), XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length()); tearDown(); setUp(); @@ -197,8 +199,8 @@ public void testWriteCommentXMLWriterString() throws Exception { sb.append("") .append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue( - output.toString().length() == 2 * (XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length())); + assertEquals( + output.toString().length(), 2 * (XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length())); } /** @@ -208,7 +210,7 @@ public void testWriteCommentXMLWriterString() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentXMLWriterStringInt() throws Exception { + void writeCommentXMLWriterStringInt() throws Exception { String indent = StringUtils.repeat(" ", 2 * XmlWriterUtil.DEFAULT_INDENTATION_SIZE); XmlWriterUtil.writeComment(xmlWriter, "hello", 2); @@ -218,8 +220,9 @@ public void testWriteCommentXMLWriterStringInt() throws Exception { sb.append("") .append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() - == XmlWriterUtil.DEFAULT_COLUMN_LINE + assertEquals( + output.toString().length(), + XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length() + 2 * XmlWriterUtil.DEFAULT_INDENTATION_SIZE); @@ -237,8 +240,9 @@ public void testWriteCommentXMLWriterStringInt() throws Exception { sb.append("") .append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() - == 2 * (XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length()) + 2 * indent.length()); + assertEquals( + output.toString().length(), + 2 * (XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length()) + 2 * indent.length()); } /** @@ -248,7 +252,7 @@ public void testWriteCommentXMLWriterStringInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentXMLWriterStringIntInt() throws Exception { + void writeCommentXMLWriterStringIntInt() throws Exception { String repeat = StringUtils.repeat(" ", 2 * 4); XmlWriterUtil.writeComment(xmlWriter, "hello", 2, 4); @@ -258,8 +262,8 @@ public void testWriteCommentXMLWriterStringIntInt() throws Exception { sb.append("") .append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() - == XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length() + 2 * 4); + assertEquals( + output.toString().length(), XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length() + 2 * 4); tearDown(); setUp(); @@ -274,8 +278,9 @@ public void testWriteCommentXMLWriterStringIntInt() throws Exception { sb.append("") .append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() - == 2 * (XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length()) + 2 * repeat.length()); + assertEquals( + output.toString().length(), + 2 * (XmlWriterUtil.DEFAULT_COLUMN_LINE - 1 + XmlWriterUtil.LS.length()) + 2 * repeat.length()); } /** @@ -285,7 +290,7 @@ public void testWriteCommentXMLWriterStringIntInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentXMLWriterStringIntIntInt() throws Exception { + void writeCommentXMLWriterStringIntIntInt() throws Exception { String indent = StringUtils.repeat(" ", 2 * 4); XmlWriterUtil.writeComment(xmlWriter, "hello", 2, 4, 50); @@ -294,7 +299,7 @@ public void testWriteCommentXMLWriterStringIntIntInt() throws Exception { sb.append(indent); sb.append("").append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() == 50 - 1 + XmlWriterUtil.LS.length() + 2 * 4); + assertEquals(output.toString().length(), 50 - 1 + XmlWriterUtil.LS.length() + 2 * 4); tearDown(); setUp(); @@ -315,7 +320,7 @@ public void testWriteCommentXMLWriterStringIntIntInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentTextXMLWriterStringInt() throws Exception { + void writeCommentTextXMLWriterStringInt() throws Exception { XmlWriterUtil.writeCommentText(xmlWriter, "hello", 0); writer.close(); StringBuffer sb = new StringBuffer(); @@ -328,8 +333,8 @@ public void testWriteCommentTextXMLWriterStringInt() throws Exception { .append(XmlWriterUtil.LS); sb.append(XmlWriterUtil.LS); assertEquals(output.toString(), sb.toString()); - assertTrue( - output.toString().length() == 3 * (80 - 1 + XmlWriterUtil.LS.length()) + 2 * XmlWriterUtil.LS.length()); + assertEquals( + output.toString().length(), 3 * (80 - 1 + XmlWriterUtil.LS.length()) + 2 * XmlWriterUtil.LS.length()); tearDown(); setUp(); @@ -374,7 +379,7 @@ public void testWriteCommentTextXMLWriterStringInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentTextXMLWriterStringIntInt() throws Exception { + void writeCommentTextXMLWriterStringIntInt() throws Exception { String indent = StringUtils.repeat(" ", 2 * 4); XmlWriterUtil.writeCommentText(xmlWriter, "hello", 2, 4); @@ -393,8 +398,9 @@ public void testWriteCommentTextXMLWriterStringIntInt() throws Exception { sb.append(XmlWriterUtil.LS); sb.append(indent); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() - == 3 * (80 - 1 + XmlWriterUtil.LS.length()) + 4 * 2 * 4 + 2 * XmlWriterUtil.LS.length()); + assertEquals( + output.toString().length(), + 3 * (80 - 1 + XmlWriterUtil.LS.length()) + 4 * 2 * 4 + 2 * XmlWriterUtil.LS.length()); } /** @@ -404,7 +410,7 @@ public void testWriteCommentTextXMLWriterStringIntInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentTextXMLWriterStringIntIntInt() throws Exception { + void writeCommentTextXMLWriterStringIntIntInt() throws Exception { String indent = StringUtils.repeat(" ", 2 * 4); XmlWriterUtil.writeCommentText(xmlWriter, "hello", 2, 4, 50); @@ -423,8 +429,9 @@ public void testWriteCommentTextXMLWriterStringIntIntInt() throws Exception { sb.append(XmlWriterUtil.LS); sb.append(indent); assertEquals(output.toString(), sb.toString()); - assertTrue(output.toString().length() - == 3 * (50 - 1 + XmlWriterUtil.LS.length()) + 4 * 2 * 4 + 2 * XmlWriterUtil.LS.length()); + assertEquals( + output.toString().length(), + 3 * (50 - 1 + XmlWriterUtil.LS.length()) + 4 * 2 * 4 + 2 * XmlWriterUtil.LS.length()); } /** @@ -434,7 +441,7 @@ public void testWriteCommentTextXMLWriterStringIntIntInt() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentNull() throws Exception { + void writeCommentNull() throws Exception { XmlWriterUtil.writeComment(xmlWriter, null); writer.close(); StringBuilder sb = new StringBuilder(); @@ -450,7 +457,7 @@ public void testWriteCommentNull() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentShort() throws Exception { + void writeCommentShort() throws Exception { XmlWriterUtil.writeComment(xmlWriter, "This is a short text"); writer.close(); StringBuilder sb = new StringBuilder(); @@ -466,7 +473,7 @@ public void testWriteCommentShort() throws Exception { * @throws java.lang.Exception if any */ @Test - public void testWriteCommentLong() throws Exception { + void writeCommentLong() throws Exception { XmlWriterUtil.writeComment( xmlWriter, "Maven is a software project management and comprehension tool. " 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 c8db71b..a490540 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomBuilderTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomBuilderTest.java @@ -34,7 +34,7 @@ * @version $Id: $Id * @since 3.4.0 */ -public class Xpp3DomBuilderTest { +class Xpp3DomBuilderTest { private static final String LS = System.lineSeparator(); /** @@ -43,7 +43,7 @@ public class Xpp3DomBuilderTest { * @throws java.lang.Exception if any. */ @Test - public void testBuildFromReader() throws Exception { + void buildFromReader() throws Exception { String domString = createDomString(); Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(domString)); @@ -59,7 +59,7 @@ public void testBuildFromReader() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testBuildTrimming() throws Exception { + void buildTrimming() throws Exception { String domString = createDomString(); Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(domString), true); @@ -77,7 +77,7 @@ public void testBuildTrimming() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testBuildFromXpp3Dom() throws Exception { + void buildFromXpp3Dom() throws Exception { Xpp3Dom expectedDom = createExpectedDom(); Xpp3Dom dom = null; @@ -123,7 +123,7 @@ public void testBuildFromXpp3Dom() throws Exception { * Test we get an error from the parser, and don't hit the IllegalStateException. */ @Test - public void testUnclosedXml() { + void unclosedXml() { String domString = "" + createDomString(); try { Xpp3DomBuilder.build(new StringReader(domString)); @@ -143,7 +143,7 @@ public void testUnclosedXml() { * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - public void testEscapingInContent() throws IOException, XmlPullParserException { + void escapingInContent() throws IOException, XmlPullParserException { Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(getEncodedString())); assertEquals("\"text\"", dom.getChild("el").getValue(), "Check content value"); @@ -162,7 +162,7 @@ public void testEscapingInContent() throws IOException, XmlPullParserException { * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - public void testEscapingInAttributes() throws IOException, XmlPullParserException { + void escapingInAttributes() throws IOException, XmlPullParserException { String s = getAttributeEncodedString(); Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(s)); @@ -181,7 +181,7 @@ public void testEscapingInAttributes() throws IOException, XmlPullParserExceptio * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - public void testInputLocationTracking() throws IOException, XmlPullParserException { + void inputLocationTracking() throws IOException, XmlPullParserException { 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 dccdde3..828c6cd 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java @@ -38,12 +38,12 @@ * @version $Id: $Id * @since 3.4.0 */ -public class Xpp3DomTest { +class Xpp3DomTest { /** *

    testShouldPerformAppendAtFirstSubElementLevel.

    */ @Test - public void testShouldPerformAppendAtFirstSubElementLevel() { + void shouldPerformAppendAtFirstSubElementLevel() { // create the dominant DOM Xpp3Dom t1 = new Xpp3Dom("top"); t1.setAttribute(Xpp3Dom.CHILDREN_COMBINATION_MODE_ATTRIBUTE, Xpp3Dom.CHILDREN_COMBINATION_APPEND); @@ -81,7 +81,7 @@ public void testShouldPerformAppendAtFirstSubElementLevel() { *

    testShouldOverrideAppendAndDeepMerge.

    */ @Test - public void testShouldOverrideAppendAndDeepMerge() { + void shouldOverrideAppendAndDeepMerge() { // create the dominant DOM Xpp3Dom t1 = new Xpp3Dom("top"); t1.setAttribute(Xpp3Dom.CHILDREN_COMBINATION_MODE_ATTRIBUTE, Xpp3Dom.CHILDREN_COMBINATION_APPEND); @@ -117,7 +117,7 @@ public void testShouldOverrideAppendAndDeepMerge() { *

    testShouldPerformSelfOverrideAtTopLevel.

    */ @Test - public void testShouldPerformSelfOverrideAtTopLevel() { + void shouldPerformSelfOverrideAtTopLevel() { // create the dominant DOM Xpp3Dom t1 = new Xpp3Dom("top"); t1.setAttribute("attr", "value"); @@ -143,7 +143,7 @@ public void testShouldPerformSelfOverrideAtTopLevel() { *

    testShouldMergeValuesAtTopLevelByDefault.

    */ @Test - public void testShouldNotMergeValuesAtTopLevelByDefault() { + void shouldNotMergeValuesAtTopLevelByDefault() { // create the dominant DOM Xpp3Dom t1 = new Xpp3Dom("top"); t1.setAttribute("attr", "value"); @@ -169,7 +169,7 @@ public void testShouldNotMergeValuesAtTopLevelByDefault() { *

    testShouldMergeValuesAtTopLevel.

    */ @Test - public void testShouldNotMergeValues() { + void shouldNotMergeValues() { // create the dominant DOM Xpp3Dom t1 = new Xpp3Dom("top"); t1.setAttribute("attr", "value"); @@ -192,7 +192,7 @@ public void testShouldNotMergeValues() { *

    testNullAttributeNameOrValue.

    */ @Test - public void testNullAttributeNameOrValue() { + void nullAttributeNameOrValue() { Xpp3Dom t1 = new Xpp3Dom("top"); try { t1.setAttribute("attr", null); @@ -212,12 +212,12 @@ public void testNullAttributeNameOrValue() { *

    testEquals.

    */ @Test - public void testEquals() { + void equals() { Xpp3Dom dom = new Xpp3Dom("top"); assertEquals(dom, dom); - assertFalse(dom.equals(null)); - assertFalse(dom.equals(new Xpp3Dom(""))); + assertNotEquals(null, dom); + assertNotEquals(dom, new Xpp3Dom("")); } /** @@ -227,7 +227,7 @@ public void testEquals() { * @throws java.io.IOException if any. */ @Test - public void testEqualsIsNullSafe() throws XmlPullParserException, IOException { + void equalsIsNullSafe() throws XmlPullParserException, IOException { String testDom = "onetwo"; Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(testDom)); @@ -249,7 +249,7 @@ public void testEqualsIsNullSafe() throws XmlPullParserException, IOException { * @throws java.io.IOException if any. */ @Test - public void testShouldOverwritePluginConfigurationSubItemsByDefault() throws XmlPullParserException, IOException { + void shouldOverwritePluginConfigurationSubItemsByDefault() throws XmlPullParserException, IOException { String parentConfigStr = "onetwo"; Xpp3Dom parentConfig = Xpp3DomBuilder.build(new StringReader(parentConfigStr), new FixedInputLocationBuilder("parent")); @@ -275,8 +275,7 @@ public void testShouldOverwritePluginConfigurationSubItemsByDefault() throws Xml * @throws java.io.IOException if any. */ @Test - public void testShouldMergePluginConfigurationSubItemsWithMergeAttributeSet() - throws XmlPullParserException, IOException { + void shouldMergePluginConfigurationSubItemsWithMergeAttributeSet() throws XmlPullParserException, IOException { String parentConfigStr = "onetwo"; Xpp3Dom parentConfig = Xpp3DomBuilder.build(new StringReader(parentConfigStr), new FixedInputLocationBuilder("parent")); @@ -307,7 +306,7 @@ public void testShouldMergePluginConfigurationSubItemsWithMergeAttributeSet() * @throws java.lang.Exception if any. */ @Test - public void testShouldNotChangeUponMergeWithItselfWhenFirstOrLastSubItemIsEmpty() throws Exception { + void shouldNotChangeUponMergeWithItselfWhenFirstOrLastSubItemIsEmpty() throws Exception { String configStr = "test"; Xpp3Dom dominantConfig = Xpp3DomBuilder.build(new StringReader(configStr)); Xpp3Dom recessiveConfig = Xpp3DomBuilder.build(new StringReader(configStr)); @@ -317,9 +316,9 @@ public void testShouldNotChangeUponMergeWithItselfWhenFirstOrLastSubItemIsEmpty( assertEquals(3, items.getChildCount()); - assertEquals(null, items.getChild(0).getValue()); + assertNull(items.getChild(0).getValue()); assertEquals("test", items.getChild(1).getValue()); - assertEquals(null, items.getChild(2).getValue()); + assertNull(items.getChild(2).getValue()); } /** @@ -328,7 +327,7 @@ public void testShouldNotChangeUponMergeWithItselfWhenFirstOrLastSubItemIsEmpty( * @throws java.lang.Exception if any. */ @Test - public void testShouldCopyRecessiveChildrenNotPresentInTarget() throws Exception { + void shouldCopyRecessiveChildrenNotPresentInTarget() throws Exception { String dominantStr = "x"; String recessiveStr = "y"; Xpp3Dom dominantConfig = Xpp3DomBuilder.build(new StringReader(dominantStr)); @@ -350,7 +349,7 @@ public void testShouldCopyRecessiveChildrenNotPresentInTarget() throws Exception * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - public void testDupeChildren() throws IOException, XmlPullParserException { + void dupeChildren() throws IOException, XmlPullParserException { String dupes = "xy"; Xpp3Dom dom = Xpp3DomBuilder.build(new StringReader(dupes)); assertNotNull(dom); @@ -363,7 +362,7 @@ public void testDupeChildren() throws IOException, XmlPullParserException { * @throws java.lang.Exception if any. */ @Test - public void testShouldRemoveEntireElementWithAttributesAndChildren() throws Exception { + void shouldRemoveEntireElementWithAttributesAndChildren() throws Exception { String dominantStr = ""; String recessiveStr = "parameter"; Xpp3Dom dominantConfig = Xpp3DomBuilder.build(new StringReader(dominantStr)); @@ -381,7 +380,7 @@ public void testShouldRemoveEntireElementWithAttributesAndChildren() throws Exce * @throws java.lang.Exception if any. */ @Test - public void testShouldRemoveDoNotRemoveTagWhenSwappedInputDOMs() throws Exception { + void shouldRemoveDoNotRemoveTagWhenSwappedInputDOMs() throws Exception { String dominantStr = ""; String recessiveStr = "parameter"; Xpp3Dom dominantConfig = Xpp3DomBuilder.build(new StringReader(dominantStr)); @@ -399,7 +398,7 @@ public void testShouldRemoveDoNotRemoveTagWhenSwappedInputDOMs() throws Exceptio * @throws java.lang.Exception if any. */ @Test - public void testCombineId() throws Exception { + void combineId() throws Exception { String lhs = "" + "LHS-ONLYLHS" + "TOOVERWRITELHS" + ""; @@ -447,7 +446,7 @@ public void testCombineId() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testCombineKeys() throws Exception { + void combineKeys() throws Exception { String lhs = "" + "LHS-ONLYLHS" + "TOOVERWRITELHS" + ""; @@ -490,7 +489,7 @@ public void testCombineKeys() throws Exception { } @Test - public void testPreserveDominantBlankValue() throws XmlPullParserException, IOException { + void preserveDominantBlankValue() throws XmlPullParserException, IOException { String lhs = " "; String rhs = "recessive"; @@ -505,7 +504,7 @@ public void testPreserveDominantBlankValue() throws XmlPullParserException, IOEx } @Test - public void testPreserveDominantEmptyNode() throws XmlPullParserException, IOException { + void preserveDominantEmptyNode() throws XmlPullParserException, IOException { String lhs = ""; String rhs = "recessive"; diff --git a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomWriterTest.java b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomWriterTest.java index 233bdd5..fc4cc27 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomWriterTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomWriterTest.java @@ -29,14 +29,14 @@ * @version $Id: $Id * @since 3.4.0 */ -public class Xpp3DomWriterTest { +class Xpp3DomWriterTest { private static final String LS = System.getProperty("line.separator"); /** *

    testWriter.

    */ @Test - public void testWriter() { + void writer() { StringWriter writer = new StringWriter(); Xpp3DomWriter.write(writer, createXpp3Dom()); @@ -48,7 +48,7 @@ public void testWriter() { *

    testWriterNoEscape.

    */ @Test - public void testWriterNoEscape() { + void writerNoEscape() { StringWriter writer = new StringWriter(); Xpp3DomWriter.write(new PrettyPrintXMLWriter(writer), createXpp3Dom(), false); 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 bb1a7e8..2e1fd7f 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 @@ -20,7 +20,6 @@ * @version $Id: $Id * @since 3.4.0 */ -public class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production24_Test { static final File testResourcesDir = new File("src/test/resources/", "xmlconf/ibm/"); @@ -31,7 +30,7 @@ class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConfo *

    setUp.

    */ @BeforeEach - public void setUp() { + void setUp() { parser = new MXParser(); } @@ -45,7 +44,7 @@ public void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n01xml() throws IOException { + void testibm_not_wf_P24_ibm24n01xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n01.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -68,7 +67,7 @@ public void testibm_not_wf_P24_ibm24n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n02xml() throws IOException { + void testibm_not_wf_P24_ibm24n02xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n02.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -90,7 +89,7 @@ public void testibm_not_wf_P24_ibm24n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n03xml() throws IOException { + void testibm_not_wf_P24_ibm24n03xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n03.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -112,7 +111,7 @@ public void testibm_not_wf_P24_ibm24n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n04xml() throws IOException { + void testibm_not_wf_P24_ibm24n04xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n04.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -134,7 +133,7 @@ public void testibm_not_wf_P24_ibm24n04xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n05xml() throws IOException { + void testibm_not_wf_P24_ibm24n05xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n05.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -156,7 +155,7 @@ public void testibm_not_wf_P24_ibm24n05xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n06xml() throws IOException { + void testibm_not_wf_P24_ibm24n06xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n06.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -177,7 +176,7 @@ public void testibm_not_wf_P24_ibm24n06xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n07xml() throws IOException { + void testibm_not_wf_P24_ibm24n07xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n07.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -198,7 +197,7 @@ public void testibm_not_wf_P24_ibm24n07xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n08xml() throws IOException { + void testibm_not_wf_P24_ibm24n08xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P24/ibm24n08.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -220,7 +219,7 @@ public void testibm_not_wf_P24_ibm24n08xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P24_ibm24n09xml() throws IOException { + void testibm_not_wf_P24_ibm24n09xml() throws IOException { 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 49227a4..43279b8 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 @@ -38,7 +38,7 @@ class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConfo *

    setUp.

    */ @BeforeEach - public void setUp() { + void setUp() { parser = new MXParser(); } @@ -52,7 +52,7 @@ public void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n01xml() throws IOException { + 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) @@ -73,7 +73,7 @@ public void testibm_not_wf_P02_ibm02n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n02xml() throws IOException { + 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) @@ -94,7 +94,7 @@ public void testibm_not_wf_P02_ibm02n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n03xml() throws IOException { + 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) @@ -115,7 +115,7 @@ public void testibm_not_wf_P02_ibm02n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n04xml() throws IOException { + 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) @@ -136,7 +136,7 @@ public void testibm_not_wf_P02_ibm02n04xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n05xml() throws IOException { + 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) @@ -157,7 +157,7 @@ public void testibm_not_wf_P02_ibm02n05xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n06xml() throws IOException { + 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) @@ -178,7 +178,7 @@ public void testibm_not_wf_P02_ibm02n06xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n07xml() throws IOException { + 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) @@ -199,7 +199,7 @@ public void testibm_not_wf_P02_ibm02n07xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n08xml() throws IOException { + 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) @@ -220,7 +220,7 @@ public void testibm_not_wf_P02_ibm02n08xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n09xml() throws IOException { + 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) @@ -241,7 +241,7 @@ public void testibm_not_wf_P02_ibm02n09xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n10xml() throws IOException { + 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) @@ -262,7 +262,7 @@ public void testibm_not_wf_P02_ibm02n10xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n11xml() throws IOException { + 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) @@ -283,7 +283,7 @@ public void testibm_not_wf_P02_ibm02n11xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n12xml() throws IOException { + 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) @@ -304,7 +304,7 @@ public void testibm_not_wf_P02_ibm02n12xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n13xml() throws IOException { + 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) @@ -325,7 +325,7 @@ public void testibm_not_wf_P02_ibm02n13xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n14xml() throws IOException { + 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) @@ -346,7 +346,7 @@ public void testibm_not_wf_P02_ibm02n14xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n15xml() throws IOException { + 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) @@ -367,7 +367,7 @@ public void testibm_not_wf_P02_ibm02n15xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n16xml() throws IOException { + 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) @@ -388,7 +388,7 @@ public void testibm_not_wf_P02_ibm02n16xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n17xml() throws IOException { + 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) @@ -409,7 +409,7 @@ public void testibm_not_wf_P02_ibm02n17xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n18xml() throws IOException { + 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) @@ -430,7 +430,7 @@ public void testibm_not_wf_P02_ibm02n18xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n19xml() throws IOException { + 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) @@ -451,7 +451,7 @@ public void testibm_not_wf_P02_ibm02n19xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n20xml() throws IOException { + 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) @@ -472,7 +472,7 @@ public void testibm_not_wf_P02_ibm02n20xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n21xml() throws IOException { + 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) @@ -493,7 +493,7 @@ public void testibm_not_wf_P02_ibm02n21xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n22xml() throws IOException { + 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) @@ -514,7 +514,7 @@ public void testibm_not_wf_P02_ibm02n22xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n23xml() throws IOException { + 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) @@ -535,7 +535,7 @@ public void testibm_not_wf_P02_ibm02n23xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n24xml() throws IOException { + 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) @@ -556,7 +556,7 @@ public void testibm_not_wf_P02_ibm02n24xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n25xml() throws IOException { + 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) @@ -577,7 +577,7 @@ public void testibm_not_wf_P02_ibm02n25xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n26xml() throws IOException { + 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) @@ -598,7 +598,7 @@ public void testibm_not_wf_P02_ibm02n26xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n27xml() throws IOException { + 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) @@ -619,7 +619,7 @@ public void testibm_not_wf_P02_ibm02n27xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n28xml() throws IOException { + 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) @@ -640,7 +640,7 @@ public void testibm_not_wf_P02_ibm02n28xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n29xml() throws IOException { + 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) @@ -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 - public void testibm_not_wf_P02_ibm02n32xml() throws IOException { + void testibm_not_wf_P02_ibm02n32xml() throws IOException { 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 @@ public void testibm_not_wf_P02_ibm02n32xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P02_ibm02n33xml() throws IOException { + void testibm_not_wf_P02_ibm02n33xml() throws IOException { 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 f99e1ea..cda5f99 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 @@ -31,7 +31,7 @@ class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConfo *

    setUp.

    */ @BeforeEach - public void setUp() { + void setUp() { parser = new MXParser(); } @@ -45,7 +45,7 @@ public void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P32_ibm32n01xml() throws IOException { + void testibm_not_wf_P32_ibm32n01xml() throws IOException { 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 @@ public void testibm_not_wf_P32_ibm32n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P32_ibm32n02xml() throws IOException { + void testibm_not_wf_P32_ibm32n02xml() throws IOException { 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 @@ public void testibm_not_wf_P32_ibm32n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P32_ibm32n03xml() throws IOException { + void testibm_not_wf_P32_ibm32n03xml() throws IOException { 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 @@ public void testibm_not_wf_P32_ibm32n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P32_ibm32n04xml() throws IOException { + void testibm_not_wf_P32_ibm32n04xml() throws IOException { 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 @@ public void testibm_not_wf_P32_ibm32n04xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P32_ibm32n05xml() throws IOException { + void testibm_not_wf_P32_ibm32n05xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P32/ibm32n05.xml"))) { parser.setInput(reader); @@ -153,7 +153,7 @@ public void testibm_not_wf_P32_ibm32n05xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P32_ibm32n06xml() throws IOException { + void testibm_not_wf_P32_ibm32n06xml() throws IOException { 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 @@ public void testibm_not_wf_P32_ibm32n06xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P32_ibm32n07xml() throws IOException { + void testibm_not_wf_P32_ibm32n07xml() throws IOException { 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 @@ public void testibm_not_wf_P32_ibm32n07xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P32_ibm32n08xml() throws IOException { + void testibm_not_wf_P32_ibm32n08xml() throws IOException { 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 debe597..c08b114 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 @@ -21,7 +21,6 @@ * @version $Id: $Id * @since 3.4.0 */ -public class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production66_Test { static final File testResourcesDir = new File("src/test/resources/", "xmlconf/ibm/"); @@ -32,7 +31,7 @@ class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConfo *

    setUp.

    */ @BeforeEach - public void setUp() { + void setUp() { parser = new MXParser(); } @@ -46,7 +45,7 @@ public void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n01xml() throws IOException { + void testibm_not_wf_P66_ibm66n01xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n01.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -68,7 +67,7 @@ public void testibm_not_wf_P66_ibm66n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n02xml() throws IOException { + void testibm_not_wf_P66_ibm66n02xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n02.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -90,7 +89,7 @@ public void testibm_not_wf_P66_ibm66n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n03xml() throws IOException { + void testibm_not_wf_P66_ibm66n03xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n03.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -112,7 +111,7 @@ public void testibm_not_wf_P66_ibm66n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n04xml() throws IOException { + void testibm_not_wf_P66_ibm66n04xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n04.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -136,7 +135,7 @@ public void testibm_not_wf_P66_ibm66n04xml() throws IOException { * @throws org.codehaus.plexus.util.xml.pull.XmlPullParserException if any. */ @Test - public void testibm_not_wf_P66_ibm66n05xml() throws FileNotFoundException, IOException, XmlPullParserException { + void testibm_not_wf_P66_ibm66n05xml() throws FileNotFoundException, IOException, XmlPullParserException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n05.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -158,7 +157,7 @@ public void testibm_not_wf_P66_ibm66n05xml() throws FileNotFoundException, IOExc * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n06xml() throws IOException { + void testibm_not_wf_P66_ibm66n06xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n06.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -180,7 +179,7 @@ public void testibm_not_wf_P66_ibm66n06xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n07xml() throws IOException { + void testibm_not_wf_P66_ibm66n07xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n07.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -202,7 +201,7 @@ public void testibm_not_wf_P66_ibm66n07xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n08xml() throws IOException { + void testibm_not_wf_P66_ibm66n08xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n08.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -224,7 +223,7 @@ public void testibm_not_wf_P66_ibm66n08xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n09xml() throws IOException { + void testibm_not_wf_P66_ibm66n09xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n09.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -246,7 +245,7 @@ public void testibm_not_wf_P66_ibm66n09xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n10xml() throws IOException { + void testibm_not_wf_P66_ibm66n10xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n10.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -268,7 +267,7 @@ public void testibm_not_wf_P66_ibm66n10xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n11xml() throws IOException { + void testibm_not_wf_P66_ibm66n11xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n11.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -290,7 +289,7 @@ public void testibm_not_wf_P66_ibm66n11xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n12xml() throws IOException { + void testibm_not_wf_P66_ibm66n12xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n12.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -312,7 +311,7 @@ public void testibm_not_wf_P66_ibm66n12xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n13xml() throws IOException { + void testibm_not_wf_P66_ibm66n13xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n13.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -334,7 +333,7 @@ public void testibm_not_wf_P66_ibm66n13xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n14xml() throws IOException { + void testibm_not_wf_P66_ibm66n14xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P66/ibm66n14.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -356,7 +355,7 @@ public void testibm_not_wf_P66_ibm66n14xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P66_ibm66n15xml() throws IOException { + void testibm_not_wf_P66_ibm66n15xml() throws IOException { 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 9581bed..a2b2c16 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 @@ -20,7 +20,6 @@ * @version $Id: $Id * @since 3.4.0 */ -public class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConformanceTestSuite_Production80_Test { static final File testResourcesDir = new File("src/test/resources/", "xmlconf/ibm/"); @@ -31,7 +30,7 @@ class IBMXML10Tests_Test_IBMXMLConformanceTestSuite_not_wftests_Test_IBMXMLConfo *

    setUp.

    */ @BeforeEach - public void setUp() { + void setUp() { parser = new MXParser(); } @@ -45,7 +44,7 @@ public void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P80_ibm80n01xml() throws IOException { + void testibm_not_wf_P80_ibm80n01xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n01.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -67,7 +66,7 @@ public void testibm_not_wf_P80_ibm80n01xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P80_ibm80n02xml() throws IOException { + void testibm_not_wf_P80_ibm80n02xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n02.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -89,7 +88,7 @@ public void testibm_not_wf_P80_ibm80n02xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P80_ibm80n03xml() throws IOException { + void testibm_not_wf_P80_ibm80n03xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n03.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -112,7 +111,7 @@ public void testibm_not_wf_P80_ibm80n03xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P80_ibm80n04xml() throws IOException { + void testibm_not_wf_P80_ibm80n04xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n04.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -134,7 +133,7 @@ public void testibm_not_wf_P80_ibm80n04xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P80_ibm80n05xml() throws IOException { + void testibm_not_wf_P80_ibm80n05xml() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "not-wf/P80/ibm80n05.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -156,7 +155,7 @@ public void testibm_not_wf_P80_ibm80n05xml() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testibm_not_wf_P80_ibm80n06xml() throws IOException { + void testibm_not_wf_P80_ibm80n06xml() throws IOException { 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 0359b8c..543f84e 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 @@ -29,6 +29,7 @@ import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.xml.XmlStreamReader; +import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; @@ -42,14 +43,14 @@ * @version $Id: $Id * @since 3.4.0 */ -public class MXParserTest { +class MXParserTest { /** *

    testHexadecimalEntities.

    * * @throws java.lang.Exception if any. */ @Test - public void testHexadecimalEntities() throws Exception { + void hexadecimalEntities() throws Exception { MXParser parser = new MXParser(); parser.defineEntityReplacementText("test", "replacement"); @@ -73,7 +74,7 @@ public void testHexadecimalEntities() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testDecimalEntities() throws Exception { + void decimalEntities() throws Exception { MXParser parser = new MXParser(); parser.defineEntityReplacementText("test", "replacement"); @@ -97,7 +98,7 @@ public void testDecimalEntities() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testPredefinedEntities() throws Exception { + void predefinedEntities() throws Exception { MXParser parser = new MXParser(); parser.defineEntityReplacementText("test", "replacement"); @@ -122,7 +123,7 @@ public void testPredefinedEntities() throws Exception { * @throws java.io.IOException if any. */ @Test - public void testEntityReplacementMap() throws XmlPullParserException, IOException { + void entityReplacementMap() throws XmlPullParserException, IOException { EntityReplacementMap erm = new EntityReplacementMap(new String[][] {{"abc", "CDE"}, {"EFG", "HIJ"}}); MXParser parser = new MXParser(erm); @@ -141,7 +142,7 @@ public void testEntityReplacementMap() throws XmlPullParserException, IOExceptio * @throws java.lang.Exception if any. */ @Test - public void testCustomEntities() throws Exception { + void customEntities() throws Exception { MXParser parser = new MXParser(); String input = "&myentity;"; @@ -169,7 +170,7 @@ public void testCustomEntities() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testUnicodeEntities() throws Exception { + void unicodeEntities() throws Exception { MXParser parser = new MXParser(); String input = "𝟭"; parser.setInput(new StringReader(input)); @@ -195,7 +196,7 @@ public void testUnicodeEntities() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testInvalidCharacterReferenceHexa() throws Exception { + void invalidCharacterReferenceHexa() throws Exception { MXParser parser = new MXParser(); String input = ""; parser.setInput(new StringReader(input)); @@ -215,42 +216,42 @@ public void testInvalidCharacterReferenceHexa() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testValidCharacterReferenceHexa() throws Exception { + void validCharacterReferenceHexa() throws Exception { MXParser parser = new MXParser(); String input = " Ȁ퟿ᄁ�𐀀􏿽􏿿"; parser.setInput(new StringReader(input)); - try { - assertEquals(XmlPullParser.START_TAG, parser.nextToken()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0x9, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0xA, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0xD, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0x20, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0x200, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0xD7FF, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0xE000, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0xFFA2, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0xFFFD, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0x10000, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0x10FFFD, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(0x10FFFF, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.END_TAG, parser.nextToken()); - } catch (XmlPullParserException e) { - fail("Should success since the input represents all legal character references"); - } + Assertions.assertDoesNotThrow( + () -> { + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0x9, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0xA, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0xD, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0x20, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0x200, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0xD7FF, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0xE000, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0xFFA2, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0xFFFD, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0x10000, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0x10FFFD, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(0x10FFFF, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + }, + "Should success since the input represents all legal character references"); } /** @@ -259,7 +260,7 @@ public void testValidCharacterReferenceHexa() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testInvalidCharacterReferenceDecimal() throws Exception { + void invalidCharacterReferenceDecimal() throws Exception { MXParser parser = new MXParser(); String input = ""; parser.setInput(new StringReader(input)); @@ -279,42 +280,42 @@ public void testInvalidCharacterReferenceDecimal() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testValidCharacterReferenceDecimal() throws Exception { + void validCharacterReferenceDecimal() throws Exception { MXParser parser = new MXParser(); String input = " Ȁ퟿ᄁ�𐀀􏿽􏿿"; parser.setInput(new StringReader(input)); - try { - assertEquals(XmlPullParser.START_TAG, parser.nextToken()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(9, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(10, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(13, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(32, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(512, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(55295, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(57344, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(65442, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(65533, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(65536, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(1114109, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(1114111, parser.getText().codePointAt(0)); - assertEquals(XmlPullParser.END_TAG, parser.nextToken()); - } catch (XmlPullParserException e) { - fail("Should success since the input represents all legal character references"); - } + Assertions.assertDoesNotThrow( + () -> { + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(9, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(10, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(13, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(32, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(512, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(55295, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(57344, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(65442, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(65533, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(65536, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(1114109, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(1114111, parser.getText().codePointAt(0)); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + }, + "Should success since the input represents all legal character references"); } /** @@ -323,7 +324,7 @@ public void testValidCharacterReferenceDecimal() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testParserPosition() throws Exception { + void parserPosition() throws Exception { String input = " \n \tnnn\n"; @@ -351,7 +352,7 @@ public void testParserPosition() throws Exception { } @Test - public void testProcessingInstruction() throws Exception { + void processingInstruction() throws Exception { String input = "nnn"; MXParser parser = new MXParser(); @@ -369,7 +370,7 @@ public void testProcessingInstruction() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testProcessingInstructionsContainingXml() throws Exception { + void processingInstructionsContainingXml() throws Exception { StringBuffer sb = new StringBuffer(); sb.append(""); @@ -397,7 +398,7 @@ public void testProcessingInstructionsContainingXml() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testMalformedProcessingInstructionsContainingXmlNoClosingQuestionMark() throws Exception { + void malformedProcessingInstructionsContainingXmlNoClosingQuestionMark() throws Exception { StringBuffer sb = new StringBuffer(); sb.append("\n"); sb.append("\n"); @@ -424,7 +425,7 @@ public void testMalformedProcessingInstructionsContainingXmlNoClosingQuestionMar } @Test - public void testSubsequentProcessingInstructionShort() throws Exception { + void subsequentProcessingInstructionShort() throws Exception { StringBuffer sb = new StringBuffer(); sb.append(""); @@ -449,7 +450,7 @@ public void testSubsequentProcessingInstructionShort() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testSubsequentProcessingInstructionMoreThan8k() throws Exception { + void subsequentProcessingInstructionMoreThan8k() throws Exception { StringBuffer sb = new StringBuffer(); sb.append(""); @@ -493,7 +494,7 @@ public void testSubsequentProcessingInstructionMoreThan8k() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testLargeText_NoOverflow() throws Exception { + void largeTextNoOverflow() throws Exception { StringBuffer sb = new StringBuffer(); sb.append(""); sb.append(""); @@ -518,7 +519,7 @@ public void testLargeText_NoOverflow() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testMalformedProcessingInstructionAfterTag() throws Exception { + void malformedProcessingInstructionAfterTag() throws Exception { MXParser parser = new MXParser(); String input = ""; @@ -544,7 +545,7 @@ public void testMalformedProcessingInstructionAfterTag() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testMalformedProcessingInstructionBeforeTag() throws Exception { + void malformedProcessingInstructionBeforeTag() throws Exception { MXParser parser = new MXParser(); String input = ""; @@ -570,7 +571,7 @@ public void testMalformedProcessingInstructionBeforeTag() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testMalformedProcessingInstructionSpaceBeforeName() throws Exception { + void malformedProcessingInstructionSpaceBeforeName() throws Exception { MXParser parser = new MXParser(); StringBuilder sb = new StringBuilder(); @@ -600,7 +601,7 @@ public void testMalformedProcessingInstructionSpaceBeforeName() throws Exception * @throws java.lang.Exception if any. */ @Test - public void testMalformedProcessingInstructionNoClosingQuestionMark() throws Exception { + void malformedProcessingInstructionNoClosingQuestionMark() throws Exception { MXParser parser = new MXParser(); StringBuilder sb = new StringBuilder(); @@ -629,7 +630,7 @@ public void testMalformedProcessingInstructionNoClosingQuestionMark() throws Exc * @throws java.lang.Exception if any. */ @Test - public void testSubsequentMalformedProcessingInstructionNoClosingQuestionMark() throws Exception { + void subsequentMalformedProcessingInstructionNoClosingQuestionMark() throws Exception { MXParser parser = new MXParser(); StringBuilder sb = new StringBuilder(); @@ -658,7 +659,7 @@ public void testSubsequentMalformedProcessingInstructionNoClosingQuestionMark() * @throws java.lang.Exception if any. */ @Test - public void testSubsequentAbortedProcessingInstruction() throws Exception { + void subsequentAbortedProcessingInstruction() throws Exception { MXParser parser = new MXParser(); StringBuilder sb = new StringBuilder(); sb.append(""); @@ -680,7 +681,7 @@ public void testSubsequentAbortedProcessingInstruction() throws Exception { } @Test - public void testSubsequentAbortedComment() throws Exception { + void subsequentAbortedComment() throws Exception { MXParser parser = new MXParser(); StringBuilder sb = new StringBuilder(); sb.append(""); @@ -701,7 +702,7 @@ public void testSubsequentAbortedComment() throws Exception { } @Test - public void testMalformedXMLRootElement() throws Exception { + void malformedXMLRootElement() throws Exception { String input = " { + assertEquals(XmlPullParser.PROCESSING_INSTRUCTION, parser.nextToken()); + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + }, + "Should not throw Exception"); } /** @@ -835,7 +836,7 @@ public void testXMLDeclVersionOnly() throws Exception { * @throws java.lang.Exception if any. */ @Test - public void testXMLDeclVersionEncodingStandaloneNoSpace() throws Exception { + void xmlDeclVersionEncodingStandaloneNoSpace() throws Exception { String input = ""; MXParser parser = new MXParser(); @@ -856,7 +857,7 @@ public void testXMLDeclVersionEncodingStandaloneNoSpace() throws Exception { * @since 3.4.1 */ @Test - public void testEncodingISO_8859_1_newXmlReader() throws IOException { + void encodingISO88591NewXmlReader() throws IOException { try (Reader reader = new XmlStreamReader(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { MXParser parser = new MXParser(); parser.setInput(reader); @@ -876,7 +877,7 @@ public void testEncodingISO_8859_1_newXmlReader() throws IOException { * @since 3.4.1 */ @Test - public void testEncodingISO_8859_1_InputStream() throws IOException { + void encodingISO88591InputStream() throws IOException { try (InputStream input = Files.newInputStream(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { MXParser parser = new MXParser(); @@ -899,21 +900,21 @@ public void testEncodingISO_8859_1_InputStream() throws IOException { * @since 3.4.2 */ @Test - public void testEncodingISO_8859_1_StringReader() throws IOException { + void encodingISO88591StringReader() throws IOException { String xmlFileContents; try (Reader reader = new XmlStreamReader(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { xmlFileContents = IOUtil.toString(reader); } - try { - MXParser parser = new MXParser(); - parser.setInput(new StringReader(xmlFileContents)); - while (parser.nextToken() != XmlPullParser.END_DOCUMENT) - ; - assertTrue(true); - } catch (XmlPullParserException e) { - fail("should not raise exception: " + e); - } + Assertions.assertDoesNotThrow( + () -> { + MXParser parser = new MXParser(); + parser.setInput(new StringReader(xmlFileContents)); + while (parser.nextToken() != XmlPullParser.END_DOCUMENT) + ; + assertTrue(true); + }, + "should not raise exception: "); } /** @@ -926,7 +927,7 @@ public void testEncodingISO_8859_1_StringReader() throws IOException { * @since 3.5.2 */ @Test - public void testEncodingISO_8859_1_newReader() throws IOException { + void encodingISO88591NewReader() throws IOException { // 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. @@ -953,7 +954,7 @@ public void testEncodingISO_8859_1_newReader() throws IOException { * @since 3.5.2 */ @Test - public void testEncodingISO_8859_1_InputStream_encoded() throws IOException { + void encodingISO88591InputStreamEncoded() throws IOException { try (InputStream input = Files.newInputStream(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { MXParser parser = new MXParser(); @@ -974,7 +975,7 @@ public void testEncodingISO_8859_1_InputStream_encoded() throws IOException { * @since 3.4.1 */ @Test - public void testEncodingUTF8_newXmlReader() throws IOException { + void encodingUTF8NewXmlReader() throws IOException { try (Reader reader = new XmlStreamReader(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { MXParser parser = new MXParser(); parser.setInput(reader); @@ -1003,7 +1004,7 @@ private static void assertPosition(int row, int col, MXParser parser) { * @since 3.4.2 */ @Test - public void testCustomEntityNotFoundInText() throws Exception { + void customEntityNotFoundInText() throws Exception { MXParser parser = new MXParser(); String input = "&otherentity;"; @@ -1036,20 +1037,20 @@ public void testCustomEntityNotFoundInText() throws Exception { * @since 3.4.2 */ @Test - public void testCustomEntityNotFoundInTextTokenize() throws Exception { + void customEntityNotFoundInTextTokenize() throws Exception { MXParser parser = new MXParser(); String input = "&otherentity;"; parser.setInput(new StringReader(input)); parser.defineEntityReplacementText("myentity", "replacement"); - try { - assertEquals(XmlPullParser.START_TAG, parser.nextToken()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertNull(parser.getText()); - } catch (XmlPullParserException e) { - fail("should not throw exception if tokenize"); - } + Assertions.assertDoesNotThrow( + () -> { + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertNull(parser.getText()); + }, + "should not throw exception if tokenize"); } /** @@ -1064,7 +1065,7 @@ public void testCustomEntityNotFoundInTextTokenize() throws Exception { * @since 3.4.2 */ @Test - public void testCustomEntityNotFoundInAttr() throws Exception { + void customEntityNotFoundInAttr() throws Exception { MXParser parser = new MXParser(); String input = "sometext"; @@ -1097,7 +1098,7 @@ public void testCustomEntityNotFoundInAttr() throws Exception { * @since 3.4.2 */ @Test - public void testCustomEntityNotFoundInAttrTokenize() throws Exception { + void customEntityNotFoundInAttrTokenize() throws Exception { MXParser parser = new MXParser(); String input = "sometext"; @@ -1130,7 +1131,7 @@ public void testCustomEntityNotFoundInAttrTokenize() throws Exception { * @since 3.4.2 */ @Test - public void testDocdeclTextWithEntitiesUnix() throws IOException { + void docdeclTextWithEntitiesUnix() throws IOException { testDocdeclTextWithEntities("test-entities-UNIX.xml"); } @@ -1146,7 +1147,7 @@ public void testDocdeclTextWithEntitiesUnix() throws IOException { * @since 3.4.2 */ @Test - public void testDocdeclTextWithEntitiesDOS() throws IOException { + void docdeclTextWithEntitiesDOS() throws IOException { testDocdeclTextWithEntities("test-entities-DOS.xml"); } @@ -1183,7 +1184,7 @@ private void testDocdeclTextWithEntities(String filename) throws IOException { * @since 3.4.2 */ @Test - public void testDocdeclTextWithEntitiesInAttributesUnix() throws IOException { + void docdeclTextWithEntitiesInAttributesUnix() throws IOException { testDocdeclTextWithEntitiesInAttributes("test-entities-in-attr-UNIX.xml"); } @@ -1199,7 +1200,7 @@ public void testDocdeclTextWithEntitiesInAttributesUnix() throws IOException { * @since 3.4.2 */ @Test - public void testDocdeclTextWithEntitiesInAttributesDOS() throws IOException { + void docdeclTextWithEntitiesInAttributesDOS() throws IOException { testDocdeclTextWithEntitiesInAttributes("test-entities-in-attr-DOS.xml"); } @@ -1254,7 +1255,7 @@ private void testDocdeclTextWithEntitiesInAttributes(String filename) throws IOE * @since 3.4.2 */ @Test - public void testEntityRefTextUnix() throws IOException { + void entityRefTextUnix() throws IOException { testEntityRefText("\n"); } @@ -1268,7 +1269,7 @@ public void testEntityRefTextUnix() throws IOException { * @since 3.4.2 */ @Test - public void testEntityRefTextDOS() throws IOException { + void entityRefTextDOS() throws IOException { testEntityRefText("\r\n"); } @@ -1282,45 +1283,45 @@ private void testEntityRefText(String newLine) throws IOException { sb.append("]>").append(newLine); sb.append("&foo;&foo1;&foo2;&tritPos;"); - try { - MXParser parser = new MXParser(); - parser.setInput(new StringReader(sb.toString())); - parser.defineEntityReplacementText("foo", "ř"); - parser.defineEntityReplacementText("nbsp", " "); - parser.defineEntityReplacementText("foo1", " "); - parser.defineEntityReplacementText("foo2", "š"); - parser.defineEntityReplacementText("tritPos", "𝟭"); - - assertEquals(XmlPullParser.DOCDECL, parser.nextToken()); - assertEquals( - " test [\n" - + "\n" - + "\n" - + "\n" - + "\n" - + "]", - parser.getText()); - assertEquals(XmlPullParser.IGNORABLE_WHITESPACE, parser.nextToken()); - assertEquals(XmlPullParser.START_TAG, parser.nextToken()); - assertEquals("b", parser.getName()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals("ř", parser.getText()); - assertEquals("foo", parser.getName()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(" ", parser.getText()); - assertEquals("foo1", parser.getName()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals("š", parser.getText()); - assertEquals("foo2", parser.getName()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals("𝟭", parser.getText()); - assertEquals("tritPos", parser.getName()); - assertEquals(XmlPullParser.END_TAG, parser.nextToken()); - assertEquals("b", parser.getName()); - assertEquals(XmlPullParser.END_DOCUMENT, parser.nextToken()); - } catch (XmlPullParserException e) { - fail("should not raise exception: " + e); - } + Assertions.assertDoesNotThrow( + () -> { + MXParser parser = new MXParser(); + parser.setInput(new StringReader(sb.toString())); + parser.defineEntityReplacementText("foo", "ř"); + parser.defineEntityReplacementText("nbsp", " "); + parser.defineEntityReplacementText("foo1", " "); + parser.defineEntityReplacementText("foo2", "š"); + parser.defineEntityReplacementText("tritPos", "𝟭"); + + assertEquals(XmlPullParser.DOCDECL, parser.nextToken()); + assertEquals( + " test [\n" + + "\n" + + "\n" + + "\n" + + "\n" + + "]", + parser.getText()); + assertEquals(XmlPullParser.IGNORABLE_WHITESPACE, parser.nextToken()); + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals("b", parser.getName()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals("ř", parser.getText()); + assertEquals("foo", parser.getName()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(" ", parser.getText()); + assertEquals("foo1", parser.getName()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals("š", parser.getText()); + assertEquals("foo2", parser.getName()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals("𝟭", parser.getText()); + assertEquals("tritPos", parser.getName()); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + assertEquals("b", parser.getName()); + assertEquals(XmlPullParser.END_DOCUMENT, parser.nextToken()); + }, + "should not raise exception: "); } /** @@ -1333,36 +1334,36 @@ private void testEntityRefText(String newLine) throws IOException { * @since 3.4.2 */ @Test - public void testEntityReplacement() throws IOException { + void entityReplacement() throws IOException { String input = "

      

    "; - try { - MXParser parser = new MXParser(); - parser.setInput(new StringReader(input)); - parser.defineEntityReplacementText("nbsp", " "); - - assertEquals(XmlPullParser.START_TAG, parser.nextToken()); - assertEquals("p", parser.getName()); - assertEquals(XmlPullParser.COMMENT, parser.nextToken()); - assertEquals(" a pagebreak: ", parser.getText()); - assertEquals(XmlPullParser.COMMENT, parser.nextToken()); - assertEquals(" PB ", parser.getText()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals("\u00A0", parser.getText()); - assertEquals("#160", parser.getName()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals(" ", parser.getText()); - assertEquals("nbsp", parser.getName()); - assertEquals(XmlPullParser.START_TAG, parser.nextToken()); - assertEquals("unknown", parser.getName()); - assertEquals(XmlPullParser.END_TAG, parser.nextToken()); - assertEquals("unknown", parser.getName()); - assertEquals(XmlPullParser.END_TAG, parser.nextToken()); - assertEquals("p", parser.getName()); - assertEquals(XmlPullParser.END_DOCUMENT, parser.nextToken()); - } catch (XmlPullParserException e) { - fail("should not raise exception: " + e); - } + Assertions.assertDoesNotThrow( + () -> { + MXParser parser = new MXParser(); + parser.setInput(new StringReader(input)); + parser.defineEntityReplacementText("nbsp", " "); + + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals("p", parser.getName()); + assertEquals(XmlPullParser.COMMENT, parser.nextToken()); + assertEquals(" a pagebreak: ", parser.getText()); + assertEquals(XmlPullParser.COMMENT, parser.nextToken()); + assertEquals(" PB ", parser.getText()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals("\u00A0", parser.getText()); + assertEquals("#160", parser.getName()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals(" ", parser.getText()); + assertEquals("nbsp", parser.getName()); + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals("unknown", parser.getName()); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + assertEquals("unknown", parser.getName()); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + assertEquals("p", parser.getName()); + assertEquals(XmlPullParser.END_DOCUMENT, parser.nextToken()); + }, + "should not raise exception: "); } /** @@ -1376,50 +1377,50 @@ public void testEntityReplacement() throws IOException { * @since 3.4.2 */ @Test - public void testReplacementInPCArrayWithShorterCharArray() throws IOException { + void replacementInPCArrayWithShorterCharArray() throws IOException { String input = "]>" + "

    &&foo;&tritPos;

    "; - try { - MXParser parser = new MXParser(); - parser.setInput(new StringReader(new String(input.getBytes(), "ISO-8859-1"))); - parser.defineEntityReplacementText("foo", "ř"); - parser.defineEntityReplacementText("tritPos", "𝟭"); - - assertEquals(XmlPullParser.DOCDECL, parser.nextToken()); - assertEquals(" test []", parser.getText()); - assertEquals(XmlPullParser.START_TAG, parser.nextToken()); - assertEquals("section", parser.getName()); - assertEquals(1, parser.getAttributeCount()); - assertEquals("name", parser.getAttributeName(0)); - assertEquals("&ř𝟭", parser.getAttributeValue(0)); - assertEquals(XmlPullParser.START_TAG, parser.nextToken()); - assertEquals("

    ", parser.getText()); - assertEquals("p", parser.getName()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals("&", parser.getText()); - assertEquals("amp", parser.getName()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals("ř", parser.getText()); - assertEquals("foo", parser.getName()); - assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); - assertEquals("𝟭", parser.getText()); - assertEquals("tritPos", parser.getName()); - assertEquals(XmlPullParser.END_TAG, parser.nextToken()); - assertEquals("p", parser.getName()); - assertEquals(XmlPullParser.END_TAG, parser.nextToken()); - assertEquals("section", parser.getName()); - assertEquals(XmlPullParser.END_DOCUMENT, parser.nextToken()); - } catch (XmlPullParserException e) { - fail("should not raise exception: " + e); - } + Assertions.assertDoesNotThrow( + () -> { + MXParser parser = new MXParser(); + parser.setInput(new StringReader(new String(input.getBytes(), "ISO-8859-1"))); + parser.defineEntityReplacementText("foo", "ř"); + parser.defineEntityReplacementText("tritPos", "𝟭"); + + assertEquals(XmlPullParser.DOCDECL, parser.nextToken()); + assertEquals(" test []", parser.getText()); + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals("section", parser.getName()); + assertEquals(1, parser.getAttributeCount()); + assertEquals("name", parser.getAttributeName(0)); + assertEquals("&ř𝟭", parser.getAttributeValue(0)); + assertEquals(XmlPullParser.START_TAG, parser.nextToken()); + assertEquals("

    ", parser.getText()); + assertEquals("p", parser.getName()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals("&", parser.getText()); + assertEquals("amp", parser.getName()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals("ř", parser.getText()); + assertEquals("foo", parser.getName()); + assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); + assertEquals("𝟭", parser.getText()); + assertEquals("tritPos", parser.getName()); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + assertEquals("p", parser.getName()); + assertEquals(XmlPullParser.END_TAG, parser.nextToken()); + assertEquals("section", parser.getName()); + assertEquals(XmlPullParser.END_DOCUMENT, parser.nextToken()); + }, + "should not raise exception: "); } /** * Ensures emoji can be parsed correctly */ @Test - public void testUnicode() throws IOException { + void unicode() throws IOException { String input = ""; try { @@ -1439,7 +1440,7 @@ public void testUnicode() throws IOException { } @Test - public void testProcessingInstructionTokenizeBeforeFirstTag() throws Exception { + void processingInstructionTokenizeBeforeFirstTag() throws Exception { String input = "nnn"; MXParser parser = new MXParser(); @@ -1457,7 +1458,7 @@ public void testProcessingInstructionTokenizeBeforeFirstTag() throws Exception { } @Test - public void testProcessingInstructionTokenizeAfterXMLDeclAndBeforeFirstTag() throws Exception { + void processingInstructionTokenizeAfterXMLDeclAndBeforeFirstTag() throws Exception { String input = "nnn"; MXParser parser = new MXParser(); @@ -1478,7 +1479,7 @@ public void testProcessingInstructionTokenizeAfterXMLDeclAndBeforeFirstTag() thr @ParameterizedTest @ValueSource(strings = {" ", "\n", "\r", "\r\n", " ", "\n "}) - void testBlankAtBeginning(String ws) throws XmlPullParserException, IOException { + void blankAtBeginning(String ws) throws XmlPullParserException, IOException { 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 0b1d3d7..bc5f026 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 @@ -12,7 +12,7 @@ class MXSerializerTest { @Test - void testSerialize() throws Exception { + void serialize() throws Exception { StringWriter writer = new StringWriter(); @@ -33,7 +33,7 @@ void testSerialize() throws Exception { } @Test - void testDeserialize() throws Exception { + void deserialize() throws Exception { MXParser parser = new MXParser(); parser.setInput(new StringReader(expectedOutput())); int eventType = parser.getEventType(); @@ -61,7 +61,7 @@ private String expectedOutput() { * Tests MJAVADOC-793. */ @Test - public void testWriteNullValues() throws IOException { + void writeNullValues() throws IOException { // 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 642e729..e362c2f 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 @@ -32,7 +32,7 @@ public class eduni_misc_Test_BjoernHoehrmannviaHST2013_09_18_Test { *

    setUp.

    */ @BeforeEach - public void setUp() { + void setUp() { parser = new MXParser(); } @@ -46,7 +46,7 @@ public void setUp() { * @throws java.io.IOException if there is an I/O error */ @Test - public void testhst_bh_001() throws IOException { + void testhst_bh_001() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "001.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -67,7 +67,7 @@ public void testhst_bh_001() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testhst_bh_002() throws IOException { + void testhst_bh_002() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "002.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -88,7 +88,7 @@ public void testhst_bh_002() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testhst_bh_003() throws IOException { + void testhst_bh_003() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "003.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -109,7 +109,7 @@ public void testhst_bh_003() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testhst_bh_004() throws IOException { + void testhst_bh_004() throws IOException { try (Reader reader = new FileReader(new File(testResourcesDir, "004.xml"))) { parser.setInput(reader); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -177,7 +177,7 @@ public void testhst_bh_006() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testhst_lhs_007() throws IOException { + void testhst_lhs_007() throws IOException { try (InputStream is = new FileInputStream(new File(testResourcesDir, "007.xml"))) { parser.setInput(is, null); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -198,7 +198,7 @@ public void testhst_lhs_007() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testhst_lhs_008() throws IOException { + void testhst_lhs_008() throws IOException { try (InputStream is = new FileInputStream(new File(testResourcesDir, "008.xml"))) { parser.setInput(is, null); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) @@ -219,7 +219,7 @@ public void testhst_lhs_008() throws IOException { * @throws java.io.IOException if there is an I/O error */ @Test - public void testhst_lhs_009() throws IOException { + void testhst_lhs_009() throws IOException { try (InputStream is = new FileInputStream(new File(testResourcesDir, "009.xml"))) { parser.setInput(is, null); while (parser.nextToken() != XmlPullParser.END_DOCUMENT) From bf0366425bfd7b637b29b30ca2ab203b6d619df2 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Mon, 16 Dec 2024 00:25:31 +0100 Subject: [PATCH 36/45] Cleanup tests and drop dependency to plexus-utils --- pom.xml | 12 ++-- .../util/xml/PrettyPrintXMLWriterTest.java | 56 +++++++++---------- .../codehaus/plexus/util/xml/TestUtils.java | 47 ++++++++++++++++ .../plexus/util/xml/XmlStreamReaderTest.java | 11 ++-- .../plexus/util/xml/XmlStreamWriterTest.java | 3 +- .../codehaus/plexus/util/xml/XmlUtilTest.java | 13 +++-- .../plexus/util/xml/XmlWriterUtilTest.java | 28 ++++------ .../codehaus/plexus/util/xml/Xpp3DomTest.java | 19 ++----- .../plexus/util/xml/pull/MXParserTest.java | 35 ++++++------ 9 files changed, 125 insertions(+), 99 deletions(-) create mode 100644 src/test/java/org/codehaus/plexus/util/xml/TestUtils.java diff --git a/pom.xml b/pom.xml index 3443aec..f0fc7da 100644 --- a/pom.xml +++ b/pom.xml @@ -49,6 +49,7 @@ limitations under the License. 17 + 1.37 2024-05-21T21:02:17Z @@ -67,24 +68,23 @@ limitations under the License. org.openjdk.jmh jmh-core - 1.37 + ${jmhVersion} test org.openjdk.jmh jmh-generator-annprocess - 1.37 + ${jmhVersion} test org.junit.jupiter - junit-jupiter + junit-jupiter-api test - org.codehaus.plexus - plexus-utils - 4.0.2 + org.junit.jupiter + junit-jupiter-params test 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 00f4079..f26631d 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/PrettyPrintXMLWriterTest.java @@ -26,7 +26,6 @@ import java.nio.file.Files; import java.util.NoSuchElementException; -import org.codehaus.plexus.util.StringUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Disabled; @@ -165,7 +164,7 @@ void testendElementAlreadyClosed() { } /** - * Issue #51: https://github.com/codehaus-plexus/plexus-utils/issues/51 Purpose: test if concatenation string + * Issue #51: Issue 51 Purpose: test if concatenation string * optimization bug is present. Target environment: Java 7 (u79 and u80 verified) running on Windows. Detection * strategy: Tries to build a big XML file (~750MB size) and with many nested tags to force the JVM to trigger the * concatenation string optimization bug that throws a NoSuchElementException when calling endElement() method. @@ -232,34 +231,29 @@ private String expectedResult(String lineSeparator) { } private String expectedResult(String lineIndenter, String lineSeparator) { - StringBuilder expected = new StringBuilder(); - - expected.append("").append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 1)).append("").append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 2)) - .append("Codestin Search App") - .append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 2)) - .append("") - .append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 2)) - .append("") - .append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 1)).append("").append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 1)).append("").append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 2)) - .append("

    Paragraph 1, line 1. Paragraph 1, line 2.

    ") - .append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 2)) - .append("
    ") - .append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 3)) - .append("

    Section title

    ") - .append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 2)).append("
    ").append(lineSeparator); - expected.append(StringUtils.repeat(lineIndenter, 1)).append("").append(lineSeparator); - expected.append(""); - - return expected.toString(); + return "" + lineSeparator + lineIndenter + + "" + lineSeparator + lineIndenter + + lineIndenter + "Codestin Search App" + + lineSeparator + + lineIndenter + + lineIndenter + "" + + lineSeparator + + lineIndenter + + lineIndenter + "" + + lineSeparator + + lineIndenter + + "" + lineSeparator + lineIndenter + + "" + lineSeparator + lineIndenter + + lineIndenter + "

    Paragraph 1, line 1. Paragraph 1, line 2.

    " + + lineSeparator + + lineIndenter + + lineIndenter + "
    " + + lineSeparator + + lineIndenter + + lineIndenter + lineIndenter + "

    Section title

    " + + lineSeparator + + lineIndenter + + lineIndenter + "
    " + lineSeparator + lineIndenter + + "" + lineSeparator + ""; } } diff --git a/src/test/java/org/codehaus/plexus/util/xml/TestUtils.java b/src/test/java/org/codehaus/plexus/util/xml/TestUtils.java new file mode 100644 index 0000000..b824d1e --- /dev/null +++ b/src/test/java/org/codehaus/plexus/util/xml/TestUtils.java @@ -0,0 +1,47 @@ +package org.codehaus.plexus.util.xml; + +import java.io.IOException; +import java.io.Reader; +import java.io.StringWriter; + +public class TestUtils { + + public static String readAllFrom(Reader input) throws IOException { + StringWriter output = new StringWriter(); + char[] buffer = new char[16384]; + int n = 0; + while (0 <= (n = input.read(buffer))) { + output.write(buffer, 0, n); + } + output.flush(); + return output.toString(); + } + /** + *

    + * How many times is the substring in the larger String. + *

    + *

    + * null returns 0. + *

    + * + * @param str the String to check + * @param sub the substring to count + * @return the number of occurrences, 0 if the String is null + * @throws NullPointerException if sub is null + */ + public static int countMatches(String str, String sub) { + if (sub.isEmpty()) { + return 0; + } + if (str == null) { + return 0; + } + int count = 0; + int idx = 0; + while ((idx = str.indexOf(sub, idx)) != -1) { + count++; + idx += sub.length(); + } + return count; + } +} 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 c87f9f7..0390ac2 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlStreamReaderTest.java @@ -21,10 +21,10 @@ import java.io.InputStream; import java.io.SequenceInputStream; -import org.codehaus.plexus.util.IOUtil; import org.junit.jupiter.api.Test; import org.opentest4j.AssertionFailedError; +import static org.codehaus.plexus.util.xml.TestUtils.readAllFrom; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertThrows; @@ -68,8 +68,7 @@ private static String createXmlContent(String text, String encoding) { if (encoding != null) { xmlDecl = ""; } - String xml = xmlDecl + "\n" + text + ""; - return xml; + return xmlDecl + "\n" + text + ""; } private static void checkXmlContent(String xml, String encoding) throws IOException { @@ -86,8 +85,7 @@ private static void checkXmlContent(String xml, String encoding, byte... bom) th XmlStreamReader reader = new XmlStreamReader(in); assertEquals(encoding, reader.getEncoding()); - String result = IOUtil.toString(reader); - assertEquals(xml, result); + assertEquals(xml, readAllFrom(reader)); } private static void checkXmlStreamReader(String text, String encoding, String effectiveEncoding) @@ -228,10 +226,9 @@ void ebcdicEncoding() throws IOException { /** *

    testInappropriateEncoding.

    * - * @throws java.io.IOException if any. */ @Test - void inappropriateEncoding() throws IOException { + void inappropriateEncoding() { // expected failure, since the encoding does not contain some characters assertThrows( AssertionFailedError.class, 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 19b4027..a7028d9 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlStreamWriterTest.java @@ -52,8 +52,7 @@ private static String createXmlContent(String text, String encoding) { if (encoding != null) { xmlDecl = ""; } - String xml = xmlDecl + "\n" + text + ""; - return xml; + return xmlDecl + "\n" + text + ""; } private static void checkXmlContent(String xml, String encoding) throws IOException { diff --git a/src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java b/src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java index 4805cd6..b5049f8 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlUtilTest.java @@ -25,10 +25,9 @@ import java.io.Writer; import java.nio.file.Files; -import org.codehaus.plexus.util.IOUtil; -import org.codehaus.plexus.util.StringUtils; import org.junit.jupiter.api.Test; +import static org.codehaus.plexus.util.xml.TestUtils.readAllFrom; import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; @@ -116,18 +115,20 @@ void prettyFormatString() throws Exception { String content; try (Reader reader = new XmlStreamReader(testDocument)) { - content = IOUtil.toString(reader); + content = readAllFrom(reader); } - Writer writer = new StringWriter(); + String contentPretty; try (Reader reader = new XmlStreamReader(testDocument)) { + Writer writer = new StringWriter(); XmlUtil.prettyFormat(reader, writer); + contentPretty = writer.toString(); } assertNotNull(content); - int countEOL = StringUtils.countMatches(content, XmlUtil.DEFAULT_LINE_SEPARATOR); - assertTrue(countEOL < StringUtils.countMatches(writer.toString(), XmlUtil.DEFAULT_LINE_SEPARATOR)); + int countEOL = TestUtils.countMatches(content, XmlUtil.DEFAULT_LINE_SEPARATOR); + assertTrue(countEOL < TestUtils.countMatches(contentPretty, XmlUtil.DEFAULT_LINE_SEPARATOR)); } /** diff --git a/src/test/java/org/codehaus/plexus/util/xml/XmlWriterUtilTest.java b/src/test/java/org/codehaus/plexus/util/xml/XmlWriterUtilTest.java index d0b94f8..2a8c54a 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/XmlWriterUtilTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/XmlWriterUtilTest.java @@ -20,7 +20,6 @@ import java.io.OutputStream; import java.io.Writer; -import org.codehaus.plexus.util.StringUtils; import org.junit.jupiter.api.AfterEach; import org.junit.jupiter.api.BeforeEach; import org.junit.jupiter.api.Test; @@ -76,7 +75,7 @@ void tearDown() throws Exception { void writeLineBreakXMLWriter() throws Exception { XmlWriterUtil.writeLineBreak(xmlWriter); writer.close(); - assertEquals(1, StringUtils.countMatches(output.toString(), XmlWriterUtil.LS)); + assertEquals(1, TestUtils.countMatches(output.toString(), XmlWriterUtil.LS)); } /** @@ -89,7 +88,7 @@ void writeLineBreakXMLWriter() throws Exception { void writeLineBreakXMLWriterInt() throws Exception { XmlWriterUtil.writeLineBreak(xmlWriter, 10); writer.close(); - assertEquals(10, StringUtils.countMatches(output.toString(), XmlWriterUtil.LS)); + assertEquals(10, TestUtils.countMatches(output.toString(), XmlWriterUtil.LS)); } /** @@ -102,11 +101,8 @@ void writeLineBreakXMLWriterInt() throws Exception { void writeLineBreakXMLWriterIntInt() throws Exception { XmlWriterUtil.writeLineBreak(xmlWriter, 10, 2); writer.close(); - assertEquals(10, StringUtils.countMatches(output.toString(), XmlWriterUtil.LS)); - assertEquals( - 1, - StringUtils.countMatches( - output.toString(), StringUtils.repeat(" ", 2 * XmlWriterUtil.DEFAULT_INDENTATION_SIZE))); + assertEquals(10, TestUtils.countMatches(output.toString(), XmlWriterUtil.LS)); + assertEquals(1, TestUtils.countMatches(output.toString(), " ")); // } /** @@ -119,8 +115,8 @@ void writeLineBreakXMLWriterIntInt() throws Exception { void writeLineBreakXMLWriterIntIntInt() throws Exception { XmlWriterUtil.writeLineBreak(xmlWriter, 10, 2, 4); writer.close(); - assertEquals(10, StringUtils.countMatches(output.toString(), XmlWriterUtil.LS)); - assertEquals(1, StringUtils.countMatches(output.toString(), StringUtils.repeat(" ", 2 * 4))); + assertEquals(10, TestUtils.countMatches(output.toString(), XmlWriterUtil.LS)); + assertEquals(1, TestUtils.countMatches(output.toString(), " ")); } /** @@ -211,7 +207,7 @@ void writeCommentXMLWriterString() throws Exception { */ @Test void writeCommentXMLWriterStringInt() throws Exception { - String indent = StringUtils.repeat(" ", 2 * XmlWriterUtil.DEFAULT_INDENTATION_SIZE); + String indent = " "; XmlWriterUtil.writeComment(xmlWriter, "hello", 2); writer.close(); @@ -253,7 +249,7 @@ void writeCommentXMLWriterStringInt() throws Exception { */ @Test void writeCommentXMLWriterStringIntInt() throws Exception { - String repeat = StringUtils.repeat(" ", 2 * 4); + String repeat = " "; XmlWriterUtil.writeComment(xmlWriter, "hello", 2, 4); writer.close(); @@ -291,7 +287,7 @@ void writeCommentXMLWriterStringIntInt() throws Exception { */ @Test void writeCommentXMLWriterStringIntIntInt() throws Exception { - String indent = StringUtils.repeat(" ", 2 * 4); + String indent = " "; XmlWriterUtil.writeComment(xmlWriter, "hello", 2, 4, 50); writer.close(); @@ -339,7 +335,7 @@ void writeCommentTextXMLWriterStringInt() throws Exception { tearDown(); setUp(); - String indent = StringUtils.repeat(" ", 2 * 2); + String indent = " "; XmlWriterUtil.writeCommentText( xmlWriter, @@ -380,7 +376,7 @@ void writeCommentTextXMLWriterStringInt() throws Exception { */ @Test void writeCommentTextXMLWriterStringIntInt() throws Exception { - String indent = StringUtils.repeat(" ", 2 * 4); + String indent = " "; XmlWriterUtil.writeCommentText(xmlWriter, "hello", 2, 4); writer.close(); @@ -411,7 +407,7 @@ void writeCommentTextXMLWriterStringIntInt() throws Exception { */ @Test void writeCommentTextXMLWriterStringIntIntInt() throws Exception { - String indent = StringUtils.repeat(" ", 2 * 4); + String indent = " "; XmlWriterUtil.writeCommentText(xmlWriter, "hello", 2, 4, 50); writer.close(); 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 828c6cd..9c3d85f 100644 --- a/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java +++ b/src/test/java/org/codehaus/plexus/util/xml/Xpp3DomTest.java @@ -194,18 +194,11 @@ void shouldNotMergeValues() { @Test void nullAttributeNameOrValue() { Xpp3Dom t1 = new Xpp3Dom("top"); - try { - t1.setAttribute("attr", null); - fail("null attribute values shouldn't be allowed"); - } catch (NullPointerException e) { - } - t1.toString(); - try { - t1.setAttribute(null, "value"); - fail("null attribute names shouldn't be allowed"); - } catch (NullPointerException e) { - } - t1.toString(); + assertThrows(NullPointerException.class, () -> t1.setAttribute("attr", null)); + assertNotNull(t1.toString()); + + assertThrows(NullPointerException.class, () -> t1.setAttribute(null, "value")); + assertNotNull(t1.toString()); } /** @@ -217,7 +210,7 @@ void equals() { assertEquals(dom, dom); assertNotEquals(null, dom); - assertNotEquals(dom, new Xpp3Dom("")); + assertNotEquals(new Xpp3Dom(""), dom); } /** 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 543f84e..7a817b9 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 @@ -27,13 +27,12 @@ import java.nio.file.Files; import java.nio.file.Paths; -import org.codehaus.plexus.util.IOUtil; import org.codehaus.plexus.util.xml.XmlStreamReader; -import org.junit.jupiter.api.Assertions; import org.junit.jupiter.api.Test; import org.junit.jupiter.params.ParameterizedTest; import org.junit.jupiter.params.provider.ValueSource; +import static org.codehaus.plexus.util.xml.TestUtils.readAllFrom; import static org.junit.jupiter.api.Assertions.*; /** @@ -222,7 +221,7 @@ void validCharacterReferenceHexa() throws Exception { " Ȁ퟿ᄁ�𐀀􏿽􏿿"; parser.setInput(new StringReader(input)); - Assertions.assertDoesNotThrow( + assertDoesNotThrow( () -> { assertEquals(XmlPullParser.START_TAG, parser.nextToken()); assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); @@ -286,7 +285,7 @@ void validCharacterReferenceDecimal() throws Exception { " Ȁ퟿ᄁ�𐀀􏿽􏿿"; parser.setInput(new StringReader(input)); - Assertions.assertDoesNotThrow( + assertDoesNotThrow( () -> { assertEquals(XmlPullParser.START_TAG, parser.nextToken()); assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); @@ -821,7 +820,7 @@ void xmlDeclVersionOnly() throws Exception { MXParser parser = new MXParser(); parser.setInput(new StringReader(input)); - Assertions.assertDoesNotThrow( + assertDoesNotThrow( () -> { assertEquals(XmlPullParser.PROCESSING_INSTRUCTION, parser.nextToken()); assertEquals(XmlPullParser.START_TAG, parser.nextToken()); @@ -850,7 +849,7 @@ void xmlDeclVersionEncodingStandaloneNoSpace() throws Exception { } /** - * Issue 163: https://github.com/codehaus-plexus/plexus-utils/issues/163 + * Issue 163: Issue 163 * * @throws IOException if IO error. * @@ -870,7 +869,7 @@ void encodingISO88591NewXmlReader() throws IOException { } /** - * Issue 163: https://github.com/codehaus-plexus/plexus-utils/issues/163 + * Issue 163: Issue 163 * * @throws IOException if IO error. * @@ -891,8 +890,8 @@ void encodingISO88591InputStream() throws IOException { } /** - * Issue 163: https://github.com/codehaus-plexus/plexus-utils/issues/163 - * + * Issue 163: Issue 163 + *

    * Another case of bug #163: File encoding information is lost after the input file is copied to a String. * * @throws IOException if IO error. @@ -903,10 +902,10 @@ void encodingISO88591InputStream() throws IOException { void encodingISO88591StringReader() throws IOException { String xmlFileContents; try (Reader reader = new XmlStreamReader(Paths.get("src/test/resources/xml", "test-encoding-ISO-8859-1.xml"))) { - xmlFileContents = IOUtil.toString(reader); + xmlFileContents = readAllFrom(reader); } - Assertions.assertDoesNotThrow( + assertDoesNotThrow( () -> { MXParser parser = new MXParser(); parser.setInput(new StringReader(xmlFileContents)); @@ -918,7 +917,7 @@ void encodingISO88591StringReader() throws IOException { } /** - * Issue 163: https://github.com/codehaus-plexus/plexus-utils/issues/163 + * Issue 163: Issue 163 * * Another case of bug #163: Reader generated with ReaderFactory.newReader and the right file encoding. * @@ -945,7 +944,7 @@ void encodingISO88591NewReader() throws IOException { } /** - * Issue 163: https://github.com/codehaus-plexus/plexus-utils/issues/163 + * Issue 163: Issue 163 * * Another case of bug #163: InputStream supplied with the right file encoding. * @@ -968,7 +967,7 @@ void encodingISO88591InputStreamEncoded() throws IOException { } /** - * Issue 163: https://github.com/codehaus-plexus/plexus-utils/issues/163 + * Issue 163: Issue 163 * * @throws IOException if IO error. * @@ -1044,7 +1043,7 @@ void customEntityNotFoundInTextTokenize() throws Exception { parser.setInput(new StringReader(input)); parser.defineEntityReplacementText("myentity", "replacement"); - Assertions.assertDoesNotThrow( + assertDoesNotThrow( () -> { assertEquals(XmlPullParser.START_TAG, parser.nextToken()); assertEquals(XmlPullParser.ENTITY_REF, parser.nextToken()); @@ -1283,7 +1282,7 @@ private void testEntityRefText(String newLine) throws IOException { sb.append("]>").append(newLine); sb.append("&foo;&foo1;&foo2;&tritPos;"); - Assertions.assertDoesNotThrow( + assertDoesNotThrow( () -> { MXParser parser = new MXParser(); parser.setInput(new StringReader(sb.toString())); @@ -1337,7 +1336,7 @@ private void testEntityRefText(String newLine) throws IOException { void entityReplacement() throws IOException { String input = "

      

    "; - Assertions.assertDoesNotThrow( + assertDoesNotThrow( () -> { MXParser parser = new MXParser(); parser.setInput(new StringReader(input)); @@ -1381,7 +1380,7 @@ void replacementInPCArrayWithShorterCharArray() throws IOException { String input = "]>" + "

    &&foo;&tritPos;

    "; - Assertions.assertDoesNotThrow( + assertDoesNotThrow( () -> { MXParser parser = new MXParser(); parser.setInput(new StringReader(new String(input.getBytes(), "ISO-8859-1"))); From 1f1ff6f331bd98c326620b8a452657800edfa3a7 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Wed, 25 Dec 2024 23:42:25 +0100 Subject: [PATCH 37/45] Upgrade to Maven 4.0.0-rc-2 --- README.md | 2 +- pom.xml | 4 ++-- src/site/markdown/index.md | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index c7ea09d..347452c 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.co this step is released as `plexus-xml` 3, maintained in [3.x branch](tree/3.x)\ [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml), -2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-beta-5/api/maven-api-xml)/[`maven-xml-impl`](https://github.com/apache/maven/tree/maven-4.0.0-beta-5/maven-xml-impl):\ +2. then updated to use Maven 4-specific [`maven-xml-api`](https://github.com/apache/maven/tree/maven-4.0.0-rc-2/api/maven-api-xml)/[`maven-xml`](https://github.com/apache/maven/tree/maven-4.0.0-rc-2/maven-xml):\ this is the `master` branch from which `plexus-xml` 4 is released\ Version 4.x requires Java 17 (like Maven 4) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) diff --git a/pom.xml b/pom.xml index f0fc7da..f690fa0 100644 --- a/pom.xml +++ b/pom.xml @@ -56,8 +56,8 @@ limitations under the License. org.apache.maven - maven-xml-impl - 4.0.0-beta-5 + maven-xml + 4.0.0-rc-2 org.eclipse.sisu diff --git a/src/site/markdown/index.md b/src/site/markdown/index.md index 4e77c87..7ac1952 100644 --- a/src/site/markdown/index.md +++ b/src/site/markdown/index.md @@ -4,5 +4,5 @@ A collection of various utility classes to ease working with XML. This library consists of XML classes (`org.codehaus.plexus.util.xml` and `org.codehaus.plexus.util.xml.pull`): 1. that have been extracted from [`plexus-utils`](../plexus-utils/) 4, -2. then updated to use [`maven-xml-api`](https://maven.apache.org/ref/4.0.0-beta-5/api/maven-api-xml/)/[`maven-xml-impl`](https://maven.apache.org/ref/4.0.0-beta-5/maven-xml-impl/index.html) +2. then updated to use [`maven-xml-api`](https://maven.apache.org/ref/4.0.0-rc-2/api/maven-api-xml/)/[`maven-xml`](https://maven.apache.org/ref/4.0.0-rc-2/maven-xml/index.html) From 26b97493136bf30d34b9f14c2a97e933b0f59ae5 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Feb 2025 15:40:28 +0000 Subject: [PATCH 38/45] Bump org.codehaus.plexus:plexus from 19 to 20 Bumps [org.codehaus.plexus:plexus](https://github.com/codehaus-plexus/plexus-pom) from 19 to 20. - [Release notes](https://github.com/codehaus-plexus/plexus-pom/releases) - [Commits](https://github.com/codehaus-plexus/plexus-pom/commits) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index f690fa0..84dcafb 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.codehaus.plexus plexus - 19 + 20 plexus-xml From 2b85a28dbadeb283cff8a63e21d5555165385f81 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 10 Mar 2025 16:31:22 +0000 Subject: [PATCH 39/45] Bump org.apache.maven:maven-xml from 4.0.0-rc-2 to 4.0.0-rc-3 Bumps [org.apache.maven:maven-xml](https://github.com/apache/maven) from 4.0.0-rc-2 to 4.0.0-rc-3. - [Release notes](https://github.com/apache/maven/releases) - [Commits](https://github.com/apache/maven/compare/maven-4.0.0-rc-2...maven-4.0.0-rc-3) --- updated-dependencies: - dependency-name: org.apache.maven:maven-xml dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 84dcafb..5f3a0d2 100644 --- a/pom.xml +++ b/pom.xml @@ -57,7 +57,7 @@ limitations under the License. org.apache.maven maven-xml - 4.0.0-rc-2 + 4.0.0-rc-3 org.eclipse.sisu From fd8cf37adbf40c49b5a14870385275ff61dc6059 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Fri, 14 Mar 2025 14:39:01 +0100 Subject: [PATCH 40/45] Apply spotless re-formatting Detected in the course of support-and-care/maven-support-and-care#77. --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 347452c..d72d9e9 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ Plexus-Xml -============ +========== [![Build Status](https://github.com/codehaus-plexus/plexus-xml/actions/workflows/maven.yml/badge.svg)](https://github.com/codehaus-plexus/plexus-xml/actions) [![Maven Central](https://img.shields.io/maven-central/v/org.codehaus.plexus/plexus-xml.svg?label=Maven%20Central&versionPrefix=3.)](https://search.maven.org/artifact/org.codehaus.plexus/plexus-xml) @@ -22,3 +22,4 @@ For publishing [the site](https://codehaus-plexus.github.io/plexus-xml/) do the ``` mvn -Preporting verify site site:stage scm-publish:publish-scm ``` + From 9f89131f53747476234b285cfbd6c351aa57f1f9 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sat, 5 Apr 2025 18:07:03 +0200 Subject: [PATCH 41/45] [maven-release-plugin] prepare release plexus-xml-4.1.0 --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 5f3a0d2..ca7b61f 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ limitations under the License. plexus-xml - 4.1.0-SNAPSHOT + 4.1.0 Plexus XML Utilities A collection of various utility classes to ease working with XML. @@ -33,7 +33,7 @@ limitations under the License. scm:git:https://github.com/codehaus-plexus/plexus-xml.git ${project.scm.connection} - master + plexus-xml-4.1.0 https://github.com/codehaus-plexus/plexus-xml/tree/${project.scm.tag}/ @@ -50,7 +50,7 @@ limitations under the License. 17 1.37 - 2024-05-21T21:02:17Z + 2025-04-05T16:06:58Z From 924660bae07dcc8ec0df3e9b60e1ba7b18855cd1 Mon Sep 17 00:00:00 2001 From: Sylwester Lachiewicz Date: Sat, 5 Apr 2025 18:07:06 +0200 Subject: [PATCH 42/45] [maven-release-plugin] prepare for next development iteration --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index ca7b61f..cc110de 100644 --- a/pom.xml +++ b/pom.xml @@ -24,7 +24,7 @@ limitations under the License. plexus-xml - 4.1.0 + 4.1.1-SNAPSHOT Plexus XML Utilities A collection of various utility classes to ease working with XML. @@ -33,7 +33,7 @@ limitations under the License. scm:git:https://github.com/codehaus-plexus/plexus-xml.git ${project.scm.connection} - plexus-xml-4.1.0 + master https://github.com/codehaus-plexus/plexus-xml/tree/${project.scm.tag}/ @@ -50,7 +50,7 @@ limitations under the License. 17 1.37 - 2025-04-05T16:06:58Z + 2025-04-05T16:07:06Z From 1407ddc87ba515e35fc948535d87884e95ac909b Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 26 May 2025 16:07:03 +0000 Subject: [PATCH 43/45] Bump org.codehaus.plexus:plexus from 20 to 21 Bumps [org.codehaus.plexus:plexus](https://github.com/codehaus-plexus/plexus-pom) from 20 to 21. - [Release notes](https://github.com/codehaus-plexus/plexus-pom/releases) - [Commits](https://github.com/codehaus-plexus/plexus-pom/commits) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus dependency-version: '21' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index cc110de..19a1596 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.codehaus.plexus plexus - 20 + 21 plexus-xml From 9434226f83ea3a9091e6b5ef6a3fe87c881d2841 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 3 Jun 2025 15:28:39 +0000 Subject: [PATCH 44/45] Bump org.codehaus.plexus:plexus from 21 to 22 Bumps [org.codehaus.plexus:plexus](https://github.com/codehaus-plexus/plexus-pom) from 21 to 22. - [Release notes](https://github.com/codehaus-plexus/plexus-pom/releases) - [Commits](https://github.com/codehaus-plexus/plexus-pom/commits) --- updated-dependencies: - dependency-name: org.codehaus.plexus:plexus dependency-version: '22' dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 19a1596..df91a92 100644 --- a/pom.xml +++ b/pom.xml @@ -20,7 +20,7 @@ limitations under the License. org.codehaus.plexus plexus - 21 + 22 plexus-xml From bad0a2b466b0700a88b21be80f9c673af32a3606 Mon Sep 17 00:00:00 2001 From: Goooler Date: Tue, 3 Jun 2025 17:30:50 +0800 Subject: [PATCH 45/45] Declare license info in POM --- pom.xml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pom.xml b/pom.xml index df91a92..a18a5a5 100644 --- a/pom.xml +++ b/pom.xml @@ -30,6 +30,14 @@ limitations under the License. A collection of various utility classes to ease working with XML. https://codehaus-plexus.github.io/plexus-xml/ + + + Apache-2.0 + https://www.apache.org/licenses/LICENSE-2.0.txt + repo + + + scm:git:https://github.com/codehaus-plexus/plexus-xml.git ${project.scm.connection}