cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1468399 - in /cxf/branches/2.7.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ rt/fron...
Date Tue, 16 Apr 2013 12:55:57 GMT
Author: sergeyb
Date: Tue Apr 16 12:55:56 2013
New Revision: 1468399

URL: http://svn.apache.org/r1468399
Log:
Merged revisions 1466845,1467773,1467927 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1466845 | sergeyb | 2013-04-11 13:28:53 +0100 (Thu, 11 Apr 2013) | 1 line
  
  [CXF-4950] Removing few JAXRSUtils shortcut methods to avoid the unexpected results
........
  r1467773 | ashakirin | 2013-04-14 13:18:35 +0100 (Sun, 14 Apr 2013) | 1 line
  
  [CXF-4950] Added producesResource test scenarios: multi q; multi qs; concrete types and
wildcards
........
  r1467927 | sergeyb | 2013-04-15 11:16:09 +0100 (Mon, 15 Apr 2013) | 1 line
  
  [CXF-4950] Some follow up updates based on the analysis from Andrei
........

Modified:
    cxf/branches/2.7.x-fixes/   (props changed)
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
    cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
  Merged /cxf/trunk:r1466845,1467773-1467927

Propchange: cxf/branches/2.7.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java?rev=1468399&r1=1468398&r2=1468399&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/interceptor/JAXRSInInterceptor.java
Tue Apr 16 12:55:56 2013
@@ -146,7 +146,7 @@ public class JAXRSInInterceptor extends 
         }
         List<MediaType> acceptContentTypes = null;
         try {
-            acceptContentTypes = JAXRSUtils.sortMediaTypes(acceptTypes);
+            acceptContentTypes = JAXRSUtils.sortMediaTypes(acceptTypes, JAXRSUtils.MEDIA_TYPE_Q_PARAM);
         } catch (IllegalArgumentException ex) {
             throw new NotAcceptableException();
         }

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java?rev=1468399&r1=1468398&r2=1468399&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/provider/ProviderFactory.java
Tue Apr 16 12:55:56 2013
@@ -1062,11 +1062,11 @@ public final class ProviderFactory {
             MessageBodyReader<?> e1 = p1.getProvider();
             MessageBodyReader<?> e2 = p2.getProvider();
             List<MediaType> types1 = JAXRSUtils.getProviderConsumeTypes(e1);
-            types1 = JAXRSUtils.sortMediaTypes(types1);
+            types1 = JAXRSUtils.sortMediaTypes(types1, null);
             List<MediaType> types2 = JAXRSUtils.getProviderConsumeTypes(e2);
-            types2 = JAXRSUtils.sortMediaTypes(types2);
+            types2 = JAXRSUtils.sortMediaTypes(types2, null);
     
-            return JAXRSUtils.compareSortedMediaTypes(types1, types2);
+            return JAXRSUtils.compareSortedMediaTypes(types1, types2, null);
         }
     }
     
@@ -1079,11 +1079,11 @@ public final class ProviderFactory {
             MessageBodyWriter<?> e2 = p2.getProvider();
             
             List<MediaType> types1 =
-                JAXRSUtils.sortMediaTypes(JAXRSUtils.getProviderProduceTypes(e1));
+                JAXRSUtils.sortMediaTypes(JAXRSUtils.getProviderProduceTypes(e1), JAXRSUtils.MEDIA_TYPE_QS_PARAM);
             List<MediaType> types2 =
-                JAXRSUtils.sortMediaTypes(JAXRSUtils.getProviderProduceTypes(e2));
+                JAXRSUtils.sortMediaTypes(JAXRSUtils.getProviderProduceTypes(e2), JAXRSUtils.MEDIA_TYPE_QS_PARAM);
     
-            return JAXRSUtils.compareSortedMediaTypes(types1, types2);
+            return JAXRSUtils.compareSortedMediaTypes(types1, types2, JAXRSUtils.MEDIA_TYPE_QS_PARAM);
         }
     }
     
@@ -1097,12 +1097,12 @@ public final class ProviderFactory {
             
             List<MediaType> types1 =
                 JAXRSUtils.sortMediaTypes(JAXRSUtils.getProduceTypes(
-                                               e1.getClass().getAnnotation(Produces.class)));
+                     e1.getClass().getAnnotation(Produces.class)), JAXRSUtils.MEDIA_TYPE_QS_PARAM);
             List<MediaType> types2 =
                 JAXRSUtils.sortMediaTypes(JAXRSUtils.getProduceTypes(
-                                               e2.getClass().getAnnotation(Produces.class)));
+                     e2.getClass().getAnnotation(Produces.class)), JAXRSUtils.MEDIA_TYPE_QS_PARAM);
     
