Actually there's another solution that is available right now: Defining the
integration-test process in your tests.

For example, you can create an integration-test project as you have done but
all the different actions are chained inside your test suite:

* create the cactified WAR (this is very easily done by calling the Cactus
<cactifywar> Ant task from Java)
* rebuild the database. Can be done with DBUnit Java API for example
* start/stop the container using the Cargo Java API
* deploy to the container using the Cargo Java API

The tests are then executed using the surefire plugin. The only trick is
that the integration-test module must depend on the WAR/EAR/EJB so that the
latter is built before the tests execute.

This is the solution I would recommend until Maven2 includes support for
integration testing and better user-customization of the lifecycle.

-Vincent

> -----Original Message-----
> From: Vincent Massol [mailto:[EMAIL PROTECTED]
> Sent: dimanche 12 février 2006 10:53
> To: 'Maven Users List'
> Subject: RE: How to bind execution of integration tests to integration-
> test phase
> 
> Hi Pete,
> 
> Yes, you've found the only possible way as of now to perform integration
> testing with Maven 2. As you say yourself, Maven 2 need to offer better
> support for integration testing to make it more streamlined and less
> complex.
> 
> Thanks a lot for your feedback!
> -Vincent
> 
> PS: Would you be interested in helping us implement existing configuration
> support for Orion/OC4J? If so, please join us on the Cargo dev list and we
> can discuss it!
> 
> > -----Original Message-----
> > From: Pete [mailto:[EMAIL PROTECTED]
> > Sent: samedi 11 février 2006 21:41
> > To: Maven Users List
> > Subject: Re: How to bind execution of integration tests to integration-
> > test phase
> >
> > I have achieved integration testing (both JunitEE/Cactus and JUnits
> > calling
> > remote interfaces) in M2 using a very simple lightweight POM for each
> > discrete task/execution in the integration phase e.g.
> >
> > + runtests-integration
> >      pom.xml   (parent pom, invoking child modules in the order below)
> >     + rebuild-database
> >            pom.xml  (antrun)
> >     + start-container
> >            pom.xml  (antrun or cargo)
> >     + runtests-serverside  (runs junits needing server started as they
> > invoke remote interfaces)
> >            pom.xml (surefire:test)
> >     + runtests-incontainer-tests
> >            pom.xml (antrun for running JUnitEE or Cactus incontainer
> > tests)
> >     + stop-container
> >            pom.xml (antrun or cargo)
> >
> > All plugins above bound to the integration-test phase
> >
> > I found this approach also necessary, because you can only have one
> > instance
> > of the antRun plugin for the integration-test phase, therefore you can't
> > use
> > antrun, then surefire, then antrun again  as the last antrun overrides
> the
> > first if they are bound to the same phase.
> >
> > I did want to use Cargo, but unfortunately there was no support for OC4J
> > with an existing configuration.
> >
> > I have the above 'runtests-integration' suite only execute if the M2
> build
> > profile is set to -Pintegrationtests. In this way developers can run a
> > regular M2 build which just runs standalone JUnits, or specify the
> profile
> > to run a fuller build. We have CruiseControl always running the
> > integrations
> > tests profile.
> >
> > With m2.02 I should now convert the Antruns to Ant Plugins.
> >
> > I'm hoping that when M2 supports integration tests more I can migrate to
> > the
> > approved strategy, but this works right now, we have Applications (both
> > EARs) that are built with M2 via CruiseControl, the above integration
> > projects start the container run all the integration tests (with the 2nd
> > EAR
> > application even invoking the 1st EAR's services)
> >
> > I have two other M2 modules in addition to those shown above that
> actually
> > hold the integration tests :-
> >
> > + tests-serverside
> >       pom.xml   (JAR pom, building those JUnits needing server started
> as
> > they invoke remote interfaces)
> > + tests-incontainer
> >      pom.xml  (JAR pom, building those JUnits needing to run inside
> > container JUnitEE or cactus)
> >
> > Pete
> >
> >
> > On 10/01/06, Bengt-Erik Fröberg <[EMAIL PROTECTED]> wrote:
> > >
> > > OK, kinda' weird actually... is it a hard task to extend this surefire
> > > plugin to support different kinds of tests?
> > >
> > > It would be great if you were able to define your own set of
> directories
> > > with tests of different types and to optionally bind each directory to
> a
> > > custom phase.
> > > Maybe a <tests>-tag in the POM?
> > > I saw there is already a discussion on these matters in the link you
> > > submitted. That's great!
> > >
> > > Regards,
> > >
> > > /B-E
> > >
> > >
> > >
> > > -----Ursprungligt meddelande-----
> > > Från: Vincent Massol [mailto:[EMAIL PROTECTED]
> > > Skickat: den 10 januari 2006 16:38
> > > Till: 'Maven Users List'
> > > Ämne: RE: How to bind execution of integration tests to integration-
> test
> > > phase
> > >
> > >
> > >
> > > > -----Original Message-----
> > > > From: Bengt-Erik Fröberg [mailto:[EMAIL PROTECTED]
> > > > Sent: mardi 10 janvier 2006 16:28
> > > > To: 'Maven Users List'
> > > > Subject: SV: How to bind execution of integration tests to
> > integration-
> > > > test phase
> > > >
> > > > Hi and thanks for answering.
> > > >
> > > > I see.... but what does the integration-test phase actually do today
> > > then?
> > >
> > > It's a phase you can bind to. What I'm simply saying is that the
> > surefire
> > > plugin currently only supports running one type of tests at once.
> > >
> > > -Vincent
> > >
> > > > -----Ursprungligt meddelande-----
> > > > Från: Vincent Massol [mailto:[EMAIL PROTECTED]
> > > > Skickat: den 10 januari 2006 16:12
> > > > Till: 'Maven Users List'
> > > > Ämne: RE: How to bind execution of integration tests to integration-
> > test
> > > > phase
> > > >
> > > > Hi,
> > > >
> > > > > -----Original Message-----
> > > > > From: Bengt-Erik Fröberg [mailto:[EMAIL PROTECTED]
> > > > > Sent: mardi 10 janvier 2006 14:34
> > > > > To: 'Maven Users List'
> > > > > Subject: How to bind execution of integration tests to
> > > integration-test
> > > > > phase
> > > > >
> > > > >
> > > > >
> > > > > Hi
> > > > >
> > > > > I have a set of JUnit unit tests which are executed during the
> test
> > > > > lifecycle phase.
> > > > >
> > > > > Now I want to add integration-test classes in another directory to
> > be
> > > > > executed during the integration-test phase.
> > > > > How do I accomplish that?
> > > > >
> > > > > Using  Maven2 and ANT.
> > > >
> > > > Right now you can't run both unit tests and integration tests in the
> > > same
> > > > project. We're discussing this and we'll probably modify the
> surefire
> > > > plugin
> > > > to allow it.
> > > >
> > > > See
> > > >
> > > http://docs.codehaus.org/display/MAVEN/best+practices+-
> > +testing+strategies
> > > >
> > > > Thanks
> > > > -Vincent
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> >
> __________________________________________________________________________
> > > > _
> > > > Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les
> > > > tarifs
> > > > exceptionnels pour appeler la France et l'international.
> > > > Téléchargez sur http://fr.messenger.yahoo.com
> > > >
> > > > --------------------------------------------------------------------
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > > >
> > > >
> > > >
> > > >
> > > > --------------------------------------------------------------------
> -
> > > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> >
> __________________________________________________________________________
> > _
> > > Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les
> > > tarifs
> > > exceptionnels pour appeler la France et l'international.
> > > Téléchargez sur http://fr.messenger.yahoo.com
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: [EMAIL PROTECTED]
> > > For additional commands, e-mail: [EMAIL PROTECTED]
> > >
> > >


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to