cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1027599 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Date Tue, 26 Oct 2010 15:52:30 GMT
Author: sergeyb
Date: Tue Oct 26 15:52:30 2010
New Revision: 1027599

URL: http://svn.apache.org/viewvc?rev=1027599&view=rev
Log:
[CXF-3088] : Fixing the UriBuilder.clone() losing a leading slash

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

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java?rev=1027599&r1=1027598&r2=1027599&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
Tue Oct 26 15:52:30 2010
@@ -300,7 +300,8 @@ public class UriBuilderImpl extends UriB
         builder.fragment = fragment;
         builder.query = new MetadataMap<String, String>(query);
         builder.matrix = new MetadataMap<String, String>(matrix);
-        builder.schemeSpecificPart = schemeSpecificPart; 
+        builder.schemeSpecificPart = schemeSpecificPart;
+        builder.leadingSlash = leadingSlash;
         return builder;
     }
 

Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java?rev=1027599&r1=1027598&r2=1027599&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
(original)
+++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Tue Oct 26 15:52:30 2010
@@ -153,6 +153,28 @@ public class UriBuilderImplTest extends 
     }
     
     @Test
+    public void testCloneWithoutLeadingSlash() throws Exception {
+        URI uri = new URI("bar/foo");
+        URI newUri = new UriBuilderImpl(uri).clone().build();   
+        assertEquals("URI is not built correctly", "bar/foo", newUri.toString());
+    }
+    
+    @Test
+    public void testCloneWithLeadingSlash() throws Exception {
+        URI uri = new URI("/bar/foo");
+        URI newUri = new UriBuilderImpl(uri).clone().build();   
+        assertEquals("URI is not built correctly", "/bar/foo", newUri.toString());
+    }
+    
+    @Test
+    public void testBuildWithLeadingSlash() throws Exception {
+        URI uri = new URI("/bar/foo");
+        URI newUri = UriBuilder.fromUri(uri).build();   
+        assertEquals("URI is not built correctly", "/bar/foo", newUri.toString());
+    }
+    
+    
+    @Test
     public void testClonePctEncodedFromUri() throws Exception {
         URI uri = new URI("http://bar/foo%20");
         URI newUri = new UriBuilderImpl(uri).clone().buildFromEncoded();   



Mime
View raw message