cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
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 GMT
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<String, String>(), 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<String, String>(),

-                                          "*/*", getTypes("*,text/plain,text/xml"));
+                                          "*/*", 
+                                          JAXRSUtils.sortMediaTypes(getTypes("*,text/plain,text/xml")));
                      
         assertSame(ori, ori2);
         ori = JAXRSUtils.findTargetMethod(cri, "/", "GET", new MetadataMap<String, String>(),

-                                          "*/*", getTypes("*,x/y,text/xml,text/plain"));
+                                          "*/*", 
+                                          JAXRSUtils.sortMediaTypes(getTypes("*,text/plain,
text/xml,x/y")));
                      
         assertSame(ori, ori2);
     }



Mime
View raw message