cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1158179 - in /cxf/branches/2.4.x-fixes: ./ rt/transports/http/src/main/java/org/apache/cxf/transport/http/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/
Date Tue, 16 Aug 2011 10:09:21 GMT
Author: sergeyb
Date: Tue Aug 16 10:09:20 2011
New Revision: 1158179

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

........
  r1158178 | sergeyb | 2011-08-16 11:05:38 +0100 (Tue, 16 Aug 2011) | 1 line
  
  [CXF-3620] Minor update to check empty strings for PUT requests
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
    cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Aug 16 10:09:20 2011
@@ -1 +1 @@
-/cxf/trunk:1157121,1157699,1158144
+/cxf/trunk:1157121,1157699,1158144,1158178

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java?rev=1158179&r1=1158178&r2=1158179&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
Tue Aug 16 10:09:20 2011
@@ -555,7 +555,11 @@ public class HTTPConduit 
         if (HTTP_PUT_METHOD.equals(httpMethod)) {
             MessageContentsList objs = MessageContentsList.getContentsList(message);
             if (objs != null && objs.size() > 0) {
-                return true;
+                Object obj = objs.get(0);
+                if (obj.getClass() != String.class 
+                    || (obj.getClass() == String.class && ((String)obj).length()
> 0)) {
+                    return true;
+                }
             }
         }
         return false;

Modified: cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1158179&r1=1158178&r2=1158179&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
(original)
+++ cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java
Tue Aug 16 10:09:20 2011
@@ -132,6 +132,11 @@ public class BookStore {
         }
     }
     
+    @PUT
+    @Path("emptyput")
+    public void emptyput() {
+    }
+    
     @POST
     public void emptypostNoPath() {
         emptypost();

Modified: cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1158179&r1=1158178&r2=1158179&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Tue Aug 16 10:09:20 2011
@@ -591,13 +591,26 @@ public class JAXRSClientServerBookTest e
         WebClient wc = 
             WebClient.create("http://localhost:" 
                              + PORT + "/bookstore/emptypost");
-        WebClient.getConfig(wc).getHttpConduit().getClient().setReceiveTimeout(10000000L);
         Response response = wc.post(null);
         assertEquals(204, response.getStatus());
         assertNull(response.getMetadata().getFirst("Content-Type"));
     }
     
     @Test
+    public void testEmptyPut() throws Exception {
+        WebClient wc = 
+            WebClient.create("http://localhost:" 
+                             + PORT + "/bookstore/emptyput");
+        Response response = wc.put(null);
+        assertEquals(204, response.getStatus());
+        assertNull(response.getMetadata().getFirst("Content-Type"));
+        
+        response = wc.put("");
+        assertEquals(204, response.getStatus());
+        assertNull(response.getMetadata().getFirst("Content-Type"));
+    }
+    
+    @Test
     public void testEmptyPostProxy() throws Exception {
         String address = "http://localhost:" + PORT;
         JAXRSClientFactoryBean bean = new JAXRSClientFactoryBean(); 



Mime
View raw message