Hi Piotr,
I have acheived this 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 (junits needing server started as they invoke
remote interfaces)
pom.xml (surefire:test)
+ runtests-incontainer-tests
pom.xml (antrun for 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.
Pete
On 12/12/05, Vincent Massol <[EMAIL PROTECTED]> wrote:
>
> Hi Piotr,
>
> I don't think this is currently possible with Maven 2.0. You could do it
> by
> binding cargo:start and cargo:stop to other phases but that won't be nice
> and clean.
>
> One solution you can use today is simply to put the cargo code in your
> setUp()/tearDown() methods (or in a suite's TestSetup if you want to run
> that code once only).
>
> The principle is described here (but it's using an oldish version of
> cargo):
> http://tinyurl.com/92fh5
>
> Another solution would be for the cargo plugin to add support for this use
> case. So far we've not done it because we think it can be better achieved
> by
> using the Cargo API in your unit test code. WDYT?
>
> Hope it helps,
> -Vincent
>
> > -----Original Message-----
> > From: Piotr Smoliński [mailto:[EMAIL PROTECTED]
> > Sent: dimanche 11 décembre 2005 23:02
> > To: [email protected]
> > Subject: m2: Lifecycle phase binding (integration-test)
> >
> > Hi everybody,
> >
> > Are there any possibilities to provide ordering for executions bound to
> > specified phase?
> > I would like not to do custom packaging, but use existing one. For
> > example I'd like to
> > implement integration-test phase for war (or ear) packaging using goals:
> > * cargo:start
> > * surefire:test
> > * cargo stop
> >
> > TIA
> > Piotr Smolinski
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>