规格 用于 JUnit XML 输出
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/442556/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Spec. for JUnit XML Output
提问by Gilad Naor
Where can I find the specification of JUnit's XML output. My goal is to write a UnitTest++ XML reporter which produced JUnit like output.
在哪里可以找到 JUnit 的 XML 输出规范。我的目标是编写一个 UnitTest++ XML 报告器,它产生类似 JUnit 的输出。
See: "Unable to get hudson to parse JUnit test output XML" and "Hudson, C++ and UnitTest++"
请参阅:“无法让 hudson 解析 JUnit 测试输出 XML”和“ Hudson、C++ 和 UnitTest++”
回答by Tom Howard
You can find an XSD based on the code in Apache Ant 1.8.2 at https://github.com/windyroad/JUnit-Schema
您可以在https://github.com/windyroad/JUnit-Schema 中找到基于 Apache Ant 1.8.2 中的代码的 XSD
回答by Laurent Doré
The xml output is not generated by JUnit (at least, not the junit.jar), but by the junit ant task.
The relevant class is org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter.
xml 输出不是由JUnit(至少不是junit.jar)生成的,而是由junit ant 任务生成的。
相关类是org.apache.tools.ant.taskdefs.optional.junit.XMLJUnitResultFormatter。
回答by HD.
I found some informal spec at http://ant.1045680.n5.nabble.com/schema-for-junit-xml-output-td1375274.html
我在http://ant.1045680.n5.nabble.com/schema-for-junit-xml-output-td1375274.html找到了一些非正式的规范
回答by case nelson
回答by guerda
I can only give you an general information.
我只能给你一个大概的信息。
In the sourcecode of JUnit, you will find your information.
If you provide some more information, I can help you further. My personal hint for finding your specification would be junit.framework.TestResult.
在JUnit的源代码中,您会找到您的信息。如果您提供更多信息,我可以进一步帮助您。我个人对找到您的规范的提示是junit.framework.TestResult.
Good luck!
祝你好运!

