You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Deluigi Marcus <ma...@elca.ch> on 2006/11/15 10:11:48 UTC

Move tests to 'integration-test'

Hi.

I have a module on which I want to execute all Junit tests in the
integraton-test phase.
I want to do this because I need to first start Tomcat before the test
and stop it after the test.
Thererefore, I put the start into the pre-integration-test phase and the
stop into the post-integration-test-phase. Finally, I configured the
surefire plugin to the phase 'integration-test' inside the <build />
tag.

The module itself works fine, but when I launch the life cycle from the
parent module, all tests get executed in the test phase.

Can anybody give me a hint how to solve this problem?

Greetings
Marcus

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


Re: Move tests to 'integration-test'

Posted by diroussel <na...@diroussel.xsmail.com>.
I've not managed to get integration tests working myself, but....

Where have you put your tests?  I've noticed the surefire pluin itself has
it's tests in src/it/testX.

Do:
svn checkout
https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-surefire-plugin
maven-surefire-plugin

and have a look for yourself.

David


Deluigi Marcus wrote:
> 
> Hi.
> 
> I have a module on which I want to execute all Junit tests in the
> integraton-test phase.
> I want to do this because I need to first start Tomcat before the test
> and stop it after the test.
> Thererefore, I put the start into the pre-integration-test phase and the
> stop into the post-integration-test-phase. Finally, I configured the
> surefire plugin to the phase 'integration-test' inside the <build />
> tag.
> 
> The module itself works fine, but when I launch the life cycle from the
> parent module, all tests get executed in the test phase.
> 
> Can anybody give me a hint how to solve this problem?
> 
> Greetings
> Marcus
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/Move-tests-to-%27integration-test%27-tf2634842s177.html#a7356275
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: Move tests to 'integration-test'

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/15/06, Wendy Smoak <ws...@gmail.com> wrote:

> Since you already have a separate module for the integration tests,
> the easiest solution is to move your tests out of src/test/java.
> Surefire will still run in the 'test' phase, but it won't find
> anything to compile and run.

Sorry, that's not completely correct.  I can't tell from your original
message if you're also building a war file from the same module as
your integration tests, or if they are completely separate (which is
the recommended setup).  Can you clarify?

The notes here should be more correct than my pre-caffeine musings:
http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing

-- 
Wendy

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


Re: Move tests to 'integration-test'

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/15/06, Deluigi Marcus <ma...@elca.ch> wrote:

> The module itself works fine, but when I launch the life cycle from the
> parent module, all tests get executed in the test phase.
>
> Can anybody give me a hint how to solve this problem?

As you've discovered Maven does not yet support integration testing
'out of the box' -- the lifecycle phases are there, but nothing is
bound to them.

Since you already have a separate module for the integration tests,
the easiest solution is to move your tests out of src/test/java.
Surefire will still run in the 'test' phase, but it won't find
anything to compile and run.

As far as I can tell, the convention is src/it/java for integration
tests, but it may still be under discussion. (The src/it/textX that
David points out is probably plugin integration tests, which are a
little different.)  Then in the <plugin> configuration, set
<testSourceDirectory> to the new location.

http://maven.apache.org/plugins/maven-surefire-plugin/test-mojo.html

There are some brief notes on the current state of integration testing
with Maven, here:
http://docs.codehaus.org/display/MAVENUSER/Maven+and+Integration+Testing

HTH,
-- 
Wendy

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