Mats Henricson wrote:
> Unfortunately, that was WAY above my knowledge level.
>
> But lets see, what you are saying is that it is NOT possible to hand-
> wire my resources together with its exception mappers, and then
> send it to Grizzly or some other container so that I can test it over
> HTTP?
>
All the Jersey sample apps that are webapps actually have this kind of
testing. Essentially, the setup() method starts up an instance of the
application running under Grizzly, and the test methods use Jersey
client to make HTTP calls against it. Then, the tearDown() method takes
the Grizzly instance down.
One example of this approach is in samples/atompub-contacts-server.
Craig
> Mats
> ________________________________________
> From: Paul.Sandoz_at_Sun.COM [Paul.Sandoz_at_Sun.COM]
> Sent: Tuesday, March 24, 2009 16:55
> To: users_at_jersey.dev.java.net
> Subject: Re: [Jersey] Is there a way to programmatically attach my excewption mappers?
>
> On Mar 24, 2009, at 4:26 PM, Mats Henricson wrote:
>
>
>> Hi!
>>
>> I've seen and used the @Provider annotation, but is there any way I
>> can wire
>> up my resource and these mappers programatically (not using
>> annotations)?
>>
>> This could help me get my unit tests through, by subclassing
>> Application.
>>
>>
>
> You still need to use the annotations but you can change the
> registration strategy by subclassing Application. See:
>
> http://wikis.sun.com/display/Jersey/Overview+of+JAX-RS+1.0+Features#OverviewofJAX-RS1.0Features-DeployingaRESTfulWebservice
>
> Paul.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>
>