Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 72139 invoked from network); 25 Jan 2011 16:33:06 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 25 Jan 2011 16:33:06 -0000 Received: (qmail 61947 invoked by uid 500); 25 Jan 2011 16:33:06 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 61848 invoked by uid 500); 25 Jan 2011 16:33:05 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 61841 invoked by uid 99); 25 Jan 2011 16:33:05 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jan 2011 16:33:05 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 25 Jan 2011 16:33:03 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 98B3D2388A44; Tue, 25 Jan 2011 16:32:42 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1063342 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ Date: Tue, 25 Jan 2011 16:32:42 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110125163242.98B3D2388A44@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sergeyb Date: Tue Jan 25 16:32:42 2011 New Revision: 1063342 URL: http://svn.apache.org/viewvc?rev=1063342&view=rev Log: Merged revisions 1063340 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1063340 | sergeyb | 2011-01-25 16:28:45 +0000 (Tue, 25 Jan 2011) | 1 line [CXF-3288] Cloning ResponseBuilder during Client.getResponse() calls ........ Modified: cxf/branches/2.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Jan 25 16:32:42 2011 @@ -1 +1 @@ -/cxf/trunk:1063042,1063205,1063267 +/cxf/trunk:1063042,1063205,1063267,1063340 Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java?rev=1063342&r1=1063341&r2=1063342&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java (original) +++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java Tue Jan 25 16:32:42 2011 @@ -253,7 +253,7 @@ public class AbstractClient implements C if (state.getResponseBuilder() == null) { return null; } - return state.getResponseBuilder().build(); + return state.getResponseBuilder().clone().build(); } /** Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1063342&r1=1063341&r2=1063342&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java (original) +++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java Tue Jan 25 16:32:42 2011 @@ -57,6 +57,7 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.WebApplicationException; import javax.ws.rs.core.Context; import javax.ws.rs.core.Cookie; +import javax.ws.rs.core.EntityTag; import javax.ws.rs.core.GenericEntity; import javax.ws.rs.core.HttpHeaders; import javax.ws.rs.core.MediaType; @@ -392,6 +393,15 @@ public class BookStore { } @GET + @Path("/books/response/{bookId}/") + @Produces("application/xml") + public Response getBookAsResponse(@PathParam("bookId") String id) throws BookNotFoundFault { + Book entity = doGetBook(id); + EntityTag etag = new EntityTag(Integer.toString(entity.hashCode())); + return Response.ok().tag(etag).entity(entity).build(); + } + + @GET @Path("/books/{bookId}/cglib") @Produces("application/xml") public Book getBookCGLIB(@PathParam("bookId") String id) throws BookNotFoundFault { Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1063342&r1=1063341&r2=1063342&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java (original) +++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Tue Jan 25 16:32:42 2011 @@ -80,6 +80,21 @@ public class JAXRSClientServerBookTest e assertEquals(123L, book.getId()); } + @Test + public void testGetBookResponseAndETag() throws Exception { + + String endpointAddress = + "http://localhost:" + PORT + "/bookstore/books/response/123"; + WebClient wc = WebClient.create(endpointAddress); + Book book = wc.get(Book.class); + assertEquals(200, wc.getResponse().getStatus()); + assertEquals(123L, book.getId()); + MultivaluedMap headers = wc.getResponse().getMetadata(); + assertTrue(headers.size() > 0); + Object etag = headers.getFirst("ETag"); + assertNotNull(etag); + } + @Test public void testOnewayWebClient() throws Exception {