小编use*_*762的帖子

JUnit没有提供有关"错误"的信息

我正在使用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>
Run Code Online (Sandbox Code Playgroud)

当我运行"ant test"时,它说(例如)2次测试运行,0次失败,1次错误.它没有说"没有NoSuchTest这样的测试",即使这是完全合理的,并且让我弄清楚错误的原因.

谢谢!

-担

java ant junit

16
推荐指数
2
解决办法
1万
查看次数

如何使Ant INCLUDE文件集优先于EXCLUDE

如果我有这样的文件集:

<fileset dir=".">
  <exclude name="classes/*"/>
  <include name="**/zar.class"/>   
</fileset>
Run Code Online (Sandbox Code Playgroud)

排除优先于include,我不会以任何类结束.[因为对于这个假设的例子,zar.class在类dir中]我想包含zar文件,即使它在类dir中.

我暂时对抗这个问题,阅读有关选择器,模式集,文件集,尝试组合文件集等但无法使其正常工作.

有人知道怎么做吗?

ant include fileset

9
推荐指数
2
解决办法
1万
查看次数

标签 统计

ant ×2

fileset ×1

include ×1

java ×1

junit ×1