cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r650660 - in /incubator/cxf/trunk/rt/frontend/jaxrs/src: main/java/org/apache/cxf/jaxrs/JAXRSUtils.java test/java/org/apache/cxf/jaxrs/JAXRSUtilsTest.java
Date Tue, 22 Apr 2008 21:16:52 GMT
Author: dkulp
Date: Tue Apr 22 14:16:49 2008
New Revision: 650660

URL: http://svn.apache.org/viewvc?rev=650660&view=rev
Log:
[CXF-1543] Fix issues with non-string query params not working. Patch from Sergey B. applied.

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

Modified: incubator/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSUtils.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSUtils.java?rev=650660&r1=650659&r2=650660&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSUtils.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSUtils.java
Tue Apr 22 14:16:49 2008
@@ -552,7 +552,7 @@
                                    "&",
                                    true).getFirst(queryName);
 
-        if (parameter.isPrimitive()) {
+        if (result != null) {
             return handleParameter(result, parameter);
         }
         return result;  

Modified: incubator/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/JAXRSUtilsTest.java?rev=650660&r1=650659&r2=650660&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/JAXRSUtilsTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/JAXRSUtilsTest.java
Tue Apr 22 14:16:49 2008
@@ -128,7 +128,9 @@
         @ProduceMime("text/xml")   
         public void testMultipleQuery(@QueryParam("query")  String queryString, 
                                       @QueryParam("query2") String queryString2,
-                                      @QueryParam("query3") String queryString3) {
+                                      @QueryParam("query3") Long queryString3,
+                                      @QueryParam("query4") boolean queryBoolean4,
+                                      @QueryParam("query5") String queryString4) {
             // complete
         }
         
@@ -497,11 +499,13 @@
     
     @Test
     public void testMultipleQueryParameters() throws Exception {
-        Class[] argType = {String.class, String.class, String.class};
+        Class[] argType = {String.class, String.class, Long.class, 
+                           Boolean.TYPE, String.class};
         Method m = Customer.class.getMethod("testMultipleQuery", argType);
         MessageImpl messageImpl = new MessageImpl();
         
-        messageImpl.put(Message.QUERY_STRING, "query=first&query2=second&query3");
+        messageImpl.put(Message.QUERY_STRING, 
+                        "query=first&query2=second&query3=3&query4=true&query5");
         List<Object> params = JAXRSUtils.processParameters(new OperationResourceInfo(m,
null), 
                                                            null, messageImpl);
         assertEquals("First Query Parameter of multiple was not matched correctly", "first",

@@ -509,7 +513,11 @@
         assertEquals("Second Query Parameter of multiple was not matched correctly", 
                      "second", params.get(1));
         assertEquals("Third Query Parameter of multiple was not matched correctly", 
-                     "", params.get(2));
+                     new Long(3), params.get(2));
+        assertEquals("Fourth Query Parameter of multiple was not matched correctly", 
+                     Boolean.TRUE, params.get(3));
+        assertEquals("Fourth Query Parameter of multiple was not matched correctly", 
+                     "", params.get(4));
     }
     
     @Test



Mime
View raw message