【发布时间】:2012-03-09 11:49:06
【问题描述】:
我读到Maven Failsafe plugin 是专门为运行集成测试而设计的。目前我正在开发一个多模块项目,集成测试在它自己的单独模块中,用 TestNg 编写并使用Surefire plugin 运行。我们与单元测试没有冲突,因为在该模块的测试阶段只运行集成测试。并且为了在测试之前设置环境,在测试运行之后清理它,使用@BeforeSuite @AfterSuiteTestNg 注释。所以Failsafe插件使用的pre-integration-test阶段,integration-test阶段,post-integration-test阶段就没有必要了。
- 如果不使用 Failsafe 插件,我还错过了什么好处吗?
- 有没有更好的方法来使用 Failsafe 插件来满足我当前的需求?
- 我可以在
pre-integration-test、post-integration-test阶段进行服务器启动、关闭、文件解压缩等操作,而无需编写 maven 插件吗?
【问题讨论】:
标签: maven integration-testing testng maven-surefire-plugin maven-failsafe-plugin