You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Piotr Smoliński <pa...@plusnet.pl> on 2005/12/11 23:01:43 UTC
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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
ODP: Re: m2: Lifecycle phase binding (integration-test)
Posted by Piotr Smolinski <pa...@plusnet.pl>.
Thanks, it is a very smart workaround. First
I considered extending phase model and use
additional phases such as integration-test-prepare
and integration-test-dispose.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
ODP: Re: m2: Lifecycle phase binding (integration-test)
Posted by Piotr Smolinski <pa...@plusnet.pl>.
According to Vincent's solution. (Sorry, I haven't
subscribed list before, so I couldn't reply)
I don't think if using setUp()/tearDown() for container control
is good, because:
1) container state is external to application (and test)
2) we lose benefits of using declarative cargo setup
in POM
3) we have to do additional structure (test case) for
container controling for the whole test-suite
BTW
Is it possible to invoke m2 goal from inside the mojo?
I.e. write mojo that performs cargo:start, some tests,
cargo:stop and bind it to integration-test phase.
Piotr Smolinski
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
Re: m2: Lifecycle phase binding (integration-test)
Posted by Pete <pe...@gmail.com>.
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 <vm...@pivolis.com> 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:pasmol@plusnet.pl]
> > Sent: dimanche 11 décembre 2005 23:02
> > To: users@maven.apache.org
> > 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: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>
src/site/xdoc
Posted by Christopher Cobb <ch...@wfinet.com>.
Where can I find information on what I'm supposed to do in the src/site/xdoc
directory?
-----------------------------------------
Attention:
Any views expressed in this message are those of the individual sender,
except where the message states otherwise and the sender is authorized
to state them to be the views of any such entity. The information
contained in this message and or attachments is intended only for the
person or entity to which it is addressed and may contain confidential
and/or privileged material. If you received this in error, please
contact the sender and delete the material from any system and destroy
any copies.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org
RE: m2: Lifecycle phase binding (integration-test)
Posted by Vincent Massol <vm...@pivolis.com>.
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:pasmol@plusnet.pl]
> Sent: dimanche 11 décembre 2005 23:02
> To: users@maven.apache.org
> 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: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org