cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1027608 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Date Tue, 26 Oct 2010 16:00:44 GMT
Author: sergeyb
Date: Tue Oct 26 16:00:43 2010
New Revision: 1027608

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

........
  r1027599 | sergeyb | 2010-10-26 16:52:30 +0100 (Tue, 26 Oct 2010) | 1 line
  
  [CXF-3088] : Fixing the UriBuilder.clone() losing a leading slash
........

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

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Oct 26 16:00:43 2010
@@ -1 +1 @@
-/cxf/trunk:1027274,1027462,1027509,1027553
+/cxf/trunk:1027274,1027462,1027509,1027553,1027599

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Oct 26 16:00:43 2010
@@ -1 +1 @@
-/cxf/trunk:1-1022129,1022154,1022194,1022401-1022402,1022911,1023068,1023121,1023597-1026352,1026549,1026551,1027244,1027269,1027274,1027462,1027509,1027553
+/cxf/trunk:1-1022129,1022154,1022194,1022401-1022402,1022911,1023068,1023121,1023597-1026352,1026549,1026551,1027244,1027269,1027274,1027462,1027509,1027553,1027599

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java?rev=1027608&r1=1027607&r2=1027608&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriBuilderImpl.java
Tue Oct 26 16:00:43 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/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java?rev=1027608&r1=1027607&r2=1027608&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/impl/UriBuilderImplTest.java
Tue Oct 26 16:00:43 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