Return-Path: Delivered-To: apmail-incubator-chemistry-commits-archive@minotaur.apache.org Received: (qmail 81351 invoked from network); 22 Jun 2009 13:26:29 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 22 Jun 2009 13:26:29 -0000 Received: (qmail 68767 invoked by uid 500); 22 Jun 2009 13:26:40 -0000 Delivered-To: apmail-incubator-chemistry-commits-archive@incubator.apache.org Received: (qmail 68739 invoked by uid 500); 22 Jun 2009 13:26:40 -0000 Mailing-List: contact chemistry-commits-help@incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: chemistry-dev@incubator.apache.org Delivered-To: mailing list chemistry-commits@incubator.apache.org Received: (qmail 68729 invoked by uid 99); 22 Jun 2009 13:26:40 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 22 Jun 2009 13:26:40 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.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; Mon, 22 Jun 2009 13:26:29 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 6CE932388873; Mon, 22 Jun 2009 13:26:08 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r787232 - in /incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src: main/java/org/apache/chemistry/atompub/server/jaxrs/ test/java/org/apache/chemistry/atompub/server/ test/resources/jaxrs/ Date: Mon, 22 Jun 2009 13:26:08 -0000 To: chemistry-commits@incubator.apache.org From: fguillaume@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090622132608.6CE932388873@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: fguillaume Date: Mon Jun 22 13:26:07 2009 New Revision: 787232 URL: http://svn.apache.org/viewvc?rev=787232&view=rev Log: Put explicit @Path("cmis") on the JAX-RS Resource, tests Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/TestAtomPubJaxrs.java incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/resources/jaxrs/web.xml Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java?rev=787232&r1=787231&r2=787232&view=diff ============================================================================== --- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java (original) +++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/main/java/org/apache/chemistry/atompub/server/jaxrs/AbderaResource.java Mon Jun 22 13:26:07 2009 @@ -43,10 +43,8 @@ /** * A JAX-RS Resource that dispatches to the underlying Abdera * {@link CMISProvider}. - *

- * In some contexts (Nuxeo WebEngine), the path of this resource is injected by - * the framework, so no @Path annotation must be specified. */ +@Path("cmis") public class AbderaResource { private static final Log log = LogFactory.getLog(AbderaResource.class); @@ -78,6 +76,10 @@ *

* Wrapping is needed to fixup the servlet path to take include this * Resource's path. + *

+ * We need to pass an explicit number of segments because + * UriInfo.getMatchedURIs is buggy for RESTEasy + * (https://jira.jboss.org/jira/browse/RESTEASY-100) * * @param segments the number of segments of the method invoking this, used * to determine the Resource path Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java?rev=787232&r1=787231&r2=787232&view=diff ============================================================================== --- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java (original) +++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/AtomPubServerTestCase.java Mon Jun 22 13:26:07 2009 @@ -67,7 +67,12 @@ protected static final String CONTEXT_PATH = "/ctx"; // also in web.xml for JAX-RS - protected static final String SERVLET_PATH = "/cmis"; + protected static final String SERVLET_PATH = "/srv"; + + // additional path to use after the servlet, used by JAX-RS + protected String getResourcePath() { + return ""; + } @Override public void setUp() throws Exception { @@ -148,7 +153,7 @@ } public void testConnect() throws Exception { - String base = "http://localhost:" + PORT + CONTEXT_PATH + SERVLET_PATH; + String base = "http://localhost:" + PORT + CONTEXT_PATH + SERVLET_PATH + getResourcePath(); ClientResponse resp; resp = client.get(base + "/repository"); Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/TestAtomPubJaxrs.java URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/TestAtomPubJaxrs.java?rev=787232&r1=787231&r2=787232&view=diff ============================================================================== --- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/TestAtomPubJaxrs.java (original) +++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/java/org/apache/chemistry/atompub/server/TestAtomPubJaxrs.java Mon Jun 22 13:26:07 2009 @@ -22,6 +22,8 @@ import java.io.InputStream; import java.io.OutputStream; +import javax.ws.rs.Path; + import org.apache.chemistry.atompub.server.jaxrs.AbderaResource; import org.apache.cxf.helpers.FileUtils; import org.apache.cxf.helpers.IOUtils; @@ -36,6 +38,19 @@ private File tmpDir; @Override + protected String getResourcePath() { + Path pa = AbderaResource.class.getAnnotation(Path.class); + if (pa == null) { + return ""; + } + String path = pa.value(); + if (!path.startsWith("/")) { + path = '/' + path; + } + return path; + } + + @Override public void startServer() throws Exception { AbderaResource.repository = repository; // TODO inject differently server = new Server(PORT); Modified: incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/resources/jaxrs/web.xml URL: http://svn.apache.org/viewvc/incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/resources/jaxrs/web.xml?rev=787232&r1=787231&r2=787232&view=diff ============================================================================== --- incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/resources/jaxrs/web.xml (original) +++ incubator/chemistry/trunk/chemistry/chemistry-atompub-server/src/test/resources/jaxrs/web.xml Mon Jun 22 13:26:07 2009 @@ -14,6 +14,6 @@ cxfjaxrs - /cmis/* + /srv/*