JUnit的给有关&QUOT任何信息;错误" [英] JUnit gives no information regarding "errors"

查看:158
本文介绍了JUnit的给有关&QUOT任何信息;错误"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用JUnit 4.4和Ant 1.7。如果测试案例失败与错误(例如,由于方法引发了意外的异常),我没有得到什么错误是任何细节。

I'm using Junit 4.4 and Ant 1.7. If a test case fails with an error (for example because a method threw an unexpected exception) I don't get any details about what the error was.

我的build.xml文件看起来是这样的:

My build.xml looks like this:

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

当我运行蚂蚁测试它说,(例如)2测试运行,0失败,1错误。它并没有说没有这样的测试是NoSuchTest即使这是完全合理的,让我找出错误的原因。

When I run "ant test" it says (for example) 2 Test runs, 0 failures, 1 error. It doesn't say "There is no such test as NoSuchTest" even though this is completely reasonable and would let me figure out the cause of the error.

谢谢!

-Dan

推荐答案

想通了:)

我需要添加JUnit的块内的格式化。

I needed to add a "formatter" inside the junit block.

<formatter type="plain" usefile="false" />

什么是PITA。

What a PITA.

-Dan

这篇关于JUnit的给有关&QUOT任何信息;错误&QUOT;的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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