Java 故障保护报告修改';类名';领域
找不到如何从maven surefire插件修改xml报告的方法。我正在使用JUnit5,maven故障保护插件3.0.0-M5 配置:Java 故障保护报告修改';类名';领域,java,maven,report,maven-failsafe-plugin,Java,Maven,Report,Maven Failsafe Plugin,找不到如何从maven surefire插件修改xml报告的方法。我正在使用JUnit5,maven故障保护插件3.0.0-M5 配置: <plugin> <artifactId>maven-failsafe-plugin</artifactId> <version>3.0.0-M5</version> <executions>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.0.0-M5</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<statelessTestsetReporter implementation="org.apache.maven.plugin.surefire.extensions.junit5.JUnit5Xml30StatelessReporter">
<disable>false</disable>
<usePhrasedFileName>false</usePhrasedFileName>
<usePhrasedTestSuiteClassName>true</usePhrasedTestSuiteClassName>
<usePhrasedTestCaseClassName>true</usePhrasedTestCaseClassName>
<usePhrasedTestCaseMethodName>true</usePhrasedTestCaseMethodName>
</statelessTestsetReporter>
</configuration>
</execution>
</executions>
</plugin>
maven故障保护插件
3.0.0-M5
集成测试
验证
假的
假的
真的
真的
真的
我的实际报告:
<?xml version="1.0" encoding="UTF-8"?>
<testsuite >
<properties>
...
</properties>
<testcase name="This comes from @DisplayName()" classname="com.my.project.ClassName" time="0.945"/>
</testsuite>
...
我希望最后能有这样的东西。字段classname将包含该方法的完整路径
<?xml version="1.0" encoding="UTF-8"?>
<testsuite >
<properties>
...
</properties>
<testcase name="This comes from @DisplayName()" classname="com.my.project.ClassName.testMethodName" time="0.945"/>
</testsuite>
...
可能有人有类似的过期时间为什么要更改该报告?@khmarbaise该报告将用于生成跟踪矩阵,因此我希望有完整的类名+方法名。类名不能是方法名。这就是答案。很抱歉我们不会改变这个。但是你可以改变它,而且那是;这就是为什么我们将API和impl分离到单独的JAR中的原因。因此,请实现您自己的类,满足超级类型。请参阅本节implementation=“org.apache.maven.plugin.surefire.extensions.junit5.junit5xml30statelector”>