许多工具为单元测试报告生成和使用相同的 XML 文件格式。
例子 (source http://junitpdfreport.cvs.sourceforge.net/junitpdfreport/src/resources/examples/testresults/):
<?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 蚂蚁任务
- antunit
- 行家万无一失
- testng
- ...
消耗者:
- JunitReport 蚂蚁任务
- Maven Surefire 报告
- 巡航控制
- 伦特布卢特
- Bamboo
- 哈德森/詹金斯
- IntelliJ TeamCity
- AntHill
- 帕拉建筑
- JUnit PDF 报告
- ...
我能找到的唯一文档是 ant wiki 上的这个页面:提案/增强测试报告 http://wiki.apache.org/ant/Proposals/EnhancedTestReports
这种格式(DTD、XSD)有任何规范吗?
我想用手写一个这样的文件...(或者可能使用一个库,如果你知道的话)...
这一页http://windyroad.org/2011/02/07/apache-ant-junit-xml-schema/ http://windyroad.org/2011/02/07/apache-ant-junit-xml-schema/建议 JUnit 测试报告的 XML 架构位于此处http://windyroad.org/dl/Open%20Source/JUnit.xsd http://windyroad.org/dl/Open%20Source/JUnit.xsd
该模式的结构似乎与您给出的示例相匹配。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)