How to make junit testing to stop after first failing test

霸气de小男生 提交于 2019-12-10 14:53:58

问题


Is there a way to make running junit test to stop after a test fails?


回答1:


Yes ... this ability (or the lack of it) is built into the various TestRunners (Console, AWT, Swing, Ant, Maven or the one built into Eclipse, etc). You'll have to look for this control in the documentation for the specific platform you're using.




回答2:


I know that in Ant, the junit task has options "haltonerror" and "haltonfailure" that controls this behavior.



来源:https://stackoverflow.com/questions/188606/how-to-make-junit-testing-to-stop-after-first-failing-test

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!