dev@jersey.java.net

Re: [Jersey] jersey test framework filters?

From: James Russo <jr_at_halo3.net>
Date: Wed, 14 Apr 2010 09:10:54 -0400

Hello,

        One other thing. What is the reasoning behind not being able to specify a filter and a custom servlet container at the same time? I see that when I specify a servletClass (Spring in my instance) it resets the filter (spring delegating filter in my instance) to null and then I set a filter it resets the servlet to null.

Thanks,

-jr
        
On Apr 14, 2010, at 4:08 AM, Pavel Bucek wrote:

> Hello James,
>
> please see inline.
>
>
> James Russo wrote:
>> Hello,
>> I have some resources which are behind URLs protected by Spring Security (Basic Auth).. I'm trying to make use of the test framework, but it doesn't seem to be working with the filter. The filter specified on the builder never seems to make it to the Servlet Adapter on grizzly?
>>
>> in GrizzlyWebTestContainerFactory, I see the (single?) filter assigned to the filterClass variable, but then nothing is done with it. It would appear to me that it needs to be set in the ServletAdapter via the addFilter method?
>>
> which version of jersey are you using?
>
> I see following code in 1.2-SNAPSHOT:
>
> (GrizzlyWebTestContainerFactory.java:177-185)
>
> // Filter support
> if ( filterClass!=null ) {
> try {
> sa.addFilter((Filter) filterClass.newInstance(), "jerseyfilter", initParams); } catch (InstantiationException ex) { throw new TestContainerException(ex);
> } catch (IllegalAccessException ex) { throw new TestContainerException(ex);
> }
> }
>
> Can you provide a testcase (simple maven-based project would be perfect)?
>
>
> Regards,
>
> Pavel
>> I'll take a stab and making it work if someone can point me towards anon svn?
>>
>> thanks,
>>
>> -jr
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
>> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: dev-help_at_jersey.dev.java.net
>