You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by Julien HENRY <he...@yahoo.fr> on 2006/11/24 16:30:08 UTC

Starting/Stopping Jetty for integration testing

Hi,

I want to execute jetty:run at the pre-integration-test phase and stop it (like Ctrl+C) at the post-integration-test phase.

The problem is jetty:run wait for being killed undefinitly and integration-test phase is never executed.

I don't know exactly how to do this. It may need to develop a new plugin or modify the existing one? Forking a JVM ?

I think I could use an ant run task, but it's not very "Maven compliant".

(http://ptrthomas.wordpress.com/2006/10/10/how-to-start-and-stop-jetty-from-ant/)

Thanks

Julien




	

	
		
___________________________________________________________________________ 
Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
http://fr.answers.yahoo.com

Re: Starting/Stopping Jetty for integration testing

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/24/06, Raphaël Piéroni <ra...@gmail.com> wrote:

> Where could i find information about TestSetup and example in shale,
> i have searched in the shale source repository, but can't find it.

TestSetup is a JUnit thing, so consult JUnit docs and tutorials for
info on that.  Generally, the usual setUp/tearDown methods in a test
case run before and after every test.  Obviously, starting and
stopping the container once for each testXxx method would take
forever.  A TestSetup class allows you to run setUp and tearDown
methods once for an entire suite of tests.

The link in my previous message was straight to CargoTestSetup in the
Apache svn repo, so... try that again.

It was in the 1.0.3 release, so you can add a dependency:
        <dependency>
            <groupId>org.apache.shale</groupId>
            <artifactId>shale-test</artifactId>
            <version>1.0.3</version>
            <scope>test</scope>
        </dependency>

(Shale Test doesn't have any required dependencies on JSF, so you can
use it with any project.  In addition to the CargoTestSetup class,
there's also a convenience HtmlUnit base test class.)

It's used in the shale-usecases example app:
http://svn.apache.org/repos/asf/shale/framework/trunk/shale-apps/shale-usecases/
for example
http://svn.apache.org/repos/asf/shale/framework/trunk/shale-apps/shale-usecases/src/test/java/org/apache/shale/usecases/systest/ViewControllerTestCase.java

The pom config for shale-usecases is somewhat... complex since we keep
the integration tests and the unit tests in the same module, but you
can see how we pass in the System properties that CargoTestSetup
needs.

Please come join us on user@shale if you have more questions...
   http://shale.apache.org/mail-lists.html

-- 
Wendy

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


Re: Starting/Stopping Jetty for integration testing

Posted by Raphaël Piéroni <ra...@gmail.com>.
Hi Wendy,

Where could i find information about TestSetup and example in shale,
i have searched in the shale source repository, but can't find it.

Many thanks in advance for information.


Raphaël

2006/11/24, Wendy Smoak <ws...@gmail.com>:
>
> On 11/24/06, Julien HENRY <he...@yahoo.fr> wrote:
>
> > I want to execute jetty:run at the pre-integration-test phase and stop
> it (like Ctrl+C) at the post-integration-test phase.
>
> In addition to the plugin that has already been mentioned, Cargo also
> has a Java API that can be very useful for integration testing.
>
> Instead of binding plugin executions to lifecycle phases, you can
> start and stop containers from Java code, for example in JUnit
> TestSetup class.
>
> Here's an example:
>
> http://shale.apache.org/shale-test/apidocs/org/apache/shale/test/cargo/CargoTestSetup.html
>
>
> http://svn.apache.org/repos/asf/shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/cargo/CargoTestSetup.java
>
> --
> Wendy
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Starting/Stopping Jetty for integration testing

Posted by Wendy Smoak <ws...@gmail.com>.
On 11/24/06, Julien HENRY <he...@yahoo.fr> wrote:

> I want to execute jetty:run at the pre-integration-test phase and stop it (like Ctrl+C) at the post-integration-test phase.

In addition to the plugin that has already been mentioned, Cargo also
has a Java API that can be very useful for integration testing.

Instead of binding plugin executions to lifecycle phases, you can
start and stop containers from Java code, for example in JUnit
TestSetup class.

Here's an example:
http://shale.apache.org/shale-test/apidocs/org/apache/shale/test/cargo/CargoTestSetup.html

http://svn.apache.org/repos/asf/shale/framework/trunk/shale-test/src/main/java/org/apache/shale/test/cargo/CargoTestSetup.java

-- 
Wendy

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


Re: Starting/Stopping Jetty for integration testing

Posted by Mark Hobson <ma...@gmail.com>.
On 24/11/06, Julien HENRY <he...@yahoo.fr> wrote:
> I want to execute jetty:run at the pre-integration-test phase and stop it (like Ctrl+C) at the post-integration-test phase.
>
> The problem is jetty:run wait for being killed undefinitly and integration-test phase is never executed.
>
> I don't know exactly how to do this. It may need to develop a new plugin or modify the existing one? Forking a JVM ?
>
> I think I could use an ant run task, but it's not very "Maven compliant".

Check Cargo's Maven plugin: http://cargo.codehaus.org/Maven2+plugin

Especially: http://cargo.codehaus.org/Starting+and+stopping+a+container#Startingandstoppingacontainer-lifecycle

Mark

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


Re: Starting/Stopping Jetty for integration testing

Posted by Emmanuel Venisse <em...@venisse.net>.
If you want this feature, you can't use jetty:run, but you need to use the cargo plugin.
jetty:run start only a jetty server like you do it without maven.

Emmanuel

Julien HENRY a écrit :
> Hi,
> 
> I want to execute jetty:run at the pre-integration-test phase and stop it (like Ctrl+C) at the post-integration-test phase.
> 
> The problem is jetty:run wait for being killed undefinitly and integration-test phase is never executed.
> 
> I don't know exactly how to do this. It may need to develop a new plugin or modify the existing one? Forking a JVM ?
> 
> I think I could use an ant run task, but it's not very "Maven compliant".
> 
> (http://ptrthomas.wordpress.com/2006/10/10/how-to-start-and-stop-jetty-from-ant/)
> 
> Thanks
> 
> Julien
> 
> 
> 
> 
> 	
> 
> 	
> 		
> ___________________________________________________________________________ 
> Découvrez une nouvelle façon d'obtenir des réponses à toutes vos questions ! 
> Profitez des connaissances, des opinions et des expériences des internautes sur Yahoo! Questions/Réponses 
> http://fr.answers.yahoo.com


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