You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Vincent Massol <vm...@pivolis.com> on 2005/10/31 18:55:34 UTC

[m2] Functional test use cases

Hi everyone (and especially Kenney to whom I had promised this email),

Here are some functional use cases I want to write for the Cargo m2 plugin.
I'm currently using the m2 embedder in junit tests to do this. Kenney wanted
to check what were the use cases so that we could disucss how the
maven-it-plugin could support them.

Use case #1 
===========

* The project to test deploys to a container that is started externally. It
calls the cargo:deploy goal. 
* Need: The container need to be started prior to the test.
* The way I do it now: In my junit test I use the cargo API to start the
container in a few lines of code.
* Q: How would I do this with the it plugin?

Use case #2
===========

* I need that the functional test projects be run on several containers.
* The list of containers that they should be run on is defined by the user
with a default list provided in a default profile.
* The same test project should be executed several times, each time using a
different container taken from the list
* The way I would do it with the embedder (not done yet): execute the test
project install goal as many times as there are container in the list. Every
time run the test project with a profile corresponding to the selected
container.
* Q: How would I do this with the it plugin?

Use case #3
===========

* I have a test project that starts a container, deploys a WAR to it and
then stop it
* I need to verify that WAR has been correctly deployed. One way of doing
this is to poll a URL. This needs to happen before the container is stopped.
* The way I imagined doing it with the embedder is by adding the URL
verification before the container is stopped. I'm not sure yet how I could
intercept this but I'm pretty sure I can insert a verification step in the
execution.
* Q: How would I do this with the it plugin?
* Note: It would be a good idea to add a URL availability check to the
verifier plugin.

Important Note
==============

* In each case I'd like the test project to be exactly as the user would
write it. So anything that is related to testing should be located in the
logic driving the test and not in the test project itself which should as
"clean" as possible and could be used as a sample.

Thanks
-Vincent


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


RE: [m2] Functional test use cases

Posted by Vincent Massol <vm...@pivolis.com>.
Use case #4
===========

* There's one test project which keeps the container started and wait
indefinitely until the container is stopped.
* The way I'm planning to implement this using the embedder is by starting
the embedder in one thread (which will block) and then closing the container
in another thread so that the test exits.
* Q: How would I do this with the it plugin?

Note: Froget use case #3. It can be achieved with the it plugin and anyway
the to do it is to move the verification to the test project itself...

Thanks
-Vincent

> -----Original Message-----
> From: Vincent Massol [mailto:vmassol@pivolis.com]
> Sent: lundi 31 octobre 2005 18:56
> To: 'Maven Developers List'
> Subject: [m2] Functional test use cases
> 
> Hi everyone (and especially Kenney to whom I had promised this email),
> 
> Here are some functional use cases I want to write for the Cargo m2
> plugin.
> I'm currently using the m2 embedder in junit tests to do this. Kenney
> wanted
> to check what were the use cases so that we could disucss how the
> maven-it-plugin could support them.
> 
> Use case #1
> ===========
> 
> * The project to test deploys to a container that is started externally.
> It
> calls the cargo:deploy goal.
> * Need: The container need to be started prior to the test.
> * The way I do it now: In my junit test I use the cargo API to start the
> container in a few lines of code.
> * Q: How would I do this with the it plugin?
> 
> Use case #2
> ===========
> 
> * I need that the functional test projects be run on several containers.
> * The list of containers that they should be run on is defined by the user
> with a default list provided in a default profile.
> * The same test project should be executed several times, each time using
> a
> different container taken from the list
> * The way I would do it with the embedder (not done yet): execute the test
> project install goal as many times as there are container in the list.
> Every
> time run the test project with a profile corresponding to the selected
> container.
> * Q: How would I do this with the it plugin?
> 
> Use case #3
> ===========
> 
> * I have a test project that starts a container, deploys a WAR to it and
> then stop it
> * I need to verify that WAR has been correctly deployed. One way of doing
> this is to poll a URL. This needs to happen before the container is
> stopped.
> * The way I imagined doing it with the embedder is by adding the URL
> verification before the container is stopped. I'm not sure yet how I could
> intercept this but I'm pretty sure I can insert a verification step in the
> execution.
> * Q: How would I do this with the it plugin?
> * Note: It would be a good idea to add a URL availability check to the
> verifier plugin.
> 
> Important Note
> ==============
> 
> * In each case I'd like the test project to be exactly as the user would
> write it. So anything that is related to testing should be located in the
> logic driving the test and not in the test project itself which should as
> "clean" as possible and could be used as a sample.
> 
> Thanks
> -Vincent
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org



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