olamy commented on code in PR #3432:
URL: https://github.com/apache/maven-surefire/pull/3432#discussion_r3795144353


##########
surefire-providers/surefire-junit-platform/src/main/java/org/apache/maven/surefire/junitplatform/RunListenerAdapter.java:
##########
@@ -462,14 +498,26 @@ private ResultDisplay toClassMethodName(TestIdentifier 
testIdentifier) {
                     .map(TestIdentifier::getLegacyReportingName)
                     .anyMatch(legacyReportingName -> 
legacyReportingName.matches("^\\[.+]$"));
             boolean isTestTemplate = 
testIdentifier.getLegacyReportingName().matches("^.*\\[\\d+]$");
-
-            boolean parameterized = isParameterized || hasParameterizedParent 
|| isTestTemplate;
+            // JUnit 6 @ParameterizedClass parents have a ClassSource, so they 
are missed by
+            // hasParameterizedParent, and the method legacy name no longer 
includes [N] (#3303).
+            String classTemplateInvocationSuffix = 
extractClassTemplateInvocationSuffix(testIdentifier.getUniqueId());
+
+            boolean parameterized = isParameterized
+                    || hasParameterizedParent
+                    || isTestTemplate
+                    || !classTemplateInvocationSuffix.isEmpty();
             String methodName = methodSource.getMethodName();
             String description = testIdentifier.getLegacyReportingName();
             boolean equalDescriptions = methodDisplay.equals(description);
             boolean hasLegacyDescription = description.startsWith(methodName + 
'(');
             boolean hasDisplayName = !equalDescriptions || 
!hasLegacyDescription;
             String methodDesc = parameterized ? description : methodName;
+            // JUnit 6.1+ already puts the class index before a method 
invocation index

Review Comment:
   I think the class-invocation index is appended after the method index 
(foo()[m][c]), or collapses on the diagonal (c==m → foo()[c]). This contradicts 
the [class][method].
   2 class invocations × method invocations #1/#2 → foo(String)[1], 
foo(String)[2][1], foo(String)[1][2], foo(String)[2]
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to