-            return JAXRSUtils.compareSortedMediaTypes(types1, types2);
+            return JAXRSUtils.compareSortedMediaTypes(types1, types2, JAXRSUtils.MEDIA_TYPE_QS_PARAM);
         }
     }
     

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=1468399&r1=1468398&r2=1468399&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
Tue Apr 16 12:55:56 2013
@@ -509,7 +509,11 @@ public final class JAXRSUtils {
             Collections.sort(all, new Comparator<MediaType>() {
 
                 public int compare(MediaType mt1, MediaType mt2) {
-                    return compareQualityAndDistance(mt1, mt2, checkDistance);
+                    int result = compareMediaTypes(mt1, mt2, null);
+                    if (result == 0) {
+                        result = compareQualityAndDistance(mt1, mt2, checkDistance);
+                    }
+                    return result;
                 }
                 
             });    
@@ -617,7 +621,10 @@ public final class JAXRSUtils {
         int size1 = mts1.size();
         int size2 = mts2.size();
         for (int i = 0; i < size1 && i < size2; i++) {
-            int result = compareQualityAndDistance(actualMts1.get(i), actualMts2.get(i),
true);
+            int result = compareMediaTypes(actualMts1.get(i), actualMts2.get(i), null);
+            if (result == 0) {
+                result = compareQualityAndDistance(actualMts1.get(i), actualMts2.get(i),
true);
+            }
             if (result != 0) {
                 return result;
             }
@@ -640,10 +647,6 @@ public final class JAXRSUtils {
         return actualMts;
     }
     
-    public static int compareSortedMediaTypes(List<MediaType> mts1, List<MediaType>
mts2) {
-        return compareSortedMediaTypes(mts1, mts2, MEDIA_TYPE_Q_PARAM);
-    }
-    
     public static int compareSortedMediaTypes(List<MediaType> mts1, List<MediaType>
mts2, String qs) {
         int size1 = mts1.size();
         int size2 = mts2.size();
@@ -1482,16 +1485,9 @@ public final class JAXRSUtils {
                                   false);
     }
     
-    public static List<MediaType> sortMediaTypes(String mediaTypes) {
-        return sortMediaTypes(JAXRSUtils.parseMediaTypes(mediaTypes));
-    }
-    
     public static List<MediaType> sortMediaTypes(String mediaTypes, String qs) {
         return sortMediaTypes(JAXRSUtils.parseMediaTypes(mediaTypes), qs);
     }
-    public static List<MediaType> sortMediaTypes(List<MediaType> types) {
-        return sortMediaTypes(types, MEDIA_TYPE_Q_PARAM);
-    }
     public static List<MediaType> sortMediaTypes(List<MediaType> types, final
String qs) {
         if (types.size() > 1) {
             Collections.sort(types, new Comparator<MediaType>() {

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java?rev=1468399&r1=1468398&r2=1468399&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
Tue Apr 16 12:55:56 2013
@@ -51,7 +51,6 @@ import org.apache.cxf.message.ExchangeIm
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.easymock.EasyMock;
-
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -116,7 +115,7 @@ public class SelectMethodCandidatesTest 
         OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
                                                                 m, 
                                     "POST", values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes),
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
                                     true);
         assertNotNull(ori);
         assertEquals("resourceMethod needs to be selected", "postEntity",
@@ -168,7 +167,7 @@ public class SelectMethodCandidatesTest 
         OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
                                                                 m, 
                                     "PUT", values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes),
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
                                     true);
         assertNotNull(ori);
         assertEquals("resourceMethod needs to be selected", "putEntity",
@@ -238,7 +237,7 @@ public class SelectMethodCandidatesTest 
         OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
                                                                 m, 
                                     "POST", values, contentType, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes),
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
                                     true);
         assertNotNull(ori);
         assertEquals(expectedMethodName,  ori.getMethodToInvoke().getName());
@@ -325,6 +324,48 @@ public class SelectMethodCandidatesTest 
                                "application/xml", "m2");
     }
     
+    @Test
+    public void testProducesResource5() throws Exception {
+        doTestProducesResource(ProducesResource2.class, "/", 
+                               "application/xml;q=0.3,application/json;q=0.5", 
+                               "application/json", "m1");
+    }
+
+    @Test
+    public void testProducesResource6() throws Exception {
+        doTestProducesResource(ProducesResource3.class, "/", 
+                               "application/xml,application/json", 
+                               "application/xml", "m2");
+    }
+
+    @Test
+    public void testProducesResource7() throws Exception {
+        doTestProducesResource(ProducesResource4.class, "/", 
+                               "application/xml,", 
+                               "application/xml", "m1");
+    }
+
+    @Test
+    public void testProducesResource8() throws Exception {
+        doTestProducesResource(ProducesResource5.class, "/", 
+                               "application/*,text/html", 
+                               "text/html", "m1");
+    }
+
+    @Test
+    public void testProducesResource9() throws Exception {
+        doTestProducesResource(ProducesResource5.class, "/", 
+                               "application/*,text/html;q=0.3", 
+                               "text/html", "m1");
+    }
+
+    @Test
+    public void testProducesResource10() throws Exception {
+        doTestProducesResource(ProducesResource6.class, "/", 
+                               "application/*,text/html", 
+                               "text/html", "m1");
+    }
+
     private void doTestProducesResource(Class<?> resourceClass, 
                                         String path,
                                         String acceptContentTypes,
@@ -361,7 +402,8 @@ public class SelectMethodCandidatesTest 
      
         OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, m, "GET", 
                                                 values, contentType, 
-                                                JAXRSUtils.sortMediaTypes(acceptContentTypes),
true);
+                                                JAXRSUtils.sortMediaTypes(acceptContentTypes,
"q"),
+                                                true);
 
         assertNotNull(ori);
         assertEquals(expectedMethodName,  ori.getMethodToInvoke().getName());
