0

我们从 Ant 脚本运行 JUnit 测试,如下所示。当测试失败时,我希望它输出导致失败的异常的堆栈转储,但事实并非如此。有没有什么技巧可以甩掉它?

<target description="Run JUnit tests" name="run-junit" depends="build-junit">
    <copy file="./AegisLicense.txt" tofile="test/junit/classes/AegisLicense.txt" overwrite="true"/>
    <junit printsummary="yes" haltonfailure="no" fork="yes" forkmode="once" failureproperty="run-aegis-junit-failed" showoutput="yes" filtertrace="off">
        <classpath refid="Aegisoft.testsupport.classpath"/>
        <classpath>
            <pathelement location="test/junit/classes"/>
        </classpath>
        <batchtest>
            <fileset dir="test/junit/src">
                <include name="**"/>
            </fileset>
        </batchtest>
    </junit>
 <fail
4

1 回答 1

1

在我看到这个问题之前,我已经在这里发布了这个。我认为这个问题是重复的。

这是我的junit标签,它确实产生了异常跟踪

  <!-- #Formatters for capture and display -->
  <formatter
    type="brief"
    usefile="false"
  />
  <formatter type="brief" />
  <formatter
    type="xml"
    if="test.generate.xml.output"
  />

  <!-- #Test case isolation technique -->
  <test
    name="${testcase}"
    if="testcase"
  />

  <batchtest
    todir="${test.data.dir}"
    unless="testcase"
  >
    <fileset dir="${classes.dir}">
      <include name="**/Test*.class" />
      <exclude name="**/Test*$*.class" />
    </fileset>
  </batchtest>

</junit>

我认为可以为你做的一个嵌套元素是

  <formatter
    type="brief"
    usefile="false"
  />
于 2010-03-19T20:14:19.793 回答