0

Is there any way to configure the mvn command to display which tests (test methods within a test class) were run in the test summary (in the Results: section) without using the overly verbose -X option?

-------------------------------------------------------
 T E S T S
-------------------------------------------------------
Running com.myproject.MyTestClass
Tests run: 2, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 0.033 sec <<< FAILURE!

Results :
  #I would like to show the passed test here
Failed tests: 
  testTwo(com.myproject.MyTestClass)

Tests run: 2, Failures: 1, Errors: 0, Skipped: 0
amphibient
  • 29,770
  • 54
  • 146
  • 240

1 Answers1

1

No, not easily. maven-surefire-plugin, which runs the tests, can only produce the summary and list of failed tests that you already see (DefaultReporterFactory#runCompleted).

If you really wanted to add it to the build, you could process the XML files left in target/surefire-reports after the tests have run, perhaps using a Groovy script or something like XSLT to standard output.

Community
  • 1
  • 1
Joe
  • 29,416
  • 12
  • 68
  • 88