tag:blogger.com,1999:blog-6189016616585694043.post440026712526735113..comments2024-03-02T05:35:51.340+01:00Comments on Java Moods: Unit and Integration Testing with Maven, Part 2::Christophhttp://www.blogger.com/profile/13039853176384586281noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-6189016616585694043.post-83558308597102924292016-12-12T12:28:53.083+01:002016-12-12T12:28:53.083+01:00Thanks. Saved a lot of times. We have opted for &q...Thanks. Saved a lot of times. We have opted for "Option 1" + failsafe. The only drawback is that, with the "pom" packaging the 'src/test/resources' is not copied.<br />You should also force the "maven-resources-plugin" like "maven-compiler-plugin"gervaisbhttps://www.blogger.com/profile/05537561912342569290noreply@blogger.comtag:blogger.com,1999:blog-6189016616585694043.post-52946928184381611152010-10-14T04:07:45.675+02:002010-10-14T04:07:45.675+02:00Great article - thanks. I've found that when u...Great article - thanks. I've found that when using Failsafe, all that you need to do is include its plugin declaration in your POM and you don't have to do a thing with Surefire... very cool. Maven really should come bundled with Failsafe IMHO. Here's the POM declaration for the current 2.6 version:<br /><br /> <plugin><br /> <groupId>org.apache.maven.plugins</groupId><br /> <artifactId>maven-failsafe-plugin</artifactId><br /> <version>2.6</version><br /> <executions><br /> <execution><br /> <id>integration-test</id><br /> <goals><br /> <goal>integration-test</goal><br /> </goals><br /> </execution><br /> <execution><br /> <id>verify</id><br /> <goals><br /> <goal>verify</goal><br /> </goals><br /> </execution><br /> </executions><br /> </plugin>Christopherhttps://www.blogger.com/profile/06860404627954267472noreply@blogger.comtag:blogger.com,1999:blog-6189016616585694043.post-50020761195301683422010-02-18T15:41:19.300+01:002010-02-18T15:41:19.300+01:00Oh, right, there is a new version of failsafe plug...Oh, right, there is a new version of failsafe plugin available with changed group-id, which indeed supports the skipITs flag. Thanks for pointing this out!::Christophhttps://www.blogger.com/profile/13039853176384586281noreply@blogger.comtag:blogger.com,1999:blog-6189016616585694043.post-4827796246500727022010-02-17T17:03:03.958+01:002010-02-17T17:03:03.958+01:00Apparently my links got swallowed -- I don't s...Apparently my links got swallowed -- I don't see them in the resultant posting. I will try to post the links again here.<br /><br />New failsafe plugin page:<br /><br />http://maven.apache.org/plugins/maven-failsafe-plugin/<br /><br />About skipping tests:<br /><br />http://maven.apache.org/plugins/maven-failsafe-plugin/examples/skipping-test.htmlUnknownhttps://www.blogger.com/profile/11040616300292401919noreply@blogger.comtag:blogger.com,1999:blog-6189016616585694043.post-46331519734280424952010-02-17T16:59:51.779+01:002010-02-17T16:59:51.779+01:00If you specify -DskipTests it applies to *both* un...If you specify -DskipTests it applies to *both* unit and integration tests. Note that it is NOT the case that failsafe applies to unit testing. Rather it is the case that *both* surefire (new 2.5 version) and failsafe will skip their respective tests when this property is specified.<br /><br />You have to be sure to use the updated version of the failsafe plugin. Confusingly, the older version still has a page on the Maven sites.<br /><br />Here is the web page for the new version of failsafe plugin. Note that the Maven coordinates are different also (new artifactId is = 'maven-failsafe-plugin').<br /><br /><br /><br />Skipping integration tests is covered here:Unknownhttps://www.blogger.com/profile/11040616300292401919noreply@blogger.comtag:blogger.com,1999:blog-6189016616585694043.post-29434781136333828682010-02-17T09:14:39.747+01:002010-02-17T09:14:39.747+01:00Hi stug23, you are sure there is a property "...Hi stug23, you are sure there is a property "skipITs" that is evaluated by failsafe plugin? <br /><br />Well, I couldn't find anything like this in plugin documentation, nor when executing "failsafe:help -Ddetail=true" on the command line. So, where is this property and behavior documented?<br /><br />Additionally, I don't think failsafe plugin is really meant to execute unit tests. It's saying "failsafe-maven-plugin is designed for running integration tests, and decouples failing the build if there are test failures from actually running the tests" in the docs. This kind of decoupling is exactly what you want to have for IT, but not unit tests, right?::Christophhttps://www.blogger.com/profile/13039853176384586281noreply@blogger.comtag:blogger.com,1999:blog-6189016616585694043.post-12056728065637875712010-02-17T08:46:04.643+01:002010-02-17T08:46:04.643+01:00Of course with the failsafe plugin you can skip th...Of course with the failsafe plugin you can skip the ITs and just run unit tests using -DskipITs. So this is a handy way to go when both unit and integration tests are in the same module.Unknownhttps://www.blogger.com/profile/11040616300292401919noreply@blogger.com