@@ -401,7 +443,7 @@ public class SelectMethodCandidatesTest 
         OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
                                                                 m, 
                                     methodName, values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes),
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
                                     true);
         assertNotNull(ori);
         assertEquals("resourceMethod needs to be selected", methodName.toLowerCase() + "Entity",
@@ -451,7 +493,8 @@ public class SelectMethodCandidatesTest 
         OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
                                     createMessage(), 
                                     "GET", values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes), true);
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
+                                    true);
         assertNotNull(ori);
         assertEquals("resourceMethod needs to be selected", method,
                      ori.getMethodToInvoke().getName());
@@ -472,7 +515,8 @@ public class SelectMethodCandidatesTest 
         OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
                                     createMessage(), 
                                     "GET", values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes), true);
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
+                                    true);
         assertNotNull(ori);
         assertEquals("jsonResource needs to be selected", "jsonResource",
                      ori.getMethodToInvoke().getName());
@@ -580,7 +624,8 @@ public class SelectMethodCandidatesTest 
         OperationResourceInfo ori = JAXRSUtils.findTargetMethod(resource, 
                                     createMessage(), 
                                     "GET", values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes), true);
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
+                                    true);
         assertNotNull(ori);
         assertEquals("readBar", ori.getMethodToInvoke().getName());
         acceptContentTypes = "application/foo,application/bar;q=0.8";
@@ -588,7 +633,8 @@ public class SelectMethodCandidatesTest 
         ori = JAXRSUtils.findTargetMethod(resource, 
                                     createMessage(), 
                                     "GET", values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes), true);
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
+                                    true);
         assertNotNull(ori);
         assertEquals("readFoo", ori.getMethodToInvoke().getName());
         
@@ -597,7 +643,8 @@ public class SelectMethodCandidatesTest 
         ori = JAXRSUtils.findTargetMethod(resource, 
                                     createMessage(), 
                                     "GET", values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes), true);
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
+                                    true);
         assertNotNull(ori);
         assertEquals("readBar", ori.getMethodToInvoke().getName());
         
@@ -606,7 +653,8 @@ public class SelectMethodCandidatesTest 
         ori = JAXRSUtils.findTargetMethod(resource, 
                                     createMessage(), 
                                     "GET", values, contentTypes, 
-                                    JAXRSUtils.sortMediaTypes(acceptContentTypes), true);
+                                    JAXRSUtils.sortMediaTypes(acceptContentTypes, "q"),
+                                    true);
         assertNotNull(ori);
         assertEquals("readFoo", ori.getMethodToInvoke().getName());
         
@@ -737,4 +785,56 @@ public class SelectMethodCandidatesTest 
             return null;
         }
     }
+
+    public static class ProducesResource3 {
+        @GET
+        @Produces({"application/json;qs=0.2" })
+        public Response m1() {
+            return null;
+        }
+        @GET
+        @Produces({"application/xml;qs=0.9" })
+        public Response m2() {
+            return null;
+        }
+    }
+
+    public static class ProducesResource4 {
+        @GET
+        @Produces({"application/*" })
+        public Response m1() {
+            return null;
+        }
+        @GET
+        @Produces({"application/xml;qs=0.9" })
+        public Response m2() {
+            return null;
+        }
+    }
+
+    public static class ProducesResource5 {
+        @GET
+        @Produces({"text/*" })
+        public Response m1() {
+            return null;
+        }
+        @GET
+        @Produces({"application/*" })
+        public Response m2() {
+            return null;
+        }
+    }
+
+    public static class ProducesResource6 {
+        @GET
+        @Produces({"text/*;qs=0.9" })
+        public Response m1() {
+            return null;
+        }
+        @GET
+        @Produces({"application/*" })
+        public Response m2() {
+            return null;
+        }
+    }
 }

