Hi Robert,

On 10/6/14 11:31 AM, Robert Mark Bram wrote:
Hi All,

A couple of questions about integration tests..


1) Default vs non-default plugins
I needed to include the maven-failsafe-plugin plugin to introduce
integration tests into my project, but I didn't need to introduce the
maven-surefire-plugin to my pom.xml for unit tests. Fair enough, but
how do I know which plugins are included by default?

This can be read here:

http://maven.apache.org/ref/3.1.1/maven-core/default-bindings.html

There you can see for which packaging type which plugins are bound to the particular life cycle phases...



2) Just run integration tests?
I can see that unit tests are all classes with names like *Test.java
and integration tests are all classes with names like IT.java. But mvn
verify and mvn test seem to run all tests (unit and integrations). Is
there a way to run just one or the other?

mvn test

should not run integration tests...if it will so you have configured it wrong and not used maven-failsafe-plugin and bound to the wrong life cycle...cause the phases: pre-integration-test, integration-test and post-integration-test ran after package phase...
So they will only be reached if you do

mvn verify


If you like to run only integration tests you can do this via configuring maven-surefire-plugin with a parameter skip...

mvn -Dskip.unit.tests=true verify

which will skip the unit tests but run the integration tests...




3) Run integration tests after compile?
The real reason for question 2 is that I wish to run integration tests
only after I have deployed the new application to ensure the
integration tests run on the server with the new content. Is there a
way to do this?

Based on the life cylce this is guaranteed...



Thanks for any assistance!

You're welcome...

Kind regards
Karl-Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to