单元测试报告的 XML 格式规范(DTD、XSD..)
许多工具为单元测试报告生成和使用相同的 XML 文件格式。
示例(来源):
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="0" failures="0" hostname="hazelnut.osuosl.org" name="net.cars.engine.MoteurTest" tests="6" time="0.021" timestamp="2007-11-02T23:13:50">
<properties>
<property name="java.vendor" value="IBM Corporation" />
<property name="os.name" value="Linux" />
<!-- more property tags-->
</properties>
<testcase classname="net.cars.engine.MoteurTest" name="hasBougie" time="0.0010" />
<testcase classname="net.cars.engine.MoteurTest" name="hasCarburatueur" time="0.0010" />
<!-- more testcase tags-->
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
经过一点研究后,我发现该格式是由apache基金会(由ant项目)提出的。
制作者:
- junit ant task
- antunit
- maven Surefire
- testng
- ...
消耗者:
- junitreport ant task
- maven Surefire-reports
- CruiseControl
- Luntbuild
- Bamboo
- Hudson/Jenkins
- IntelliJ TeamCity
- AntHill
- Parabuild
- JUnit PDF Report
- ...
我能找到的唯一文档是这个页面蚂蚁维基: Proposals/EnhancedTestReports
这种格式(DTD、XSD)有任何规范吗?
我想手工编写一个这样的文件...(或者如果您知道的话,可以使用库)...
A lot of tools produces and consumes the same XML File format for Unit Test report.
Example (source):
<?xml version="1.0" encoding="UTF-8" ?>
<testsuite errors="0" failures="0" hostname="hazelnut.osuosl.org" name="net.cars.engine.MoteurTest" tests="6" time="0.021" timestamp="2007-11-02T23:13:50">
<properties>
<property name="java.vendor" value="IBM Corporation" />
<property name="os.name" value="Linux" />
<!-- more property tags-->
</properties>
<testcase classname="net.cars.engine.MoteurTest" name="hasBougie" time="0.0010" />
<testcase classname="net.cars.engine.MoteurTest" name="hasCarburatueur" time="0.0010" />
<!-- more testcase tags-->
<system-out><![CDATA[]]></system-out>
<system-err><![CDATA[]]></system-err>
</testsuite>
After a little bit research, I have found that the format was proposed by the apache foundation (by the ant project).
Produced by:
- junit ant task
- antunit
- maven surefire
- testng
- ...
Consumed by:
- junitreport ant task
- maven surefire-reports
- CruiseControl
- Luntbuild
- Bamboo
- Hudson/Jenkins
- IntelliJ TeamCity
- AntHill
- Parabuild
- JUnit PDF Report
- ...
The only document I could find is this page on the ant wiki:
Proposals/EnhancedTestReports
Is there any specification of this format (DTD, XSD) ?
I want to write a such file from hand... (or maybe use a librairy if you know any)...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
此页面 http://windyroad.org/2011/02/ 07/apache-ant-junit-xml-schema/ 建议 JUnit 测试报告的 XML 模式位于此处http://windyroad.org/dl/Open%20Source/JUnit.xsd
结构该模式的似乎与您给出的示例相匹配。
This page http://windyroad.org/2011/02/07/apache-ant-junit-xml-schema/ suggests that the XML Schema for JUnit test reports is here http://windyroad.org/dl/Open%20Source/JUnit.xsd
The structure of that schema seems to match the example you have given.
架构可以在 maven Surefire 文档 或在 源存储库
Schema can be found in maven surefire documentation or in the source repository