cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject cxf git commit: [CXF-6302] Initial support for URL-encoded RS destinations
Date Fri, 20 Mar 2015 22:56:33 GMT
Repository: cxf
Updated Branches:
  refs/heads/master a7350a2da -> 5988e70d4


[CXF-6302] Initial support for URL-encoded RS destinations


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/5988e70d
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/5988e70d
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/5988e70d

Branch: refs/heads/master
Commit: 5988e70d48b26865aa8622256c1147611003a498
Parents: a7350a2
Author: Sergey Beryozkin <sberyozkin@talend.com>
Authored: Fri Mar 20 22:56:17 2015 +0000
Committer: Sergey Beryozkin <sberyozkin@talend.com>
Committed: Fri Mar 20 22:56:17 2015 +0000

----------------------------------------------------------------------
 .../transport/http/DestinationRegistryImpl.java    | 17 ++++++++++++-----
 .../jaxrs/JAXRSClientServerSpringBookTest.java     |  4 ++--
 .../src/test/resources/jaxrs/WEB-INF/beans.xml     |  2 +-
 3 files changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/5988e70d/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java
----------------------------------------------------------------------
diff --git a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java
b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java
index edfe5c2..539ba6f 100644
--- a/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java
+++ b/rt/transports/http/src/main/java/org/apache/cxf/transport/http/DestinationRegistryImpl.java
@@ -85,9 +85,19 @@ public class DestinationRegistryImpl implements DestinationRegistry {
     }
     
     public AbstractHTTPDestination checkRestfulRequest(String address) {
+        AbstractHTTPDestination ret = getRestfulDestination(getDestinationsPaths(), address);
+        if (ret == null) {
+            ret = getRestfulDestination(decodedDestinations.keySet(), address);
+        }
+        if (ret != null && ret.getMessageObserver() == null) {
+            return null;
+        }
+        return ret; 
+    }
+    private AbstractHTTPDestination getRestfulDestination(Set<String> destPaths, String
address) {
         int len = -1;
         AbstractHTTPDestination ret = null;
-        for (String path : getDestinationsPaths()) {
+        for (String path : destPaths) {
             String thePath = path.length() > 1 && path.endsWith(SLASH) 
                 ? path.substring(0, path.length() - 1) : path;
             if ((address.equals(thePath) 
@@ -99,10 +109,7 @@ public class DestinationRegistryImpl implements DestinationRegistry {
                 len = path.length();
             }
         }
-        if (ret != null && ret.getMessageObserver() == null) {
-            return null;
-        }
-        return ret; 
+        return ret;
     }
 
     public Collection<AbstractHTTPDestination> getDestinations() {

http://git-wip-us.apache.org/repos/asf/cxf/blob/5988e70d/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
index c4df434..72afb43 100644
--- a/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
+++ b/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java
@@ -97,7 +97,7 @@ public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTest
     
     @Test
     public void testGetBookWebEx4() throws Exception {
-        final String address = "http://localhost:" + PORT + "/the/thebooks3/bookstore/books/webex2";

+        final String address = "http://localhost:" + PORT + "/the/thebooks%203/bookstore/books/webex2";

         doTestGetBookWebEx(address);
         
     }
@@ -377,7 +377,7 @@ public class JAXRSClientServerSpringBookTest extends AbstractBusClientServerTest
     @Test
     public void testGetBookByUriInfo2() throws Exception {
         String endpointAddress =
-            "http://localhost:" + PORT + "/the/thebooks3/bookstore/bookinfo?"
+            "http://localhost:" + PORT + "/the/thebooks%203/bookstore/bookinfo?"
                                + "param1=12&param2=3"; 
         getBook(endpointAddress, "resources/expected_get_book123json.txt");
     }

http://git-wip-us.apache.org/repos/asf/cxf/blob/5988e70d/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml
----------------------------------------------------------------------
diff --git a/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml b/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml
index f1acd6d..ab7c78f 100644
--- a/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml
+++ b/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml
@@ -55,7 +55,7 @@
             <bean class="org.apache.cxf.systest.jaxrs.CustomWebApplicationExceptionMapper"/>
         </jaxrs:providers>
     </jaxrs:server>
-    <jaxrs:server id="bookservice3" address="/thebooks3/bookstore">
+    <jaxrs:server id="bookservice3" address="/thebooks%203/bookstore">
         <jaxrs:serviceBeans>
             <ref bean="serviceBean"/>
         </jaxrs:serviceBeans>


Mime
View raw message