You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by se...@apache.org on 2011/02/09 14:07:16 UTC

svn commit: r1068878 - 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

Author: sergeyb
Date: Wed Feb  9 13:07:15 2011
New Revision: 1068878

URL: http://svn.apache.org/viewvc?rev=1068878&view=rev
Log:
Merged revisions 1068877 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1068877 | sergeyb | 2011-02-09 13:06:09 +0000 (Wed, 09 Feb 2011) | 1 line
  
  [CXF-3304] Disabling the chunking lets retrieve the text of the 401 response
........

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/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Wed Feb  9 13:07:15 2011
@@ -1 +1 @@
-/cxf/trunk:1068320,1068337,1068525,1068867
+/cxf/trunk:1068320,1068337,1068525,1068867,1068877

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=1068878&r1=1068877&r2=1068878&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 Wed Feb  9 13:07:15 2011
@@ -224,6 +224,12 @@ public class BookStore {
     }
     
     @POST
+    @Path("post401")
+    public Response get401WithText() throws Exception {
+        return Response.status(401).entity("This is 401").build();
+    }
+    
+    @POST
     @Path("/collections")
     @Produces({"application/xml", "application/json" })
     @Consumes({"application/xml", "application/json" })

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=1068878&r1=1068877&r2=1068878&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 Wed Feb  9 13:07:15 2011
@@ -66,6 +66,17 @@ public class JAXRSClientServerBookTest e
                    launchServer(BookServer.class));
     }
     
+    @Test
+    public void testPostAnd401WithText() throws Exception {
+        
+        String endpointAddress =
+            "http://localhost:" + PORT + "/bookstore/post401"; 
+        WebClient wc = WebClient.create(endpointAddress);
+        WebClient.getConfig(wc).getHttpConduit().getClient().setAllowChunking(false);
+        Response r = wc.post(null);
+        assertEquals(401, r.getStatus());
+        assertEquals("This is 401", getStringFromInputStream((InputStream)r.getEntity()));
+    }
 
     @Test
     public void testGetCollectionOfBooks() throws Exception {