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 23:08:35 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 6be44c2be -> 50f1eaf66


[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/50f1eaf6
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/50f1eaf6
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/50f1eaf6

Branch: refs/heads/2.7.x-fixes
Commit: 50f1eaf668fa2fc6121846e07fb9d5e36e27feec
Parents: 6be44c2
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 23:08:12 2015 +0000

----------------------------------------------------------------------
 .../apache/cxf/jaxrs/client/AbstractClient.java    |  2 +-
 .../transport/http/DestinationRegistryImpl.java    | 17 ++++++++++++-----
 .../jaxrs/JAXRSClientServerSpringBookTest.java     |  4 ++--
 .../src/test/resources/jaxrs/WEB-INF/beans.xml     |  2 +-
 4 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/50f1eaf6/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
index 84cc4e7..d74fe3d 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/AbstractClient.java
@@ -746,7 +746,7 @@ public abstract class AbstractClient implements Client, Retryable {
     }
     
     protected static void reportMessageHandlerProblem(String name, Class<?> cls, MediaType
ct, 
-                                                      Throwable cause, Response response)
{
+                                                      Throwable ex, Response response) {
         org.apache.cxf.common.i18n.Message errorMsg = 
             new org.apache.cxf.common.i18n.Message(name, 
                                                    BUNDLE,

http://git-wip-us.apache.org/repos/asf/cxf/blob/50f1eaf6/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/50f1eaf6/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 90e5d2d..36f4e44 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
@@ -93,7 +93,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);
         
     }
@@ -337,7 +337,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/50f1eaf6/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 af06224..06b206d 100644
--- a/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml
+++ b/systests/jaxrs/src/test/resources/jaxrs/WEB-INF/beans.xml
@@ -76,7 +76,7 @@ http://cxf.apache.org/schemas/core.xsd">
   </jaxrs:server>
 
   <jaxrs:server id="bookservice3"
-		        address="/thebooks3/bookstore">
+		        address="/thebooks%203/bookstore">
     <jaxrs:serviceBeans>
       <ref bean="serviceBean" />
     </jaxrs:serviceBeans>		  


Mime
View raw message