users@jersey.java.net

Re: [Jersey] Re: ApplicationDescriptor gone?

From: Pavel Bucek <Pavel.Bucek_at_Sun.COM>
Date: Fri, 30 Jul 2010 11:14:31 +0200

Hello Alex,

I'm not really sure what are you doing in your code (is that method in
JerseyTest descendant?) but I can answer your other question.

ApplicationDescriptor class is no longer present, it was replaced by
abstract AppDescriptor and its implementations LowLevelAppDescriptor and
WebAppDescriptor [1]. Creating WebAppDescriptor is slightly different
than creating deprecated ApplicationDescriptor, you have to use
WebAppDescriptor.Builder.

You can find examples of usage in jersey tests, concretely for example
in helloworld test [2].

Since Jersey 1.2, test framework is modularized - WebAppDescriptor is
in jersey-test-framework-core jar.

You can find additional info in javadoc and something is present in
Jersey user guide [3].

Let me know if you have some additional questions.

Regards,
Pavel

[1]
https://jersey.dev.java.net/nonav/apidocs/1.1.2-ea/jersey-test-framework/com/sun/jersey/test/framework/WebAppDescriptor.html
[2]
https://jersey.dev.java.net/source/browse/jersey/tags/jersey-1.3/jersey/samples/helloworld-webapp/src/test/java/com/sun/jersey/samples/helloworld/HelloWorldWebAppTest.java?rev=3801&view=markup
[3]
https://jersey.dev.java.net/nonav/documentation/latest/user-guide.html#d4e1280

On 7/30/10 10:17 AM, Paul Sandoz wrote:
>
> On Jul 30, 2010, at 9:15 AM, Alexandru Popescu ☀ wrote:
>
>> I got very helpfup answers to all my other questions except this
>> one... so maybe it passed unobserved.
>>
>
> No, people are busy and work in various time-zones :-)
>
>
>> The documentation on testing seems to be a bit old, so I'd really
>> appreciate if someone with better knowledge of Jersey could comment on
>> this.
>>
>
> Pavel can answer this.
>
> Paul.
>
>> many thanks in advance,
>>
>> :- alex
>>
>> 2010/7/29 Alexandru Popescu ☀ <the.mindstorm.mailinglist_at_gmail.com>:
>>> Hi,
>>>
>>> I'm quite new to Jersey and I'm trying to set up one of the sample
>>> apps: bookstore. While I've got pretty much everything to compile (I'm
>>> not using maven) there is still one issue with the following code:
>>>
>>> [code]
>>> public TestSupport() throws Exception {
>>> super();
>>> Map<String, String> INIT_PARAMS = new HashMap<String, String>();
>>> INIT_PARAMS.put("com.sun.jersey.config.feature.Redirect",
>>> "true");
>>>
>>> INIT_PARAMS.put("com.sun.jersey.config.feature.ImplicitViewables",
>>> "true");
>>>
>>> INIT_PARAMS.put("com.sun.jersey.config.property.WebPageContentRegex",
>>> "/(images|css|jsp)/.*");
>>> ApplicationDescriptor applicationDescriptor = new
>>> ApplicationDescriptor();
>>> applicationDescriptor =
>>> applicationDescriptor.setContextPath("bookstore")
>>>
>>> .setRootResourcePackageName("com.sun.jersey.samples.bookstore.resources")
>>>
>>> .setServletInitParams(INIT_PARAMS);
>>> super.setupTestEnvironment(applicationDescriptor);
>>> }
>>> [/code]
>>>
>>> While I'm trying to use Jersey 1.2 (as I might need to run the app on
>>> 1.5), I haven't been able to find the ApplicationDescriptor class
>>> (com.sun.jersey.test.framework.util.ApplicationDescriptor) in any of
>>> the 1.1.5, 1.2 or 1.3.
>>>
>>> So I guess the whole thing changed. I have checked the documentation
>>> which links to a blog post that mentions exactly the same class. I've
>>> performed a couple of searches on the mailing list to find out how to
>>> replace/where to find it, but no success.
>>>
>>> Could you please point me to the right direction?
>>>
>>> thanks,
>>>
>>> :- alex
>>>
>>
>> ---------------------------------------------------------------------
>> 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
>