Skip to content

Fix invalid XML characters in Surefire reports - #3408

Draft
kush2439p wants to merge 5 commits into
apache:masterfrom
kush2439p:codex/fix-surefire-3399
Draft

Fix invalid XML characters in Surefire reports#3408
kush2439p wants to merge 5 commits into
apache:masterfrom
kush2439p:codex/fix-surefire-3399

Conversation

@kush2439p

Copy link
Copy Markdown

Fixes #3399

What changed

  • Sanitize invalid XML 1.0 code points in report attributes, text output, CDATA, and system properties.
  • Preserve valid supplementary Unicode characters.
  • Handle streamed UTF-8 output across write boundaries, including malformed sequences.
  • Add regression coverage for invalid characters, chunk boundaries, CDATA, attributes, and report parsing.

Validation

  • Focused StatelessXmlReporterTest: 13 tests passed.
  • Compiler compilation passed.
  • Checkstyle passed.
  • git diff --check passed.

The full reactor test compile was not reliable in this Windows/JDK 25 environment because of a reactor classpath/forked compiler issue; the focused reporter suite passed.

Apache checklist

  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Run mvn clean install to make sure basic checks pass.
  • You have run the integration tests successfully (mvn -Prun-its clean install).
  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004.

Fixes apache#3399

Sanitize invalid XML 1.0 characters in Surefire reports while preserving valid supplementary Unicode characters and streamed UTF-8 output. Add focused regression coverage for report attributes, text output, CDATA, malformed UTF-8, and chunk boundaries.
Correct the source file location for apache#3399.
Remove the unchanged upstream test before replacing it with the regression coverage for apache#3399.
…t/java/org/apache/maven/plugin/surefire/report/StatelessXmlReporterTest.java

Place the regression test at the existing module path for apache#3399.
Remove the accidental root-level source copy after placing the implementation in its module path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Invalid character in SureFire xml test report

1 participant