蚂蚁:Junit的故障会引发haltonfailure [英] Ant : Junit failure triggers a haltonfailure

查看:468
本文介绍了蚂蚁:Junit的故障会引发haltonfailure的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经发现了以下内容:

I have found that the following :

<junit haltonfailure="no" haltonerror="no" >
   <!-- some tests guaranteed to call Assert.fail(); --> 
</junit>

不会prematurely停止(所有测试将运行)。

Will not prematurely halt (all tests will run).

但......以下

<junit haltonfailure="no" haltonerror="yes" >

后的第一次失败的测试将失败。注意,在这种情况下,我低保测试经由Assert.fail()不

Will fail after the FIRST failed test. Note that in this case, I'm guaranteeing that the test is failing via Assert.fail();

此,我假设,要么

1)蚂蚁认为一个错误是失败的子类。或

1) Ant considers an ERROR to be a subclass of a FAILURE. or

2)有蚂蚁percieves失败的方式古怪 - 也就是说,故障被处理(错误地)为错误决定,停止时

2) There is a oddity in the way ant percieves failures - that is, failures are treated (erroneously) as errors when deciding to halt.

我的问题:为什么蚂蚁会停止对测试失败(即使与haltonfailure =明确配置无)。任何想法可能是很有启发!谢谢。

My Question : Why would ant would halt on a test failure (even when explicitly configured with haltonfailure="no"). Any thoughts could be very enlightening ! Thanks.

更新

我现在意识到,这显然是它是覆盖在蚂蚁 HTTP的RTFM问题: //ant.apache.org/manual/Tasks/junit.html (见下面的正确答案)。

I now realize that this is clearly an RTFM question which is covered in the ant http://ant.apache.org/manual/Tasks/junit.html (see correct answer below).

推荐答案

从报价的junit Ant任务的文档

Quote from junit ant task documentation:

haltonfailure:如果测试失败(错误被认为是失败的,以及)停止构建过程

haltonfailure: Stop the build process if a test fails (errors are considered failures as well).

因此​​,答案是:蚂蚁的junit认为失败的错误,构建因此停止

So the answer is: ant junit considers failures as errors, hence the stop of the build

这篇关于蚂蚁:Junit的故障会引发haltonfailure的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