Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant JUnit未显示失败的测试详细信息_Junit_Ant_Ant Junit - Fatal编程技术网

Ant JUnit未显示失败的测试详细信息

Ant JUnit未显示失败的测试详细信息,junit,ant,ant-junit,Junit,Ant,Ant Junit,我使用的是Ant版本1.9.7和JUnit 4.12。My build.xml如下所示: <target name="run-junit" depends="init, compile, compile-junit"> <junit printsummary="yes" > <formatter type="xml"/> <classpath><pathelement location="lib/jun

我使用的是Ant版本1.9.7和JUnit 4.12。My build.xml如下所示:

<target name="run-junit" depends="init, compile, compile-junit">
    <junit printsummary="yes" >
        <formatter type="xml"/>
        <classpath><pathelement location="lib/junit-4.12.jar"/></classpath>
        <batchtest fork="yes" todir="${out.dir}">
            <fileset dir="${bin.dir}">
                <include name="**/*Test.class"/>
            </fileset>
        </batchtest>
    </junit>
</target>

但没有更多细节。如何解决此问题?

要获得有关每个失败测试的更多详细信息,请使用
而不是


使用“普通”格式化程序会产生类似于以下内容的输出:

[junit]运行TestMyTest1
[junit]测试运行:1,失败:1,错误:0,跳过:0,运行时间:0.014秒
[少年]
[junit]测试用例:testMyTest花费了0.003秒
[junit]失败了
[junit]预期:但是:
[junit]junit.framework.AssertionFailedError:应为:但为:
[junit]位于TestMyTest1.testMyTest(TestMyTest1.java:17)
[少年]
[junit]测试MyTest1失败

谢谢,我会试试这个!两者都有可能吗@今天春天 是,
接受多个
元素。
<junit printsummary="yes">
    <formatter type="plain" usefile="false"/>
    <classpath><pathelement location="lib/junit-4.12.jar"/></classpath>
    <batchtest fork="yes" todir="${out.dir}">
        <fileset dir="${bin.dir}">
            <include name="**/*Test.class"/>
        </fileset>
    </batchtest>
</junit>