Fix #3303: distinguish JUnit 6 ParameterizedClass invocations (#3432)

* Fix #3303: keep JUnit 6 ParameterizedClass invocations distinct

@ParameterizedClass uses a [class-template-invocation:#N] unique-id
segment and a ClassSource parent. The method legacy name no longer
carries [N], so rerunFailingTestsCount merged a pass+fail pair into
one flaky name.

Append that index to the reported method name, same as we already do
for @ParameterizedTest.

* Fix #3303: keep nested ParameterizedClass indices

Collect every class-template-invocation index so nested parameterizations stay distinct. Do not re-append when the legacy name already carries the class index.

* Fix #3303: parse UniqueId segments for class/method indexes

Use UniqueId.parse().getSegments() instead of string scanning.
Rebuild the reported name as [class][method] so a method-only
legacy suffix is not treated as the class index.
2 files changed
tree: 766458107cecfe1a609926023679e9f906e1a9df
  1. .github/
  2. .mvn/
  3. maven-failsafe-plugin/
  4. maven-surefire-common/
  5. maven-surefire-plugin/
  6. maven-surefire-report-plugin/
  7. src/
  8. surefire-api/
  9. surefire-booter/
  10. surefire-extensions-api/
  11. surefire-extensions-spi/
  12. surefire-its/
  13. surefire-logger-api/
  14. surefire-providers/
  15. surefire-report-parser/
  16. surefire-shadefire/
  17. surefire-shared-utils/
  18. .asf.yaml
  19. .editorconfig
  20. .git-blame-ignore-revs
  21. .gitattributes
  22. .gitignore
  23. AGENTS.md
  24. CONTRIBUTING.md
  25. deploySite.sh
  26. Jenkinsfile
  27. LICENSE
  28. pom.xml
  29. README.md
  30. SECURITY.md
README.md

Contributing to Apache Maven Surefire

Maven Central Apache License, Version 2.0, January 2004

CI Jenkins Build Jenkins Tests

Verify Reproducible Builds

The Maven Community

slack forks

Project Documentation

Maven 3.0 Plugin API

Usage of maven-surefire-plugin, maven-failsafe-plugin, maven-surefire-report-plugin

Development Information

Build the Surefire project using Maven 3.6.3+ and JDK 8+.

  • In order to run tests for a release check during the Vote, the following memory requirements are needed:

    On Linux/Unix:

    export MAVEN_OPTS="-server -Xmx512m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true"
    

    On Windows:

    set MAVEN_OPTS="-server -Xmx256m -XX:MetaspaceSize=128m -XX:MaxMetaspaceSize=384m -XX:+UseG1GC -XX:+UseStringDeduplication -XX:+TieredCompilation -XX:TieredStopAtLevel=1 -XX:SoftRefLRUPolicyMSPerMB=50 -Djava.awt.headless=true"
    
  • In order to build and run the tests:

    mvn install site site:stage -P reporting,run-its
    
  • To set up the project in Eclipse IDE or IntelliJ IDEA, please follow these steps:

    • Build module surefire-shared-utils with profile ide-development and install it into the local maven repository using this Maven command:

      mvn install -P ide-development -f surefire-shared-utils/pom.xml
      
    • In Eclipse, select File > Import ... > Maven Project

      • Select all projects (poms) except surefire-shared-utils, enter profile ide-development in Advanced -> Profiles
    • In IntelliJ, select Maven > Profiles and check ide-development

Deploying web site

See http://maven.apache.org/developers/website/deploy-component-reference-documentation.html

Built with Maven