jaikiran commented on PR #121:
URL: https://github.com/apache/ant/pull/121#issuecomment-1675840246

   Hello Vincent @don-vip,
   > Can we please get the same output as JUnit 4? 
Test.testMethod[displayedName]
   
   I had forgottent about this. But now that I went backed and looked at it, 
this should be easily customized using the `@ParameterizedTest`s `name` 
attribute. I have now added an example to Ant testsuite to show how it's done.  
See this 
https://github.com/apache/ant/blob/master/src/tests/junit/org/example/junitlauncher/jupiter/JupiterSampleTest.java#L80
 which uses:
   
   ```java
       @ParameterizedTest(name = "{displayName} asserting {0} is an even 
number")
   ...
       void testEvenFails(final int val) {
   
   ```
   and then in the junitlauncher's task:
   
   ```xml
   <junitlauncher>
   ...
       <listener type="legacy-xml" ...
                      useLegacyReportingName="false" />
   ...
   ```
   
   which then reports the test as:
   
   <img width="838" alt="foo" 
src="https://github.com/apache/ant/assets/143523/b937c32c-7ac2-4264-bd0d-9a3bfe90f1a9";>
   


-- 
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: dev-unsubscr...@ant.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@ant.apache.org
For additional commands, e-mail: dev-h...@ant.apache.org

Reply via email to