sorry I missed your second question.
the main difference is when a build failure is triggered.
surefire triggers a build failure immediately after finishing running
all the (unit) tests. this makes it a poor choice if you need to set
up and tear down a (integration) test environment (think jetty:run)
failsafe decouples running the (integration) tests and checking the
test results. this makes it a good choice if you need to set up and
tear down a (integration) test environment
the other diffenence is that surefire looks for tests using the
patterns **/Test*.java, **/*Test.java, **/*TestCase.java
failsafe looks for tests using the patterns **/IT*.java, **/*IT.java,
**/*ITCase.java
so that, by default they will not fight over which tests to run
Sent from my [rhymes with myPod] ;-)
On 26 May 2009, at 19:34, Wim Deblauwe <[email protected]> wrote:
Is there an explanation somewhere on when to use surefire and when
this
failsafe plugin? What are the main differences?
regards,
Wim
2009/5/25 Stephen Connolly <[email protected]>
The Mojo team is pleased to announce the release of the Failsafe
Maven
Plugin, version 2.4.3-alpha-1.
The Failsafe Plugin is a fork of the Maven Surefire Plugin designed
for
running integration tests. It has the following goals.
* failsafe:integration-test (with a default phase of integration-
test)
which by default uses surefire to execute all tests matching the
pattern
**/IT*.java, **/*IT.java and **/*ITCase.java. This goal should not
fail
the
build, thereby allowing the post-integration-test phase to execute
and tidy
up the integration test environment.
* failsafe:verify (with a default phase of verify) which checks the
results of running the integration tests and fails the build if
there were
test failures.
When using the Failsafe Maven Plugin with its default phase
bindings, use
mvn verify
to execute the integration tests.
To use this plugin in your projects, add the following to the
project/build/plugins section of your pom.xml
<project>
[...]
<build>
[...]
<plugins>
[...]
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>failsafe-maven-plugin</artifactId>
<version>2.4.3-alpha-1</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
[...]
</plugins>
[...]
</build>
[...]
</project>
The artifacts have been deployed to the mojo repository and will be
mirrored
to central within the next 24 hours.
The Mojo Team.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]