问题
i'm trying to put some bdd into my eclipse plugin project, but can't figure out how to run my integration tests during maven build fase. To write my tests i'm using SWTBot framework.
I already did the feature generation fase, and setup my tests. How do i setup my pom to run my integration tests?
回答1:
I use below configuration and run mvn clean verify
. If you don't want to run tests in parallel, remove parallel
, perCoreThreadCount
and threadCountClasses
tags.
Make sure to update the regular expression to match your test naming convention <include>**/Run*.java</include>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.16</version>
<executions>
<execution>
<id>acceptance-test</id>
<phase>integration-test</phase>
<goals>
<goal>test</goal>
</goals>
<configuration>
<outputEncoding>UTF-8</outputEncoding>
<parallel>classes</parallel>
<perCoreThreadCount>true</perCoreThreadCount>
<threadCountClasses>10</threadCountClasses>
<argLine>-Xmx1024m</argLine>
<argLine>-XX:MaxPermSize=256m</argLine>
<includes>
<include>**/Run*.java</include>
</includes>
</configuration>
</execution>
</executions>
</plugin>
来源:https://stackoverflow.com/questions/24252800/how-to-integrate-cucumber-jvm-with-maven-build