I made some unit-tests using fest, now I need to run mvn my test using maven on a headless system. I would like to run test using Xvfb but I need help to configure maven to start Xvfb before testing and stop it when all is done.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Actually I use this plugin configuration:
The good is that you get a background process (with
spawn = "true") and you can kill the Xvfb process (withkillall) without having to write any script. Moreover in my Ubuntu distro I don’t hav to set any special setting in my sudoers file to let this works.The shutdown-xvfb execution is executed at the end of the test phase but (here is the problem) is not executed if the test fail. This is not a problem if you want to restart another test (the old Xvfb is still running and the new one can’t run, but this is not a problem) but the problem is that the resources are still busy by Xvfb. A workaround for this could be to add
testFailureIgnore = "true"to the configuration of maven-surefire-plugin but this way I can’t easily see if some test fail.