Skip to content

Fix reportNameSuffix in XML testcase classname#3379

Open
goutamadwant wants to merge 1 commit into
apache:masterfrom
goutamadwant:fix-surefire-3210-report-name-suffix
Open

Fix reportNameSuffix in XML testcase classname#3379
goutamadwant wants to merge 1 commit into
apache:masterfrom
goutamadwant:fix-surefire-3210-report-name-suffix

Conversation

@goutamadwant

Copy link
Copy Markdown

Fixes #3210

Summary

This preserves reportNameSuffix on the XML <testcase classname="..."> attribute when Surefire falls back from a missing qualified source name to the report source text.

The XML reporter already applies the suffix when a qualified source name is available. The missing case was the fallback path, where sourceText was returned without applying the configured suffix.

Changes

  • apply reportNameSuffix consistently through WrappedReportEntry#getSourceQualifiedName
  • add focused unit coverage for the fallback path
  • add an integration test fixture that verifies the generated XML report contains the suffix in both the test suite name and testcase classname

Verification

  • mvn -pl maven-surefire-common -Dtest=WrappedReportEntryTest,StatelessXmlReporterTest test
  • mvn -pl maven-surefire-common -DskipTests -Dinvoker.skip=true install
  • mvn -pl surefire-its -P run-its -Dit.test=Surefire3210ReportNameSuffixIT -Dits.forkCount=1 -Dinvoker.skip=true verify
  • mvn -pl surefire-its -am -DskipTests -Dinvoker.skip=true install
  • mvn clean install
  • mvn -Prun-its clean install
  • git diff --check

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. A more thorough check will be performed on your pull request automatically.
  • 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.

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.

Missing suffix in testcase classname XML report

1 participant