Jersey Test Framework update

From: Pavel Bucek <Pavel.Bucek_at_Sun.COM>
Date: Fri, 19 Feb 2010 14:59:24 +0100


we did some changes in jersey test framework which may affect you, so if
you are using it, please pay attention.

Test framework is now modularized and you have to specify that
particular module (or modules) on classpath. jersey-test-framework
itself doesn't provide any factories. There are some following rules to
determine which container will be used:

- when jersey.test.containerFactory property is not specified, container
factory from module in dependencies (on classpath) will be used. There
are two scenarios when your project depends on more than one test
framework module:
    - grizzly module is present on classpath: grizzly web container will
be used (because its default test container)
    - grizzly module is not present on classpath: warning will be
produced and first found factory used (which one is specified in warning

- when jersey.test.containerFactory property is specified, and loadable
(its module is on classpath), then corresponding test factory will be used


1) I have maven based project which depends on:


when "mvn clean install" is executed, inmemory test factory will be used
and you don't have to do anything else.

2) I have maven based project which depends on:


then I can exec "mvn clean install" and tests will run on grizzly web
container (default containerFactory). Or if I want run my tests on
externalContainer, I can do:

mvn clean install

and test will be executed against external container running on

If you have own containerFactory implementation and you want to create
your module, take a look at
(or any other module). Basically you can just package your test factory
into jar and put it on classpath and activate it by specifying
"jersey.test.containerFactory" property. If you want get rid of that
property (and you have only one container module on classpath), you can
file in your jar and put fully classified java class name of your
factory inside.

Please let me k now if you have some objections/suggestions in this
matter, jersey 1.2 is going to be released sometime in March so there is
time for adjustments.