Return-Path: Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: (qmail 55999 invoked from network); 25 Feb 2009 16:23:17 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 25 Feb 2009 16:23:17 -0000 Received: (qmail 74701 invoked by uid 500); 25 Feb 2009 16:23:16 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 74596 invoked by uid 500); 25 Feb 2009 16:23:16 -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 74587 invoked by uid 99); 25 Feb 2009 16:23:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 25 Feb 2009 08:23:16 -0800 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; Wed, 25 Feb 2009 16:23:14 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id D74962388962; Wed, 25 Feb 2009 16:22:52 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r747846 - in /cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs: SelectMethodCandidatesTest.java utils/JAXRSUtilsTest.java Date: Wed, 25 Feb 2009 16:22:52 -0000 To: commits@cxf.apache.org From: sergeyb@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20090225162252.D74962388962@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: sergeyb Date: Wed Feb 25 16:22:52 2009 New Revision: 747846 URL: http://svn.apache.org/viewvc?rev=747846&view=rev Log: JAXRS : fixing the hudson build failures Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java?rev=747846&r1=747845&r2=747846&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java (original) +++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java Wed Feb 25 16:22:52 2009 @@ -58,14 +58,14 @@ ori.getMethodToInvoke().getName()); - acceptContentTypes = "*/*"; + acceptContentTypes = "application/xml,application/json"; resource = JAXRSUtils.selectResourceClass(resources, "/1/2/3/d/1", values); ori = JAXRSUtils.findTargetMethod(resource, values.getFirst(URITemplate.FINAL_MATCH_GROUP), "GET", values, contentTypes, - Collections.singletonList(MediaType.valueOf(acceptContentTypes))); + JAXRSUtils.parseMediaTypes(acceptContentTypes)); assertNotNull(ori); - assertEquals("listMethod needs to be selected", "readMethod", + assertEquals("readMethod needs to be selected", "readMethod", ori.getMethodToInvoke().getName()); @@ -77,7 +77,7 @@ "GET", values, contentTypes, Collections.singletonList(MediaType.valueOf(acceptContentTypes))); assertNotNull(ori); - assertEquals("listMethod needs to be selected", "readMethod", + assertEquals("readMethod needs to be selected", "readMethod", ori.getMethodToInvoke().getName()); contentTypes = "application/json"; @@ -88,7 +88,7 @@ "GET", values, contentTypes, Collections.singletonList(MediaType.valueOf(acceptContentTypes))); assertNotNull(ori); - assertEquals("listMethod needs to be selected", "readMethod2", + assertEquals("readMethod2 needs to be selected", "readMethod2", ori.getMethodToInvoke().getName()); contentTypes = "application/json"; @@ -99,7 +99,7 @@ "GET", values, contentTypes, Collections.singletonList(MediaType.valueOf(acceptContentTypes))); assertNotNull(ori); - assertEquals("listMethod needs to be selected", "unlimitedPath", + assertEquals("unlimitedPath needs to be selected", "unlimitedPath", ori.getMethodToInvoke().getName()); resource = JAXRSUtils.selectResourceClass(resources, "/1/2/3/d/1/2", values); @@ -108,7 +108,7 @@ "GET", values, contentTypes, Collections.singletonList(MediaType.valueOf(acceptContentTypes))); assertNotNull(ori); - assertEquals("listMethod needs to be selected", "limitedPath", + assertEquals("limitedPath needs to be selected", "limitedPath", ori.getMethodToInvoke().getName()); } Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=747846&r1=747845&r2=747846&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java (original) +++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java Wed Feb 25 16:22:52 2009 @@ -156,7 +156,7 @@ //method is declared with a most specific ProduceMime type is selected. OperationResourceInfo ori = findTargetResourceClass(resources, null, "/bookstore/1/books/123/", "GET", new MetadataMap(), contentTypes, - getTypes("*/*")); + getTypes("application/json,application/xml")); assertNotNull(ori); assertEquals("getBookJSON", ori.getMethodToInvoke().getName()); @@ -788,11 +788,13 @@ assertSame(ori, ori1); ori = JAXRSUtils.findTargetMethod(cri, "/", "GET", new MetadataMap(), - "*/*", getTypes("*,text/plain,text/xml")); + "*/*", + JAXRSUtils.sortMediaTypes(getTypes("*,text/plain,text/xml"))); assertSame(ori, ori2); ori = JAXRSUtils.findTargetMethod(cri, "/", "GET", new MetadataMap(), - "*/*", getTypes("*,x/y,text/xml,text/plain")); + "*/*", + JAXRSUtils.sortMediaTypes(getTypes("*,text/plain, text/xml,x/y"))); assertSame(ori, ori2); }