users@jersey.java.net

Re: [Jersey] jersey test and basic authentication

From: Srinivas Naresh Bhimisetty <shri.naresh_at_gmail.com>
Date: Fri, 27 Nov 2009 12:00:05 +0530

On Thu, Nov 26, 2009 at 8:24 PM, tarjei <tarjei_at_nu.no> wrote:

> On 11/26/2009 03:13 PM, Srinivas Naresh Bhimisetty wrote:
>
>> Hi Gonzalo,
>>
>> may be you can use the Basic Authentication by putting in the
>> security "details"/ "roles" or "constraints" in your web.xml.
>> I think that should work.
>>
>
> Is it possible to setup a JerseyTest to take all it's configuration from an
> web.xml file instead of using a builder?
>
Yes.

If you are trying to run your tests using the Embedded GlassFish, and if
your application has a web.xml, the framework just ignores the configuration
that you provide in the test class using the Builder pattern.

However, the data that is provided using the Builder pattern would be useful
in cases where the web.xml is not present and you want to run the tests
using EmbeddedGF. In such cases, the framework generates the web.xml "on the
fly".

- Naresh



> Regards,
> Tarjei
>
>>
>> Thanks,
>> Naresh
>>
>> 2009/11/26 Gonzalo Suárez <gonzalo_at_abstra.cc>
>>
>> Hi all,
>>
>> I have some tests that use the Jersey Test Framework agains a
>> Embedded GlassFish. Is there any way to make that Embedded GF to
>> start using Basic Authentication. I need that feature to be enable
>> during tests execution in order to pass the tests successfully. Do I
>> need to add something to the pom.xml?
>>
>> Thanks for your help.
>>
>> Gonzalo.
>>
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
>> <mailto:users-unsubscribe_at_jersey.dev.java.net>
>>
>> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>> <mailto:users-help_at_jersey.dev.java.net>
>>
>>
>>
>
> --
> Tarjei Huse
> Mobil: 920 63 413
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>