我已经用Jbehave写了测试用例,我用Junit运行它,现在我需要把它转换成Maven目标。
该怎么做呢?
我应该向pom.xml添加哪些行才能使其正常工作?
编辑:
如何将其作为Maven目标运行?我应该使用什么命令?
我有一个测试,如果我在Eclipse中用Junit单独运行它,它就能正确运行……然后我
在pom.xml中添加了以下行
<plugin>
<groupId>org.jbehave</groupId>
<artifactId>jbehave-maven-plugin</artifactId>
<executions>
<execution>
<id>run-scenarios</id>
<phase>integration-test</phase>
<configuration>
<scenarioIncludes>
<scenarioInclude>**/*Story.java</scenarioInclude>
</scenarioIncludes>
<ignoreFailureInStories>true</ignoreFailureInStories>
<ignoreFailureInView>false</ignoreFailureInView>
<outputDirectory> ${project.build.directory}/jbehave/view</outputDirectory>
</configuration>
<goals>
<goal>run-scenarios</goal>
</goals>
</execution>
</executions>
</plugin>并尝试通过右键单击pom.xml来作为"Maven package“运行Pom.xml ...但是它没有显示任何东西,甚至没有任何错误/失败。准确地说,没有迹象表明我在pom.xml中引用了测试...
我错过了什么?
如何知道测试是否运行?
发布于 2012-11-27 23:04:16
如果它只是一个插件,你可以直接使用Maven,因为maven-surefire- JUnit将运行单元测试。但是docs about JBehave使用jbehave maven-plugin展示了示例。
https://stackoverflow.com/questions/13579419
复制相似问题