我将maven-surefire-plugin
用于运行单元测试,并将maven-failsafe-plugin
用于运行集成测试。当我运行mvn clean test
时,它同时运行,首先执行单元测试,然后执行集成测试。这是我的maven插件配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<forkCount>2</forkCount>
<excludes>**/*ITest.java</excludes>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.22.1</version>
<configuration>
<forkCount>0</forkCount>
<includes>**/*ITest.java</includes>
</configuration>
</plugin>
执行单元测试时,它将测试结果记录在中间的某处,如下所示:
[INFO]
[INFO] Results:
[INFO]
[WARNING] Tests run: 280, Failures: 0, Errors: 0, Skipped: 1
并继续进行集成测试,并在最后一次记录集成测试的结果。
问题是,我想最终获得单元测试和集成测试的汇总结果吗?怎么可能?