fail(String message) 方法在测试中调用两次时的行为如何

How does the fail(String message) method behave when its called twice in a Test

我在文档中读到方法 "Fails a test with the given failure message." 。我发现一些代码包含 2 个失败语句。我是否正确地相信,如果第一个语句失败并因此结束测试,第二个语句将永远不会被调用?如果第一个 fail() 没有失败,会发生什么?如果第二个 fail() 发生,测试能通过吗?

我做了一些尝试,相信第二次失败永远不会被执行。

@Test
public void testIllegalArguments(){
try {
    new House("", 50);
    fail("ExampleText");

    new House("123", -1);
    fail("exampleText");
} catch (IllegalArgumentException ignored) {
}

}

第二个 fail() 永远不会执行,因为一旦出现异常或错误,执行就会中止(当您调用 fail() 时抛出 AssertionError