Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 44128 invoked from network); 11 Feb 2011 14:37:26 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 11 Feb 2011 14:37:26 -0000 Received: (qmail 72809 invoked by uid 500); 11 Feb 2011 14:37:26 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 72690 invoked by uid 500); 11 Feb 2011 14:37:23 -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 72683 invoked by uid 99); 11 Feb 2011 14:37:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 11 Feb 2011 14:37:22 +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; Fri, 11 Feb 2011 14:37:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 1462123889BF; Fri, 11 Feb 2011 14:37:01 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1069816 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ Date: Fri, 11 Feb 2011 14:37:00 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110211143701.1462123889BF@eris.apache.org> Author: sergeyb Date: Fri Feb 11 14:37:00 2011 New Revision: 1069816 URL: http://svn.apache.org/viewvc?rev=1069816&view=rev Log: Merged revisions 1069814 via svnmerge from https://svn.apache.org/repos/asf/cxf/trunk ........ r1069814 | sergeyb | 2011-02-11 14:33:00 +0000 (Fri, 11 Feb 2011) | 1 line [CXF-3330] Escaping literal pluses in URITemplate ........ 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/model/URITemplate.java cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.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 Fri Feb 11 14:37:00 2011 @@ -1 +1 @@ -/cxf/trunk:1068320,1068337,1068525,1068867,1068877,1069249,1069318,1069492,1069500,1069716,1069720 +/cxf/trunk:1068320,1068337,1068525,1068867,1068877,1069249,1069318,1069492,1069500,1069716,1069720,1069814 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/model/URITemplate.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java?rev=1069816&r1=1069815&r2=1069816&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java (original) +++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/model/URITemplate.java Fri Feb 11 14:37:00 2011 @@ -40,7 +40,7 @@ public final class URITemplate { public static final String LIMITED_REGEX_SUFFIX = "(/.*)?"; public static final String FINAL_MATCH_GROUP = "FINAL_MATCH_GROUP"; private static final String DEFAULT_PATH_VARIABLE_REGEX = "([^/]+?)"; - private static final String CHARACTERS_TO_ESCAPE = ".*"; + private static final String CHARACTERS_TO_ESCAPE = ".*+"; private final String template; private final List variables = new ArrayList(); Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java?rev=1069816&r1=1069815&r2=1069816&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java (original) +++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/model/URITemplateTest.java Fri Feb 11 14:37:00 2011 @@ -260,7 +260,45 @@ public class URITemplateTest extends Ass assertFalse(uriTemplate.match("/books/a", values)); assertFalse(uriTemplate.match("/books/ac", values)); } + + @Test + public void testValueWithLiteralPlus() throws Exception { + URITemplate uriTemplate = new URITemplate("/books/ab+"); + MultivaluedMap values = new MetadataMap(); + + assertTrue(uriTemplate.match("/books/ab+", values)); + assertFalse(uriTemplate.match("/books/abb", values)); + assertFalse(uriTemplate.match("/books/ab", values)); + assertFalse(uriTemplate.match("/books/a", values)); + } + + @Test + public void testValueWithManyLiteralPluses() throws Exception { + URITemplate uriTemplate = new URITemplate("/books/ab+++++"); + MultivaluedMap values = new MetadataMap(); + assertTrue(uriTemplate.match("/books/ab+++++", values)); + assertFalse(uriTemplate.match("/books/ab++++++", values)); + assertFalse(uriTemplate.match("/books/ab++++", values)); + assertFalse(uriTemplate.match("/books/ab+++", values)); + assertFalse(uriTemplate.match("/books/ab++", values)); + assertFalse(uriTemplate.match("/books/ab+", values)); + assertFalse(uriTemplate.match("/books/ab", values)); + assertFalse(uriTemplate.match("/books/a", values)); + } + + @Test + public void testValueWithRegExPlus() throws Exception { + URITemplate uriTemplate = new URITemplate("/books/{regex:ab+\\+}"); + MultivaluedMap values = new MetadataMap(); + + assertTrue(uriTemplate.match("/books/ab+", values)); + assertFalse(uriTemplate.match("/books/abb", values)); + assertFalse(uriTemplate.match("/books/abb", values)); + assertFalse(uriTemplate.match("/books/abc", values)); + assertFalse(uriTemplate.match("/books/a", values)); + } + @Test public void testEncodedSpace() throws Exception { URITemplate uriTemplate = new URITemplate("/1 2/%203"); Modified: cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java?rev=1069816&r1=1069815&r2=1069816&view=diff ============================================================================== --- cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java (original) +++ cxf/branches/2.3.x-fixes/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStore.java Fri Feb 11 14:37:00 2011 @@ -162,6 +162,13 @@ public class BookStore { } @GET + @Path("name-in-query") + @Produces("application/xml") + public Book getBookFromQuery(@QueryParam("name") String name) { + return new Book(name, 321L); + } + + @GET @Path("propagate-exception2") public Book propogateException2() throws BookNotFoundFault { PhaseInterceptorChain.getCurrentMessage().put("org.apache.cxf.propagate.exception", Boolean.FALSE); 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=1069816&r1=1069815&r2=1069816&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 Fri Feb 11 14:37:00 2011 @@ -67,6 +67,18 @@ public class JAXRSClientServerBookTest e } @Test + public void testGetBookWithNameInQuery() throws Exception { + + String endpointAddress = + "http://localhost:" + PORT + "/bookstore/name-in-query"; + WebClient wc = WebClient.create(endpointAddress); + String name = "Many spaces"; + wc.query("name", name); + Book b = wc.get(Book.class); + assertEquals(name, b.getName()); + } + + @Test public void testPostAnd401WithText() throws Exception { String endpointAddress =