我在聚甲醛与TestNG的万无一失定义如下配置:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.12</version>
<configuration>
<skipTests>${skip-all-tests}</skipTests>
</configuration>
<executions>
<execution>
<id>unit-tests</id>
<phase>test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>${skip-unit-tests}</skip>
<groups>unit</groups>
<excludedGroups>integration</excludedGroups>
</configuration>
</execution>
<execution>
<id>integration-tests</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<skip>${skip-integration-tests}</skip>
<groups>integration</groups>
<excludedGroups>unit</excludedGroups>
</configuration>
</execution>
</executions>
</plugin>
但似乎两次执行总是被“默认测试”来看,这似乎运行每@Test注解的方法之前(至少我是这么认为的)。
--- maven-surefire-plugin:2.12:test (default-test) @ my-project
例如其上运行的项目“MVN测试”,两个测试执行发生。 “默认测试”和“单元测试”。
可能有人解释这多一点给我吗? 这可以被禁用或控制(配置什么是测试并没有什么)?