cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject svn commit: r1467773 - /cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.java
Date Sun, 14 Apr 2013 12:18:36 GMT
Author: ashakirin
Date: Sun Apr 14 12:18:35 2013
New Revision: 1467773

URL: http://svn.apache.org/r1467773
Log:
[CXF-4950] Added producesResource test scenarios: multi q; multi qs; concrete types and wildcards

Modified:
    cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/SelectMethodCandidatesTest.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=1467773&r1=1467772&r2=1467773&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
Sun Apr 14 12:18:35 2013
@@ -55,8 +55,8 @@ 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.Ignore;
 import org.junit.Test;
 
 public class SelectMethodCandidatesTest extends Assert {
@@ -328,6 +328,49 @@ 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
+    @Ignore
+    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", 
+                               "application/*", "m2");
+    }
+
+    @Test
+    public void testProducesResource10() throws Exception {
+        doTestProducesResource(ProducesResource6.class, "/", 
+                               "application/*,text/html", 
+                               "application/*", "m2");
+    }
+
     private void doTestProducesResource(Class<?> resourceClass, 
                                         String path,
                                         String acceptContentTypes,
@@ -849,4 +892,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;
+        }
+    }
 }



Mime
View raw message