我可以从RunListener添加测试失败吗?

时间:2019-02-27 09:28:22

标签: junit junit4 maven-surefire-plugin

我想在测试套件(RunListener.testRunFinished)的最后检查线程是否泄漏,如果线程泄漏,则构建失败。

不能将AssertionError中的testRunFinished()抛出,因为它完全停止了构建,而忽略了其他模块。

09:57:09.520 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-failsafe-plugin:3.0.0-M3:verify (default) on project project-module: There are test failures.
09:57:09.521 [ERROR] 
09:57:09.522 [ERROR] Please refer to /home/user/project/target/failsafe-reports for the individual test results.
09:57:09.522 [ERROR] Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
09:57:09.523 [ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: ExecutionException There was an error in the forked process

0 个答案:

没有答案