You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2020/04/01 07:21:51 UTC

[GitHub] [maven-surefire] sonOfRa commented on a change in pull request #281: [SUREFIRE-1766] Surefire does not display TestNG data provider values on command line

sonOfRa commented on a change in pull request #281: [SUREFIRE-1766] Surefire does not display TestNG data provider values on command line
URL: https://github.com/apache/maven-surefire/pull/281#discussion_r401404960
 
 

 ##########
 File path: surefire-providers/surefire-testng/src/main/java/org/apache/maven/surefire/testng/TestNGReporter.java
 ##########
 @@ -183,4 +183,21 @@ public void onConfigurationSuccess( ITestResult result )
         //onTestSuccess( result );
     }
 
+    /**
+     * Acquire a better representation of the test name that includes parameters and the invocation count, if there are
+     * any parameters
+     *
+     * @param result the test result to extract from
+     * @return a descriptive name for the test
+     */
+    private static String testName( ITestResult result )
+    {
+        Object[] parameters = result.getParameters();
+        if ( parameters == null || parameters.length == 0 )
+        {
+            return result.getName();
+        }
+        return result.getName() + Arrays.toString(
 
 Review comment:
   I used the values here on purpose, rather than the types: Yes, there may be readability problems for complex types, but the whole point was that you could quickly see at a glance *for which exact values* the parametrized test has failed. I don't really see any additional value in adding just the parameter types; I think most people won't have overloaded test methods that do different things with regards to their parameters. TestNG's own HTML report also contains these, no matter if my fix is included or not:
   
   ![testng-report](https://user-images.githubusercontent.com/1269520/78109774-31a2ea00-73fa-11ea-974e-59f62c497ab1.png)
   

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services