cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1179851 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImplTest.java
Date Thu, 06 Oct 2011 21:01:34 GMT
Author: sergeyb
Date: Thu Oct  6 21:01:34 2011
New Revision: 1179851

URL: http://svn.apache.org/viewvc?rev=1179851&view=rev
Log:
Merged revisions 1179850 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes

................
  r1179850 | sergeyb | 2011-10-06 21:56:14 +0100 (Thu, 06 Oct 2011) | 9 lines
  
  Merged revisions 1179846 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1179846 | sergeyb | 2011-10-06 21:51:38 +0100 (Thu, 06 Oct 2011) | 1 line
    
    [CXF-3847] Fixing ResponseBuilderImpl status validation
  ........
................

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/impl/ResponseBuilderImpl.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImplTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Thu Oct  6 21:01:34 2011
@@ -0,0 +1,2 @@
+/cxf/branches/2.4.x-fixes:1179850
+/cxf/trunk:1179846

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/impl/ResponseBuilderImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java?rev=1179851&r1=1179850&r2=1179851&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImpl.java
Thu Oct  6 21:01:34 2011
@@ -64,7 +64,7 @@ public final class ResponseBuilderImpl e
     }
 
     public ResponseBuilder status(int s) {
-        if (status < 100 || status > 599) {
+        if (s < 100 || s > 599) {
             throw new IllegalArgumentException("Illegal status value : " + s);
         }
         status = s;

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImplTest.java?rev=1179851&r1=1179850&r2=1179851&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImplTest.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/ResponseBuilderImplTest.java
Thu Oct  6 21:01:34 2011
@@ -40,6 +40,24 @@ import org.junit.Test;
 
 public class ResponseBuilderImplTest extends Assert {
 
+    @Test
+    public void testValidStatus() {
+        assertEquals(100, Response.status(100).build().getStatus());
+        assertEquals(101, Response.status(101).build().getStatus());
+        assertEquals(200, Response.status(200).build().getStatus());
+        assertEquals(599, Response.status(599).build().getStatus());
+        assertEquals(598, Response.status(598).build().getStatus());
+    }
+    
+    @Test(expected = IllegalArgumentException.class)
+    public void testIllegalsStatus1() {
+        Response.status(99).build();
+    }
+    
+    @Test(expected = IllegalArgumentException.class)
+    public void testIllegalsStatus2() {
+        Response.status(600).build();
+    }
      
     @Test
     public void testAbsoluteLocation() {



Mime
View raw message