cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1467927 - in /cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
Date Mon, 15 Apr 2013 10:16:09 GMT
Author: sergeyb
Date: Mon Apr 15 10:16:09 2013
New Revision: 1467927

URL: http://svn.apache.org/r1467927
Log:
[CXF-4950] Some follow up updates based on the analysis from Andrei

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java

Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java?rev=1467927&r1=1467926&r2=1467927&view=diff
==============================================================================
--- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java (original)
+++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/JAXRSUtils.java Mon
Apr 15 10:16:09 2013
@@ -544,7 +544,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;
                 }
                 
             });    
@@ -666,7 +670,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;
             }

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=1467927&r1=1467926&r2=1467927&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
Mon Apr 15 10:16:09 2013
@@ -56,7 +56,6 @@ import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.easymock.EasyMock;
 import org.junit.Assert;
-import org.junit.Ignore;
 import org.junit.Test;
 
 public class SelectMethodCandidatesTest extends Assert {
@@ -350,7 +349,6 @@ public class SelectMethodCandidatesTest 
     }
 
     @Test
-    @Ignore
     public void testProducesResource8() throws Exception {
         doTestProducesResource(ProducesResource5.class, "/", 
                                "application/*,text/html", 
@@ -361,14 +359,14 @@ public class SelectMethodCandidatesTest 
     public void testProducesResource9() throws Exception {
         doTestProducesResource(ProducesResource5.class, "/", 
                                "application/*,text/html;q=0.3", 
-                               "application/*", "m2");
+                               "text/html", "m1");
     }
 
     @Test
     public void testProducesResource10() throws Exception {
         doTestProducesResource(ProducesResource6.class, "/", 
                                "application/*,text/html", 
-                               "application/*", "m2");
+                               "text/html", "m1");
     }
 
     private void doTestProducesResource(Class<?> resourceClass, 



Mime
View raw message