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