Re: Separate unit test / functional test directories?
> given that the philosophy of Maven is convention over configuration, that > there is > no standard way of doing this, such as separate test and integrationTest > directories. Uhhh there is a standard way of doing this [1]: Inclusions By default, the Failsafe Plugin will automatically include all test classes with the following wildcard patterns: "**/IT*.java" - includes all of its subdirectories and all java filenames that start with "IT". "**/*IT.java" - includes all of its subdirectories and all java filenames that end with "IT". "**/*ITCase.java" - includes all of its subdirectories and all java filenames that end with "ITCase". If the test classes does not go with the naming convention, then configure Failsafe Plugin and specify the tests you want to include. [1] http://maven.apache.org/plugins/maven-failsafe-plugin/examples/inclusion-exclusion.html Wayne - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Separate unit test / functional test directories?
Thanks David, that seems like a reasonable approach. I'm a bit surprised, though, given that the philosophy of Maven is convention over configuration, that there is no standard way of doing this, such as separate test and integrationTest directories. On Apr 4, 2012, at 5:15 PM, David Karr That wrote: > On Wed, Apr 4, 2012 at 2:06 PM, Russell Gold wrote: > >> I see that the maven lifecycle includes separate phases for unit tests and >> functional tests, but I don't see how to take advantage of that. The >> failsafe plugin, as far as I can tell, uses the exact same directories as >> the surefire one. Is there a standard maven way to define a set of unit >> tests and also a separate set of functional tests? If not, what good does >> having separate phases do? > > > It seems to me that this is one place where you have to add some > configuration. Using the convention by itself won't work. One strategy I > use is to name all of my unit test classes "*Test" and all my integration > test classes "*IntTest". I then exclude "*IntTest" from surefire and > include "*IntTest" in failsafe. I suppose another approach would be to > name your integration tests "*TestInt", and that would allow you to only > specify configuration in failsafe, as surefire would be fine. - To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org
Re: Separate unit test / functional test directories?
On Wed, Apr 4, 2012 at 2:06 PM, Russell Gold wrote: > I see that the maven lifecycle includes separate phases for unit tests and > functional tests, but I don't see how to take advantage of that. The > failsafe plugin, as far as I can tell, uses the exact same directories as > the surefire one. Is there a standard maven way to define a set of unit > tests and also a separate set of functional tests? If not, what good does > having separate phases do? It seems to me that this is one place where you have to add some configuration. Using the convention by itself won't work. One strategy I use is to name all of my unit test classes "*Test" and all my integration test classes "*IntTest". I then exclude "*IntTest" from surefire and include "*IntTest" in failsafe. I suppose another approach would be to name your integration tests "*TestInt", and that would allow you to only specify configuration in failsafe, as surefire would be fine.
Separate unit test / functional test directories?
I see that the maven lifecycle includes separate phases for unit tests and functional tests, but I don't see how to take advantage of that. The failsafe plugin, as far as I can tell, uses the exact same directories as the surefire one. Is there a standard maven way to define a set of unit tests and also a separate set of functional tests? If not, what good does having separate phases do?