如何在Maven Surefire中生成时间戳生成report.xml?

时间:2015-03-11 16:03:53

标签: java unit-testing maven junit maven-surefire-plugin

有没有办法指示Maven Surefire在报告xml文件中保存每个JUnit测试用例的测试开始时间?

我希望报告看起来应该像这样:

<?xml version="1.0" encoding="UTF-8"?>
<testsuite name="com.chris.testcases.Timestamp" time="1,962.965" tests="1" errors="0" skipped="0" failures="0">
    <properties>
        <property ...>
    </properties>

    <testcase
      name="Timestampfilter"
      classname="com.chris.testcases.Timestamp"
      time="1,339.383"  <-- this is the already existing execution time
-->   timestamp="2015-03-11 16:44:05" /> <-- this is the NEW attribute I need
    ...
</testsuite>

背景:我需要这个参数来进行此xml的后续处理,只需在“普通”日志文件/输出中写入时间戳就没有解决方案。

我正在使用:Maven 3.2.5与Surefire-Plugin 2.18.1。

更新:我在此处发现了类似的问题:https://jira.codehaus.org/browse/SUREFIRE-681

0 个答案:

没有答案