users@jersey.java.net

Re: [Jersey] Jersey tests in external container

From: Beatriz Nombela <beaotx_at_gmail.com>
Date: Thu, 25 Mar 2010 17:47:50 +0100

Hello,

Thanks for the response. I was using 2.2.1. I've tried 2.0.9 and it
does work. Would it be possible to avoid the -D properties in the
maven command line using the overloaded getTestContainerFactory method
or something like that?

Regards

On Thu, Mar 25, 2010 at 3:48 PM, Pavel Bucek <Pavel.Bucek_at_sun.com> wrote:
> Hello,
>
> which version of maven do you use? If its newer than 2.0.9, it might be
> caused by maven bug (not propagating properties set by -D attr).
>
> Try it again with maven 2.0.9, it should work fine (we are using 2.0.9 for
> build and tests).
>
>
> Regards,
>
> Pavel
>
> bea wrote:
>>
>> 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.
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>



-- 
Beatriz Nombela Escobar
beaotx_at_gmail.com