Hi,

On 5/25/15 4:06 PM, hongbin ma wrote:
hi, I'm new to failsafe,

i'm starting to move a test case from unit test to integration test, and
i'm using

So you realized that your "unit test" are in reality integration tests...


<plugin>
     <groupId>org.apache.maven.plugins</groupId>
     <artifactId>maven-failsafe-plugin</artifactId>
     <executions>
         <execution>
             <id>integration-tests</id>
             <phase>integration-test</phase>
             <goals>
                 <goal>integration-test</goal>
                 <goal>verify</goal>
             </goals>
         </execution>
     </executions>

​in my pom.

When I run "mvn verify", I ​found my new integration test ran twice.
I realized that both the "integration-test" and "verify" goal may
contribute to it.
Should I remove the line "<goal>verify</goal>" in pom?
But It seems most failsafe tutorials keeps both goals in their poms.

How have you named your integration tests?

Have you correctly followed the naming schema for integration tests in relationship with maven-failsafe-plugin


WhatEverIT.java

means *IT.java, *ITCase.java, IT*.java

see into the docs:

https://maven.apache.org/surefire/maven-failsafe-plugin/integration-test-mojo.html#includes

I assume you have configured the maven-failsafe-plugin different and so the integration tests will be picked up by maven-surefire-plugin (naming schema!) as well as from the maven-failsafe-plugin...





The question is, what are these two goals for?
The official explanation:

*integration-test for running the integration tests.*
*verify for checking the results of the integration tests.*

It might as already mentioned that your integration tests needed something to setup like an application server or servlet engine to run the integration test...For those cases you have the pre-integration-test phase where you can setup things... After running the integration tests (integration-test-phase) you have to shutdown the app server or the servlet engine within the (post-integration-test) and in the verify phase you have to check if the results were successful or having failed integration tests...



seems so vague to me.
Can any expert give me a concrete example?

thanks!


Kind regards
Karl Heinz Marbaise

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@maven.apache.org
For additional commands, e-mail: users-h...@maven.apache.org

Reply via email to