You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by mfs <fa...@gmail.com> on 2007/11/13 01:49:16 UTC

Integration tests - Where to place them ?

Guys,

Can "java/src/test" be used to package both unit and integration tests ?  Or
this structure specifically for the unit test-cases.. ?

Like for example in my case we have an html file used for some
functional/integration testing, would it be a good idea to put it in the
java/src/test folder ?

Thanks in advance and Regards,

Farhan.
-- 
View this message in context: http://www.nabble.com/Integration-tests---Where-to-place-them---tf4795047s177.html#a13717744
Sent from the Maven - Users mailing list archive at Nabble.com.


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


Re: Integration tests - Where to place them ?

Posted by Kalle Korhonen <ka...@gmail.com>.
On 11/12/07, mfs <fa...@gmail.com> wrote:
>
> Can "java/src/test" be used to package both unit and integration tests
> ?  Or
> this structure specifically for the unit test-cases.. ?


Yes, it can be used for both. Typically you'd name your pure unit tests as
something like *UnitTest.Java and integration tests as *IntegrationTest.java,
then bind surefire-plugin another time to a different phase and supply a
different configuration (say start a container first) for running the
integration tests.

Like for example in my case we have an html file used for some
> functional/integration testing, would it be a good idea to put it in the
> java/src/test folder ?
>
>
It depends on what your integration tests are like. If they are fairly
simple and meant to be run pretty much all the time, I'd just put them in.
If they are more comprehensive, need specific configuration/environment
and/or are run only conditionally because they for example take a long time
to run, you may want to consider separating into their own "test" module -
the advantage is that it can have it's (release) lifecycle, run separately
etc, as in a form of TCK (Test Compatibility Kit).

Kalle

Re: Integration tests - Where to place them ?

Posted by Wendy Smoak <ws...@gmail.com>.
On Nov 12, 2007 5:49 PM, mfs <fa...@gmail.com> wrote:

> Can "java/src/test" be used to package both unit and integration tests ?  Or
> this structure specifically for the unit test-cases.. ?

Yes, but -- in a separate module.

Maven does not currently support normal unit tests and integration
tests in the same module.  If you must combine them, you'll have to do
some includes/excludes to get things to happen at the right time.

See this page for a bit more info:
http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing

> Like for example in my case we have an html file used for some
> functional/integration testing, would it be a good idea to put it in the
> java/src/test folder ?

Non-java files generally go in src/test/resources.

-- 
Wendy

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