【发布时间】:2017-09-28 07:36:28
【问题描述】:
JUnit 测试的测试结果有一个properties 标签,里面有一堆属性。记录的内容似乎由每个测试执行者自行决定。
我想进一步处理 XML 文件,所以每次都使用相同的键非常好。对于maven-surefire-plugin,这很简单:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<systemPropertyVariables>
<propertyName>propertyValue1</propertyName>
</systemPropertyVariables>
</configuration>
</plugin>
这会将行 <property name="propertyName" value="propertyValue1"/> 添加到 XML 结果文件中。
对于tycho-surefire-plugin,我尝试了以下方法:
<plugin>
<groupId>org.eclipse.tycho</groupId>
<artifactId>tycho-surefire-plugin</artifactId>
<version>${tycho-version}</version>
<configuration>
<systemPropertyVariables>
<propertyName>propertyValue1</propertyName>
</systemPropertyVariables>
<systemProperties>
<property>
<name>propertyName</name>
<value>propertyValue2</value>
</property>
</systemProperties>
<argLine>-DpropertyName=propertyValue3</argLine>
</configuration>
</plugin>
...但是这些值都没有打印在 XML 结果中。
如何使用tycho-surefire-plugin向 JUnit 测试结果添加信息?
【问题讨论】:
标签: tycho tycho-surefire-plugin