Modified: cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=1468399&r1=1468398&r2=1468399&view=diff
==============================================================================
--- cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
(original)
+++ cxf/branches/2.7.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
Tue Apr 16 12:55:56 2013
@@ -626,10 +626,22 @@ public class JAXRSUtilsTest extends Asse
         
     }
     
+    private static List<MediaType> sortMediaTypes(String mediaTypes) {
+        return JAXRSUtils.sortMediaTypes(mediaTypes, JAXRSUtils.MEDIA_TYPE_Q_PARAM);
+    }
+    
+    private static List<MediaType> sortMediaTypes(List<MediaType> mediaTypes)
{
+        return JAXRSUtils.sortMediaTypes(mediaTypes, JAXRSUtils.MEDIA_TYPE_Q_PARAM);
+    }
+    
+    private static int compareSortedMediaTypes(List<MediaType> mt1, List<MediaType>
mt2) {
+        return JAXRSUtils.compareSortedMediaTypes(mt1, mt2, JAXRSUtils.MEDIA_TYPE_Q_PARAM);
+    }
+    
     @Test
     public void testSortMediaTypes() throws Exception {
         List<MediaType> types = 
-            JAXRSUtils.sortMediaTypes("text/*,text/plain;q=.2,text/xml,TEXT/BAR");
+            sortMediaTypes("text/*,text/plain;q=.2,text/xml,TEXT/BAR");
         assertTrue(types.size() == 4
                    && "text/xml".equals(types.get(0).toString())
                    && "text/bar".equals(types.get(1).toString())
@@ -679,14 +691,14 @@ public class JAXRSUtilsTest extends Asse
         MediaType m1 = MediaType.valueOf("text/xml");
         MediaType m2 = MediaType.valueOf("text/*");
         assertTrue("text/xml is more specific than text/*", 
-                   JAXRSUtils.compareSortedMediaTypes(Collections.singletonList(m1), 
+                   compareSortedMediaTypes(Collections.singletonList(m1), 
                                                       Collections.singletonList(m2)) <
0);
         assertTrue("text/* is less specific than text/xml", 
-                   JAXRSUtils.compareSortedMediaTypes(Collections.singletonList(m2), 
+                   compareSortedMediaTypes(Collections.singletonList(m2), 
                                                       Collections.singletonList(m1)) >
0);
         
         assertTrue("text/xml is the same as text/xml", 
-                   JAXRSUtils.compareSortedMediaTypes(Collections.singletonList(m1), 
+                   compareSortedMediaTypes(Collections.singletonList(m1), 
                                                       Collections.singletonList(m1)) == 0);
         
         List<MediaType> sortedList1 = new ArrayList<MediaType>();
@@ -698,14 +710,14 @@ public class JAXRSUtilsTest extends Asse
         sortedList2.add(m2);
         
         assertTrue("lists should be equal", 
-                   JAXRSUtils.compareSortedMediaTypes(sortedList1, sortedList2) == 0);
+                   compareSortedMediaTypes(sortedList1, sortedList2) == 0);
         
         sortedList1.add(MediaType.WILDCARD_TYPE);
         assertTrue("first list should be less specific", 
-                   JAXRSUtils.compareSortedMediaTypes(sortedList1, sortedList2) > 0);
+                   compareSortedMediaTypes(sortedList1, sortedList2) > 0);
         sortedList1.add(MediaType.WILDCARD_TYPE);
         assertTrue("second list should be more specific", 
-                   JAXRSUtils.compareSortedMediaTypes(sortedList2, sortedList1) < 0);
+                   compareSortedMediaTypes(sortedList2, sortedList1) < 0);
     }
     
     @Test
@@ -1500,13 +1512,15 @@ public class JAXRSUtilsTest extends Asse
         
         ori = JAXRSUtils.findTargetMethod(cri, createMessage2(), "GET", new MetadataMap<String,
String>(), 
                                           "*/*", 
-                                          JAXRSUtils.sortMediaTypes(getTypes("*/*;q=0.1,text/plain,text/xml;q=0.8")),
+                                          JAXRSUtils.sortMediaTypes(
+                getTypes("*/*;q=0.1,text/plain,text/xml;q=0.8"), "q"),
             true);
                      
         assertSame(ori, ori2);
         ori = JAXRSUtils.findTargetMethod(cri, createMessage2(), "GET", new MetadataMap<String,
String>(), 
                                           "*/*", 
-                                          JAXRSUtils.sortMediaTypes(getTypes("*;q=0.1,text/plain,text/xml;q=0.9,x/y")),

+                                          JAXRSUtils.sortMediaTypes(
+                getTypes("*;q=0.1,text/plain,text/xml;q=0.9,x/y"), "q"), 
             true);
                      
         assertSame(ori, ori2);



Mime
View raw message