users@jersey.java.net

Jersey tests in external container

From: bea <beaotx_at_gmail.com>
Date: Thu, 25 Mar 2010 15:12:13 +0100

Hi,

I'm trying to test a Jersey application with the external container.
I'm using the 1.1.5.1 version. When I want to run the tests I type:

mvn clean test -Dtest.containerFactory=com.sun.jersey.test.framework.spi.container.external.ExternalTestContainerFactory
-DenableLogging
-DJERSEY_HTTP_PORT=<port> -DJERSEY_HOST_NAME=<ip>

Then the grizzly container attempts to start:

Running <my_class_test>
25-mar-2010 0:18:48
com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainerFactory$GrizzlyWebTestContainer
<init>
INFO: Creating Grizzly Web Container configured at the base URI
http://localhost:9998/docs
25-mar-2010 0:18:48
com.sun.jersey.test.framework.spi.container.grizzly.web.GrizzlyWebTestContainerFactory$GrizzlyWebTestContainer
start
INFO: Starting the Grizzly Web Container...

The tests classes extends JerseyTest and the constructor has the
following setup:

public MyTest() throws Exception {
   super(new WebAppDescriptor.Builder("<resources
package>").contextPath("docs").build());
}

What else should I have to run my tests with the external container?

Cheers.

-- 
Beatriz Nombela Escobar
beaotx_at_gmail.com