2014-02-21 34 views
0

是否有任何方法配置mvn命令以显示在测试摘要中(在Results:部分中)运行了哪些测试(测试类中的测试方法)过于冗长的-X选项?在没有-X选项的情况下显示在测试类中运行的所有测试

------------------------------------------------------- 
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 

回答

1

不,不容易。运行测试的maven-surefire-plugin只能生成您已经看到的失败测试的摘要和列表(DefaultReporterFactory#runCompleted)。

如果你真的想将其添加到构建,你可以处理留在target/surefire-reports测试已运行后,可能使用Groovy脚本或类似的东西XSLT to standard output的XML文件。

相关问题