[英]Is possible to run same test multiple times with Maven Surefire Plugin?
如果您想通过实现IInvokedMethodListener beforeInvocation方法来对其进行配置,那么效果如下:
method.getTestMethod().setInvocationCount(Integer.parseInt(System.getProperty("configurablecount")));
可以用System.getProperty替换它,但是要配置它。 您也可以通过传递测试名称来控制哪些测试来设置要更改的调用计数。
是的
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
<executions>
<execution>
<id>phase-1</id>
<phase>test</phase>
<configuration>
<skip>false</skip>
<!-- Phase 1 configuration -->
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
<execution>
<id>phase-2</id>
<phase>test</phase>
<configuration>
<skip>false</skip>
<!-- Phase 2 configuration -->
</configuration>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.