I'm currently using the Maven plug-in for Liberty profile to perform integration tests.
I'm using the Maven Failsafe plugin to execute the integration tests.
Integration test involves setting up WLP, deploying an EBA file, and running the tests against the eba.
When running "mvn clean verify" the following happens :
1. clean : cleans the target folder to start with a clean environment
2. pre-integration-test : start-liberty-server : uses the wlp jar from the local repo to install the assembly, configures the wlp with my server.xml and jvm.options and starts it.
3. pre-integration-test : deploy-to-liberty-server : uses the EBA from the maven repository to deploy it to the running server
4. integration-test : executes a jUnit integration test on the deployed EBA
5. post-integration-test : stop-server : stops the server so that the next verify run can start from a clean environment.
This is all working fine, providing nothing went wrong during the pre-integration-test.
The failsafe plugin ensures that cleanup is being done when the integration tests fail, effectively stopping the server after failed tests, allowing us to perform a clean on the next run.
What the failsafe plugin doesn't do is perform cleanup when something goes wrong in the pre-integration test (ex: error during deployment). In that case the post-integration-test is not executed and the server remains up and running, resulting in a failure during the next run (clean cannot be executed as the java process is still running.
Any ideas on how-to fix this ?
Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
This topic has been locked.
Pinned topic Integration testing using the Maven plug-in for Liberty profile
Answered question This question has been answered.
Unanswered question This question has not been answered yet.
Re: Integration testing using the Maven plug-in for Liberty profile2012-11-05T03:38:57ZThis is the accepted answer. This is the accepted answer.Hi,
Have you used this repository http://public.dhe.ibm.com/ibmdl/export/pub/software/websphere/wasdev/maven/repository/ to download maven plugin? And "What the failsafe plugin doesn't do is perform cleanup when something goes wrong in the pre-integration test (ex: error during deployment)" means that if errors happen during deployment, server won't stop, so clean up (delete target folder) failed? Which platform you are running, windows or linux?
Re: Integration testing using the Maven plug-in for Liberty profile2012-11-06T13:30:06ZThis is the accepted answer. This is the accepted answer.
Re: Integration testing using the Maven plug-in for Liberty profile2012-11-07T07:41:26ZThis is the accepted answer. This is the accepted answer.
Re: Integration testing using the Maven plug-in for Liberty profile2012-11-07T09:01:32ZThis is the accepted answer. This is the accepted answer.
- SystemAdmin 110000D4XK
The integration tests would obviously fail but it would still allow for the post-integration-test to continue. The build would still be marked as failed by the failsafe plugin (=expected behavior)