cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1304646 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
Date Fri, 23 Mar 2012 22:59:30 GMT
Author: sergeyb
Date: Fri Mar 23 22:59:30 2012
New Revision: 1304646

URL: http://svn.apache.org/viewvc?rev=1304646&view=rev
Log:
[CXF-4200] Applying a modified patch on behalf of Rob ten Hove

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

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java?rev=1304646&r1=1304645&r2=1304646&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java Fri
Mar 23 22:59:30 2012
@@ -102,7 +102,7 @@ public class UriInfoImpl implements UriI
     }
 
     public List<PathSegment> getPathSegments(boolean decode) {
-        return JAXRSUtils.getPathSegments(getPath(), decode);
+        return JAXRSUtils.getPathSegments(getPath(false), decode);
     }
 
     public MultivaluedMap<String, String> getQueryParameters() {

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java?rev=1304646&r1=1304645&r2=1304646&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriInfoImplTest.java
Fri Mar 23 22:59:30 2012
@@ -19,7 +19,10 @@
 
 package org.apache.cxf.jaxrs.impl;
 
+import java.util.List;
+
 import javax.ws.rs.core.MultivaluedMap;
+import javax.ws.rs.core.PathSegment;
 import javax.ws.rs.core.UriInfo;
 
 import org.apache.cxf.jaxrs.model.URITemplate;
@@ -61,6 +64,30 @@ public class UriInfoImplTest extends Ass
     }
     
     @Test
+    public void testGetPathSegments() {
+        
+        UriInfoImpl u = new UriInfoImpl(mockMessage("http://localhost:8080", "/bar/foo/x%2Fb"),
+                                        null);
+        List<PathSegment> segments = u.getPathSegments();
+        assertEquals(3, segments.size());
+        assertEquals("bar", segments.get(0).toString());
+        assertEquals("foo", segments.get(1).toString());
+        assertEquals("x/b", segments.get(2).toString());
+    }
+    
+    @Test
+    public void testGetEncodedPathSegments() {
+        
+        UriInfoImpl u = new UriInfoImpl(mockMessage("http://localhost:8080", "/bar/foo/x%2Fb"),
+                                        null);
+        List<PathSegment> segments = u.getPathSegments(false);
+        assertEquals(3, segments.size());
+        assertEquals("bar", segments.get(0).toString());
+        assertEquals("foo", segments.get(1).toString());
+        assertEquals("x%2Fb", segments.get(2).toString());
+    }
+    
+    @Test
     public void testGetAbsolutePathWithEncodedChars() {
         
         UriInfoImpl u = new UriInfoImpl(mockMessage("http://localhost:8080/baz%20foo", "/bar"),



Mime
View raw message