Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 26AA4C258 for ; Fri, 4 May 2012 10:08:30 +0000 (UTC) Received: (qmail 34934 invoked by uid 500); 4 May 2012 10:08:30 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 34820 invoked by uid 500); 4 May 2012 10:08:30 -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 34813 invoked by uid 99); 4 May 2012 10:08:30 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 04 May 2012 10:08:30 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.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; Fri, 04 May 2012 10:08:28 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 8950D238890B; Fri, 4 May 2012 10:08:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1333853 - in /cxf/branches/2.3.x-fixes: ./ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Date: Fri, 04 May 2012 10:08:08 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20120504100808.8950D238890B@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sergeyb Date: Fri May 4 10:08:07 2012 New Revision: 1333853 URL: http://svn.apache.org/viewvc?rev=1333853&view=rev Log: Merged revisions 1333838 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes ................ r1333838 | sergeyb | 2012-05-04 11:00:34 +0100 (Fri, 04 May 2012) | 16 lines Merged revisions 1333834 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.5.x-fixes ................ r1333834 | sergeyb | 2012-05-04 10:55:27 +0100 (Fri, 04 May 2012) | 9 lines Merged revisions 1333832 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1333832 | sergeyb | 2012-05-04 10:49:58 +0100 (Fri, 04 May 2012) | 1 line Updating some of JAXRSClientServerBookTest tests not to depend on the state updates ........ ................ ................ Modified: cxf/branches/2.3.x-fixes/ (props changed) 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/ ------------------------------------------------------------------------------ Merged /cxf/branches/2.5.x-fixes:r1333834 Merged /cxf/branches/2.4.x-fixes:r1333838 Merged /cxf/trunk:r1333832 Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. 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=1333853&r1=1333852&r2=1333853&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 Fri May 4 10:08:07 2012 @@ -746,8 +746,6 @@ public class BookStore { } book.setId(bookId + 1); - books.put(book.getId(), book); - return Response.ok(book).build(); } @@ -795,8 +793,7 @@ public class BookStore { Response r; if (b != null) { - books.put(book.getId(), book); - r = Response.ok().build(); + r = Response.ok(book).build(); } else { r = Response.notModified().build(); } @@ -813,8 +810,7 @@ public class BookStore { if (b == null) { Book newBook = new Book(); newBook.setId(id); - books.put(newBook.getId(), newBook); - r = Response.ok().build(); + r = Response.ok(newBook).build(); } else { r = Response.notModified().build(); } @@ -837,8 +833,7 @@ public class BookStore { Response r; if (b != null) { - books.put(book.getId(), book); - r = Response.ok().build(); + r = Response.ok(book).build(); } else { r = Response.notModified().build(); } 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=1333853&r1=1333852&r2=1333853&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 Fri May 4 10:08:07 2012 @@ -23,7 +23,6 @@ import java.io.File; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; -import java.net.URLConnection; import java.net.URLEncoder; import java.util.ArrayList; import java.util.Collection; @@ -1248,39 +1247,14 @@ public class JAXRSClientServerBookTest e try { int result = httpclient.executeMethod(put); assertEquals(200, result); + InputStream expected = getClass().getResourceAsStream("resources/expected_update_book.txt"); + assertEquals(getStringFromInputStream(expected), + getStringFromInputStream(put.getResponseBodyAsStream())); } finally { // Release current connection to the connection pool once you are // done put.releaseConnection(); } - - // Verify result - endpointAddress = "http://localhost:" + PORT + "/bookstore/books/123"; - URL url = new URL(endpointAddress); - URLConnection connect = url.openConnection(); - connect.addRequestProperty("Accept", "application/xml"); - InputStream in = connect.getInputStream(); - assertNotNull(in); - - InputStream expected = getClass().getResourceAsStream("resources/expected_update_book.txt"); - - assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in)); - - // Roll back changes: - File input1 = new File(getClass().getResource("resources/expected_get_book123.txt").toURI()); - PutMethod put1 = new PutMethod(endpointAddress); - RequestEntity entity1 = new FileRequestEntity(input1, "text/xml; charset=ISO-8859-1"); - put1.setRequestEntity(entity1); - HttpClient httpclient1 = new HttpClient(); - - try { - int result = httpclient1.executeMethod(put); - assertEquals(200, result); - } finally { - // Release current connection to the connection pool once you are - // done - put1.releaseConnection(); - } } @Test @@ -1321,39 +1295,14 @@ public class JAXRSClientServerBookTest e try { int result = httpclient.executeMethod(put); assertEquals(200, result); + InputStream expected = getClass().getResourceAsStream("resources/expected_update_book.txt"); + assertEquals(getStringFromInputStream(expected), + getStringFromInputStream(put.getResponseBodyAsStream())); } finally { // Release current connection to the connection pool once you are // done put.releaseConnection(); } - - // Verify result - endpointAddress = "http://localhost:" + PORT + "/bookstore/books/123"; - URL url = new URL(endpointAddress); - URLConnection connection = url.openConnection(); - connection.addRequestProperty("Accept", "application/xml"); - InputStream in = connection.getInputStream(); - assertNotNull(in); - - InputStream expected = getClass().getResourceAsStream("resources/expected_update_book.txt"); - - assertEquals(getStringFromInputStream(expected), getStringFromInputStream(in)); - - // Roll back changes: - File input1 = new File(getClass().getResource("resources/expected_get_book123.txt").toURI()); - PutMethod put1 = new PutMethod(endpointAddress); - RequestEntity entity1 = new FileRequestEntity(input1, "text/xml; charset=ISO-8859-1"); - put1.setRequestEntity(entity1); - HttpClient httpclient1 = new HttpClient(); - - try { - int result = httpclient1.executeMethod(put); - assertEquals(200, result); - } finally { - // Release current connection to the connection pool once you are - // done - put1.releaseConnection(); - } } @Test