我正在使用Junit 4.4和Ant 1.7。如果测试用例由于错误而失败(例如,因为方法抛出了意外的异常),我将无法获得有关错误的任何详细信息。
我的build.xml文件如下所示:
<target name="test" depends="compile">
<junit printsummary="withOutAndErr" filtertrace="no" fork="yes" haltonfailure="yes" showoutput="yes">
<classpath refid="project.run.path"/>
<test name="a.b.c.test.TestThingee1"/>
<test name="a.b.c.test.NoSuchTest"/>
</junit>
</target>
当我运行“ant test”时,它会显示(例如)2个测试运行,0个失败,1个错误。即使完全合理并且可以让我找出错误的原因,它也不会说“没有名为NoSuchTest的测试”。谢谢!
-Dan