查看 informal spec 中的 this question ,我注意到没有错误元素。这只是一个疏忽吗? CruiseControl 似乎从某处提取错误。
<testsuites>
<testsuite name="name" errors="1" failures="0">
<testcase name="name">
<error>Some error message</error>
</testcase>
</testsuite>
</testsuites>
最佳答案
你可以查看这个article .本文修改后的示例:
<target name="test">
<junit printsummary="withOutAndErr" fork="off" haltonfailure="no">
<classpath refid="classpath.test"/>
<formatter type="brief" usefile="false"/>
<test name="packagename.MyTest"/>
</junit>
</target>
您可以在控制台(或报告文件)中看到来自 junit 测试的所有消息
您可以在 ant site 阅读有关 printsummary、haltonfailure
属性和其他属性的信息.
其他useful link .
关于java - JUnit XML 格式真的没有错误元素吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7759586/