如何将Cucumber-jvm与Maven构建集成 [英] How to integrate cucumber-jvm with maven build

查看:99
本文介绍了如何将Cucumber-jvm与Maven构建集成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在我的eclipse插件项目中添加一些bdd,但无法弄清楚在maven构建过程中如何运行集成测试.为了编写测试,我使用的是SWTBot框架.

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.

我已经进行了特征生成,并设置了测试.如何设置pom以运行集成测试?

I already did the feature generation fase, and setup my tests. How do i setup my pom to run my integration tests?

推荐答案

我使用以下配置并运行mvn clean verify.如果您不想并行运行测试,请删除parallelperCoreThreadCountthreadCountClasses标记. 确保更新正则表达式以匹配您的测试命名约定<include>**/Run*.java</include>

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>

这篇关于如何将Cucumber-jvm与Maven构建集成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