我使用JUnit类别,从单元测试分开集成测试。 Surefire插件配置工作 - 它会跳过我的标记接口IntegrationTest注释的测试。
然而,故障安全插件不挑集成测试。 我甚至已经试过指定junit47提供商,但零次测试是在集成测试阶段运行。
下面是pom.xml的片段:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.12</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
</goals>
</execution>
</executions>
<configuration>
<groups>com.mycompany.test.IntegrationTest</groups>
<excludedGroups>com.mycompany.test.UnitTest</excludedGroups>
</configuration>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.12</version>
</dependency>
</dependencies>
</plugin>
这里是日志的故障安全部分:
[INFO] --- maven-failsafe-plugin:2.12:integration-test (default) @ MyProject.war ---
[INFO] Failsafe report directory: /home/stoupa/MyProject/war/target/failsafe-reports
[INFO] Using configured provider org.apache.maven.surefire.junitcore.JUnitCoreProvider
-------------------------------------------------------
T E S T S
-------------------------------------------------------
Concurrency config is parallel='none', perCoreThreadCount=true, threadCount=2, useUnlimitedThreads=false
Results :
Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
是提供程序org.apache.maven.surefire.junitcore.JUnitCoreProvider可以在日志输出正确的可以看到?