users@jersey.java.net

Re: [Jersey] Re: HTTP codes changing in Glassfish V3 ?

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 13 Oct 2009 11:17:39 +0200

On Oct 13, 2009, at 11:01 AM, Felipe Gaścho wrote:

> so, this ok() is a range if 200 possible values ?
>

It will be 204 if an entity is not provided it will be 200 if an
entity is provided.


> my question is regarding unit the integration tests.. I am doing:
>
> int confirmationResponseCode = confirmRegistration();
> assertTrue("unable to confirm the fake registration",
> Status.OK.getStatusCode() == confirmationResponseCode);
>
>
> Is there a way of checking OK for all ranges in the integration test?
>
> for now I am just testing "value>199 && value<300"
>

Use:

   response.getClientResponseStatus().getFamily()

https://jersey.dev.java.net/nonav/apidocs/1.1.2-ea/jersey/com/sun/jersey/api/client/ClientResponse.html
#getClientResponseStatus%28%29

Paul.

> ------ the full test case code is here:
>
> http://kenai.com/projects/puj/sources/arena/content/arena-client/src/test/java/com/kenai/puj/arena/client/test/UserManagementTestCase.java
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>