Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>There is this <a href="http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing" rel="nofollow noreferrer">codehaus page</a> with some guidelines. I found the failsafe plugin a bit of a hack, and it makes running the unit tests in Eclipse fiendishly complicated. I do broadly what you're describing.</p> <p>Define integration tests in src/itest/java In the pre-integration-test phase:</p> <ul> <li>Clear target/test-classes</li> <li>Use the <a href="http://mojo.codehaus.org/build-helper-maven-plugin/" rel="nofollow noreferrer">build-helper-maven-plugin</a>'s add-test-source goal to add the itest source location</li> <li>Use a custom Mojo to remove src/test/java from the configuration so the unit tests are not compiled again (I don't really like this, but it's needed to maintain the separation of unit and integration tests).</li> <li>Use the compiler-plugin to compile the integration tests</li> </ul> <p>Then in the integration-test phase, use the surefire-plugin to run the tests.</p> <p>Finally, bind any tidy up goals to the post-integration-test phase (though normally they're not needed as you can use the test teardown() to tidy up).</p> <p>I've not yet found a way to merge the test results as the reporting phase has passed, but I tend to view the integration tests as an added bonus, so as long as they pass the report is not so important.</p> <p>Update: I think it's worth pointing out that you can run Jetty from within your integration tests rather than using a jetty goal. This gives you much finer control over the tests. You can get more details from <a href="https://stackoverflow.com/questions/1186348/maven-ear-module-and-ejb-dependencies-tests/1186531#1186531">this answer</a> and the referenced blogs.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload