cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1207836 - in /cxf/branches/2.4.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Date Tue, 29 Nov 2011 11:45:03 GMT
Author: sergeyb
Date: Tue Nov 29 11:45:02 2011
New Revision: 1207836

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

........
  r1207835 | sergeyb | 2011-11-29 11:43:07 +0000 (Tue, 29 Nov 2011) | 1 line
  
  [CXF-3939] Fixing UriInfo to return the list of matched URIs and resources in the reverse
order
........

Modified:
    cxf/branches/2.4.x-fixes/   (props changed)
    cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
    cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Nov 29 11:45:02 2011
@@ -1 +1 @@
-/cxf/trunk:1205786,1205830,1205996-1205997,1206800,1207334,1207482
+/cxf/trunk:1205786,1205830,1205996-1205997,1206800,1207334,1207482,1207835

Propchange: cxf/branches/2.4.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java?rev=1207836&r1=1207835&r2=1207836&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
(original)
+++ cxf/branches/2.4.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java
Tue Nov 29 11:45:02 2011
@@ -22,6 +22,7 @@ package org.apache.cxf.jaxrs.impl;
 import java.net.URI;
 import java.util.ArrayList;
 import java.util.Collections;
+import java.util.LinkedList;
 import java.util.List;
 import java.util.Map;
 import java.util.logging.Logger;
@@ -156,9 +157,9 @@ public class UriInfoImpl implements UriI
 
     public List<Object> getMatchedResources() {
         if (stack != null) {
-            List<Object> resources = new ArrayList<Object>(stack.size());
+            List<Object> resources = new LinkedList<Object>();
             for (MethodInvocationInfo invocation : stack) {
-                resources.add(invocation.getRealClass());
+                resources.add(0, invocation.getRealClass());
             }
             return resources;
         }
@@ -173,7 +174,7 @@ public class UriInfoImpl implements UriI
     public List<String> getMatchedURIs(boolean decode) {
         if (stack != null) {
             List<String> objects = new ArrayList<String>();
-            List<String> uris = new ArrayList<String>(stack.size());
+            List<String> uris = new LinkedList<String>();
             String sum = "";
             for (MethodInvocationInfo invocation : stack) {
                 OperationResourceInfo ori = invocation.getMethodInfo();
@@ -189,7 +190,7 @@ public class UriInfoImpl implements UriI
                 }
                 UriBuilder ub = UriBuilder.fromPath(sum);
                 objects.addAll(invocation.getTemplateValues());
-                uris.add(ub.build(objects.toArray()).normalize().getPath());
+                uris.add(0, ub.build(objects.toArray()).normalize().getPath());
             }
             return uris;
         }

Modified: cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1207836&r1=1207835&r2=1207836&view=diff
==============================================================================
--- cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
(original)
+++ cxf/branches/2.4.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java
Tue Nov 29 11:45:02 2011
@@ -1583,9 +1583,9 @@ public class JAXRSClientServerBookTest e
     public void testUriInfoMatchedResources() throws Exception {
         getAndCompare("http://localhost:" + PORT + "/bookstore/"
                       + "booksubresource/123/chapters/sub/1/matched-resources", 
-                      "[class org.apache.cxf.systest.jaxrs.BookStore, " 
+                      "[class org.apache.cxf.systest.jaxrs.Chapter, " 
                       + "class org.apache.cxf.systest.jaxrs.Book, "
-                      + "class org.apache.cxf.systest.jaxrs.Chapter]", 
+                      + "class org.apache.cxf.systest.jaxrs.BookStore]", 
                       "text/plain", "text/plain", 200);
     }
     
@@ -1593,17 +1593,17 @@ public class JAXRSClientServerBookTest e
     public void testUriInfoMatchedResourcesWithObject() throws Exception {
         getAndCompare("http://localhost:" + PORT + "/bookstore/"
                       + "booksubresource/123/chaptersobject/sub/1/matched-resources", 
-                      "[class org.apache.cxf.systest.jaxrs.BookStore, " 
+                      "[class org.apache.cxf.systest.jaxrs.Chapter, " 
                       + "class org.apache.cxf.systest.jaxrs.Book, "
-                      + "class org.apache.cxf.systest.jaxrs.Chapter]", 
+                      + "class org.apache.cxf.systest.jaxrs.BookStore]", 
                       "text/plain", "text/plain", 200);
     }
 
     @Test
     public void testUriInfoMatchedUrisDecode() throws Exception {
-        String expected = "[/bookstore/booksubresource/123/, "
+        String expected = "[/bookstore/booksubresource/123/chapters/sub/1/matched!uris, "
                           + "/bookstore/booksubresource/123/chapters/sub/1/, "
-                          + "/bookstore/booksubresource/123/chapters/sub/1/matched!uris]";
+                          + "/bookstore/booksubresource/123/]";
         getAndCompare("http://localhost:" + PORT + "/bookstore/"
                       + "booksubresource/123/chapters/sub/1/matched%21uris?decode=true",

                       expected, "text/plain", "text/plain", 200);
@@ -1612,9 +1612,9 @@ public class JAXRSClientServerBookTest e
     @Test
     public void testUriInfoMatchedUrisNoDecode() throws Exception {
         //note '%21' instead of '!'
-        String expected = "[/bookstore/booksubresource/123/, "
+        String expected = "[/bookstore/booksubresource/123/chapters/sub/1/matched%21uris,
"
             + "/bookstore/booksubresource/123/chapters/sub/1/, "
-            + "/bookstore/booksubresource/123/chapters/sub/1/matched%21uris]";
+            + "/bookstore/booksubresource/123/]";
         getAndCompare("http://localhost:" + PORT + "/bookstore/"
                       + "booksubresource/123/chapters/sub/1/matched%21uris?decode=false",

                       expected,



Mime
View raw message