Wendy Smoak wrote:
On 9/6/06, Laurie Harper <[EMAIL PROTECTED]> wrote:
Everything seems to be working except that I can't figure out how to get
the compiler plugin to compile the right set of sources and put the
resulting classes where I want them, so integration tests remain
separate from unit tests.
...
Is there a way to achieve this, short of reorganizing the source tree
and/or breaking the project up into modules?
Maven does not have good support for combining both unit tests and
integration tests in the same module.
It used to hint at having first-class support, with an
integrationTestSource element in the POM etc. -- and even today, there
is an 'integration-test' build phase -- but yeah, I know this isn't
something that's directly supported. Hence the attempt to squish it into
my build ;-)
You can do it by playing around with includes/excludes, but you're
only allowed one testSourceDirectory per module. (And probably one
target directory, though I haven't tried to change that.)
For the compiler plugin, one testSourceDirectoy and one test class
target directory, yeah, as far as I can tell. It's odd, therefore, that
the surefire and surefire-report plugins are quite happy to look in a
different directory for test classes -- since there's no apparent way to
get them there...
Here's a recent thread that links to some examples:
http://www.nabble.com/Multipart-question-regarding-releasing-with-an-assembly-and-integration-tests.-t2193916.html#a6072535
Heh, Cargo is my next level; my integration tests don't require the
webapp deployed and running, but my acceptance tests do ;-)
At least until Maven supports separate src/it/java and src/test/java
directories, putting your integration tests in a separate module is
the best way to go. This is described in the 'Better Builds with
Maven' book.
Yeah, with a green-field project I do things the 'maven way'. It's all
those projects that pre-date Maven that cause the trouble :-(
That said, we do combine unit and integration tests in the Shale
example apps, and it works well enough.
Ah, good to know, I'll check out how that works; maybe it'll represent
an acceptable compromise for this project.
L.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]