cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1561097 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/impl/RequestImpl.java test/java/org/apache/cxf/jaxrs/impl/RequestImplTest.java
Date Fri, 24 Jan 2014 18:10:13 GMT
Author: sergeyb
Date: Fri Jan 24 18:10:13 2014
New Revision: 1561097

URL: http://svn.apache.org/r1561097
Log:
[CXF-5508] Fixing Request.evaluatePreconditions(Date, EntityTag)

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestImpl.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/RequestImplTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestImpl.java?rev=1561097&r1=1561096&r2=1561097&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/RequestImpl.java Fri
Jan 24 18:10:13 2014
@@ -290,7 +290,7 @@ public class RequestImpl implements Requ
             // the ETag conditions do not match, so last modified should be ignored
             // see http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html (section 14.26
for
             // "If-None-Match", behaviour not specified for "If-Match", section 14.24)
-            return null;
+            return rb;
         }
     }
     

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/RequestImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/RequestImplTest.java?rev=1561097&r1=1561096&r2=1561097&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/RequestImplTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/RequestImplTest.java
Fri Jan 24 18:10:13 2014
@@ -212,6 +212,16 @@ public class RequestImplTest extends Ass
     }
     
     @Test
+    public void testIfNotMatchAndLastModified() {
+        metadata.putSingle(HttpHeaders.IF_NONE_MATCH, "1");
+        
+        ResponseBuilder rb = 
+            new RequestImpl(m).evaluatePreconditions(new Date(), new EntityTag("1"));
+        assertEquals("Precondition must not be met", 
+                     304, rb.build().getStatus());
+    }
+    
+    @Test
     public void testEtagsIfNotMatch() {
         metadata.putSingle(HttpHeaders.IF_NONE_MATCH, "\"123\"");
         



Mime
View raw message