users@jersey.java.net

Re: Client side API used for testing services

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Thu, 25 Oct 2007 18:56:22 +0200

Hi,

I completed converting all the unit test code while refactoring the
client API at the same time. It worked reasonably well.

Below are some "brain dump" observations as a reminder to myself to look
at, but perhaps others might be interested:

- document it!

- modify the examples to use this API.

- the builder support is a little inconsistent as the methods to
   initiation building are different to those when continuing building.
   When writing/modifying the tests i found this inconsistency to be a
   pain.
   Move static methods RequestOutBound.Builder to RequestOutBound
   and change them to be consistent with the non-static methods on
   Change initiator building methods on ResourceProxy to be the same as
   on RequestOutBound.

- builder support for If-Match, If-None-Match, If-Unmodified-Since,
   If-Modified-Since ?

- should query params be part of the request building ?

- ResourceProxyFactory that can be configured with default
   request metadata and filters.

- create a new resource proxy from an existing resource proxy that
   inherits configuration.

- support writing a request entity to an OutputStream. This is a tricky
   one.

- filters for caching, redirect following, authentication etc.

Paul.

Paul Sandoz wrote:
> Hi,
>
> I have just committed a simple HTTP client side API. Currently this API
> is a bit raw and undocumented. The short term plan is to use it to
> improve testing, i have already modified the LW HTTP server tests to use
> this API, and the same API will be used for testing services in-memory,
> and in the longer term for client code and server code to be tested in a
> container independent manner.
>
> At the moment the source code is under the package:
>
> com.sun.ws.rest.impl.client [1]
>
> After it has been through a couple of iterations being used as a test
> API i plan to move relevant classes/ifaces to the
> com.sun.ws.rest.api.client package for general use.
>
> If any of you are feeling adventurous you can try it out in the latest
> build [2]. As an example look at the this test [3] (see attached).
>
> Paul.
>
> [1]
> https://jersey.dev.java.net/source/browse/jersey/trunk/jersey/src/impl/com/sun/ws/rest/impl/client/
>
> [2]
> https://jersey.dev.java.net/servlets/ProjectDocumentList?folderID=7653&expandFolder=7653&folderID=0
>
> [3]
> https://jersey.dev.java.net/source/browse/*checkout*/jersey/trunk/jersey/test/com/sun/ws/rest/impl/container/httpserver/AcceptableXMLorJSONTest.java
>
>
>
> ------------------------------------------------------------------------
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109