Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 2EAA975BA for ; Tue, 29 Nov 2011 11:46:33 +0000 (UTC) Received: (qmail 48275 invoked by uid 500); 29 Nov 2011 11:46:33 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 48215 invoked by uid 500); 29 Nov 2011 11:46:33 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 48208 invoked by uid 99); 29 Nov 2011 11:46:33 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Nov 2011 11:46:33 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 29 Nov 2011 11:46:31 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 7AA8223889CB for ; Tue, 29 Nov 2011 11:46:11 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1207837 - in /cxf/branches/2.3.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:46:11 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111129114611.7AA8223889CB@eris.apache.org> Author: sergeyb Date: Tue Nov 29 11:46:10 2011 New Revision: 1207837 URL: http://svn.apache.org/viewvc?rev=1207837&view=rev Log: Merged revisions 1207836 via svnmerge from https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes ................ r1207836 | sergeyb | 2011-11-29 11:45:02 +0000 (Tue, 29 Nov 2011) | 9 lines 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.3.x-fixes/ (props changed) cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Tue Nov 29 11:46:10 2011 @@ -1,2 +1,2 @@ -/cxf/branches/2.4.x-fixes:1207484 -/cxf/trunk:1207482 +/cxf/branches/2.4.x-fixes:1207484,1207836 +/cxf/trunk:1207482,1207835 Propchange: cxf/branches/2.3.x-fixes/ ------------------------------------------------------------------------------ Binary property 'svnmerge-integrated' - no diff available. Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java?rev=1207837&r1=1207836&r2=1207837&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java (original) +++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/impl/UriInfoImpl.java Tue Nov 29 11:46:10 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 getMatchedResources() { if (stack != null) { - List resources = new ArrayList(stack.size()); + List resources = new LinkedList(); 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 getMatchedURIs(boolean decode) { if (stack != null) { List objects = new ArrayList(); - List uris = new ArrayList(stack.size()); + List uris = new LinkedList(); 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.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java?rev=1207837&r1=1207836&r2=1207837&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java (original) +++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerBookTest.java Tue Nov 29 11:46:10 2011 @@ -1496,9 +1496,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); } @@ -1506,17 +1506,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); @@ -1525,9 +1525,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,