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 BFC2D72BE for ; Thu, 29 Dec 2011 14:17:50 +0000 (UTC) Received: (qmail 41292 invoked by uid 500); 29 Dec 2011 14:17:50 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 41244 invoked by uid 500); 29 Dec 2011 14:17:50 -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 41237 invoked by uid 99); 29 Dec 2011 14:17:50 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 29 Dec 2011 14:17:50 +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; Thu, 29 Dec 2011 14:17:49 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 9342523889D7 for ; Thu, 29 Dec 2011 14:17:28 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1225538 - in /cxf/trunk/systests/jaxrs/src/test: java/org/apache/cxf/systest/jaxrs/BookStoreSimple.java java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java resources/jaxrs_spring/WEB-INF/beans.xml Date: Thu, 29 Dec 2011 14:17:28 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8-patched Message-Id: <20111229141728.9342523889D7@eris.apache.org> Author: sergeyb Date: Thu Dec 29 14:17:28 2011 New Revision: 1225538 URL: http://svn.apache.org/viewvc?rev=1225538&view=rev Log: Adding some more tests with URIs containing matrix params Added: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSimple.java (with props) Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_spring/WEB-INF/beans.xml Added: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSimple.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSimple.java?rev=1225538&view=auto ============================================================================== --- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSimple.java (added) +++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSimple.java Thu Dec 29 14:17:28 2011 @@ -0,0 +1,37 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.apache.cxf.systest.jaxrs; + +import javax.ws.rs.GET; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; + +@Path("/simplebooks/{id}") +public class BookStoreSimple { + @GET + public Book getBook(@PathParam("id") long id) { + return new Book("Simple", id); + } + + @GET + @Path("/book") + public Book getBook2(@PathParam("id") long id) { + return getBook(id); + } +} Propchange: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSimple.java ------------------------------------------------------------------------------ svn:eol-style = native Propchange: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/BookStoreSimple.java ------------------------------------------------------------------------------ svn:keywords = Rev Date Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java?rev=1225538&r1=1225537&r2=1225538&view=diff ============================================================================== --- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java (original) +++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringBookTest.java Thu Dec 29 14:17:28 2011 @@ -25,6 +25,7 @@ import java.net.URLConnection; import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.io.CachedOutputStream; +import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; import org.junit.BeforeClass; import org.junit.Test; @@ -39,10 +40,34 @@ public class JAXRSClientServerResourceCr } @Test + public void testGetBookSimple() throws Exception { + + String address = + "http://localhost:" + PORT + "/webapp/rest/simplebooks/444"; + assertEquals(444L, WebClient.create(address).get(Book.class).getId()); + } + + @Test + public void testGetBookSimpleMatrixEnd() throws Exception { + + String address = + "http://localhost:" + PORT + "/webapp/rest/simplebooks/444;bookId=ssn"; + assertEquals(444L, WebClient.create(address).get(Book.class).getId()); + } + + @Test + public void testGetBookSimpleMatrixMiddle() throws Exception { + + String address = + "http://localhost:" + PORT + "/webapp/rest/simplebooks/444;bookId=ssn/book"; + assertEquals(444L, WebClient.create(address).get(Book.class).getId()); + } + + @Test public void testGetBook123() throws Exception { String endpointAddress = - "http://localhost:" + PORT + "/webapp/bookstore/books/123"; + "http://localhost:" + PORT + "/webapp/rest/bookstore/books/123"; URL url = new URL(endpointAddress); URLConnection connect = url.openConnection(); connect.addRequestProperty("Accept", "application/xml"); @@ -59,7 +84,7 @@ public class JAXRSClientServerResourceCr public void testPetStore() throws Exception { String endpointAddress = - "http://localhost:" + PORT + "/webapp/petstore/pets/24"; + "http://localhost:" + PORT + "/webapp/rest/petstore/pets/24"; URL url = new URL(endpointAddress); URLConnection connect = url.openConnection(); connect.addRequestProperty("Accept", "text/xml"); Modified: cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_spring/WEB-INF/beans.xml URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_spring/WEB-INF/beans.xml?rev=1225538&r1=1225537&r2=1225538&view=diff ============================================================================== --- cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_spring/WEB-INF/beans.xml (original) +++ cxf/trunk/systests/jaxrs/src/test/resources/jaxrs_spring/WEB-INF/beans.xml Thu Dec 29 14:17:28 2011 @@ -17,13 +17,6 @@ specific language governing permissions and limitations under the License. --> - - + address="/rest"> + - - - - + + + - +