在ear构建之后运行测试

bpsygsoo  于 2021-06-30  发布在  Java
关注(0)|答案(2)|浏览(353)

我有多模块项目。它适合耳朵。我把阿奎尔图书馆加进去了。每个子模块都有自己的测试,但要工作它必须编译其他模块。我想在ear构建之后运行所有测试,然后使用这个ear进行部署和测试。在单个maven构建生命周期中有没有可能做到这一点?

ukdjmx9f

ukdjmx9f1#

构建ear之后要运行的测试应该在构建ear的同一个项目(模块)中实现 ear .
当ear部署到容器中时执行的测试称为“集成测试”,并在第二阶段执行 integration-test . 您可以使用特殊模式(例如。 BlaBlaIntegrationTest )并在中执行适当的配置 pom.xml 在“集成测试”阶段只运行这些测试,并在运行常规单元测试时忽略它们。

zpqajqem

zpqajqem2#

标准生命周期阶段包括:

validate - validate the project is correct and all necessary information is available
compile - compile the source code of the project
test - test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed
package - take the compiled code and package it in its distributable format, such as a JAR.
integration-test - process and deploy the package if necessary into an environment where integration tests can be run
verify - run any checks to verify the package is valid and meets quality criteria
install - install the package into the local repository, for use as a dependency in other projects locally
deploy - done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

我建议您在集成测试阶段打包arquillian测试。arquillian应该在testsmachine上自己部署微部署,如果配置正确的话。

相关问题