cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From serg...@apache.org
Subject svn commit: r1177284 - in /cxf/branches/2.3.x-fixes: ./ rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/ rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/
Date Thu, 29 Sep 2011 12:30:53 GMT
Author: sergeyb
Date: Thu Sep 29 12:30:52 2011
New Revision: 1177284

URL: http://svn.apache.org/viewvc?rev=1177284&view=rev
Log:
Merged revisions 1177283 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/branches/2.4.x-fixes

................
  r1177283 | sergeyb | 2011-09-29 13:27:53 +0100 (Thu, 29 Sep 2011) | 9 lines
  
  Merged revisions 1177282 via svnmerge from 
  https://svn.apache.org/repos/asf/cxf/trunk
  
  ........
    r1177282 | sergeyb | 2011-09-29 13:25:53 +0100 (Thu, 29 Sep 2011) | 1 line
    
    [CXF-3834] Minor fix to get arrays supported
  ........
................

Modified:
    cxf/branches/2.3.x-fixes/   (props changed)
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
    cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java

Propchange: cxf/branches/2.3.x-fixes/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Sep 29 12:30:52 2011
@@ -1,2 +1,2 @@
-/cxf/branches/2.4.x-fixes:1172584,1173057,1173766,1174040,1174408,1175846,1175943,1175953,1176842,1176859,1177165
-/cxf/trunk:1172522,1173027,1173997-1173998,1174404,1175747-1175780,1175939,1175951,1176840,1176856,1177164
+/cxf/branches/2.4.x-fixes:1172584,1173057,1173766,1174040,1174408,1175846,1175943,1175953,1176842,1176859,1177165,1177283
+/cxf/trunk:1172522,1173027,1173997-1173998,1174404,1175747-1175780,1175939,1175951,1176840,1176856,1177164,1177282

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

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java?rev=1177284&r1=1177283&r2=1177284&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/InjectionUtils.java
Thu Sep 29 12:30:52 2011
@@ -650,7 +650,8 @@ public final class InjectionUtils {
      //CHECKSTYLE:ON    
         Class<?> type = getCollectionType(rawType);
 
-        Class<?> realType = InjectionUtils.getActualType(genericType);
+        Class<?> realType = rawType.isArray() ? rawType.getComponentType() 
+                : InjectionUtils.getActualType(genericType);
         
         Object theValues = null;
         if (type != null) {

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java?rev=1177284&r1=1177283&r2=1177284&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/Customer.java
Thu Sep 29 12:30:52 2011
@@ -328,8 +328,10 @@ public class Customer extends AbstractCu
     public void testQueryAsList(
         @DefaultValue("default") @QueryParam("query") List<String> queryString,
         @QueryParam("query2") List<String> queryString2,
-        @QueryParam("query3") List<String> queryString3,
-        @QueryParam("query4") List<String> queryString4) {
+        @QueryParam("query3") List<Integer> queryString3,
+        @QueryParam("query3") Integer[] queryString3Array,
+        @QueryParam("query4") List<String> queryString4,
+        @QueryParam("query5") List<String> queryString5) {
         // complete
     }
     

Modified: cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=1177284&r1=1177283&r2=1177284&view=diff
==============================================================================
--- cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
(original)
+++ cxf/branches/2.3.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
Thu Sep 29 12:30:52 2011
@@ -673,14 +673,16 @@ public class JAXRSUtilsTest extends Asse
     @SuppressWarnings("unchecked")
     @Test
     public void testQueryParamAsListWithDefaultValue() throws Exception {
-        Class[] argType = {List.class, List.class, List.class, List.class};
+        Class[] argType = {List.class, List.class, List.class, Integer[].class, 
+            List.class, List.class};
         Method m = Customer.class.getMethod("testQueryAsList", argType);
-        MessageImpl messageImpl = new MessageImpl();
-        messageImpl.put(Message.QUERY_STRING, "query2=query2Value&query3");
+        Message messageImpl = createMessage();
+        messageImpl.put(Message.QUERY_STRING, 
+                "query2=query2Value&query2=query2Value2&query3=1&query3=2&query4");
         List<Object> params = JAXRSUtils.processParameters(new OperationResourceInfo(m,
null),
                                                            null, 
                                                            messageImpl);
-        assertEquals(4, params.size());
+        assertEquals(6, params.size());
         List<String> queryList = (List<String>)params.get(0);
         assertNotNull(queryList);
         assertEquals(1, queryList.size());
@@ -688,17 +690,30 @@ public class JAXRSUtilsTest extends Asse
         
         List<String> queryList2 = (List<String>)params.get(1);
         assertNotNull(queryList2);
-        assertEquals(1, queryList2.size());
+        assertEquals(2, queryList2.size());
         assertEquals("query2Value", queryList2.get(0));
+        assertEquals("query2Value2", queryList2.get(1));
         
-        List<String> queryList3 = (List<String>)params.get(2);
+        List<Integer> queryList3 = (List<Integer>)params.get(2);
         assertNotNull(queryList3);
-        assertEquals(1, queryList3.size());
-        assertEquals("", queryList3.get(0));
+        assertEquals(2, queryList3.size());
+        assertEquals(Integer.valueOf(1), queryList3.get(0));
+        assertEquals(Integer.valueOf(2), queryList3.get(1));
+        
+        Integer[] queryList3Array = (Integer[])params.get(3);
+        assertNotNull(queryList3Array);
+        assertEquals(2, queryList3Array.length);
+        assertEquals(Integer.valueOf(1), queryList3Array[0]);
+        assertEquals(Integer.valueOf(2), queryList3Array[1]);
         
-        List<String> queryList4 = (List<String>)params.get(3);
+        List<String> queryList4 = (List<String>)params.get(4);
         assertNotNull(queryList4);
-        assertEquals(0, queryList4.size());
+        assertEquals(1, queryList4.size());
+        assertEquals("", queryList4.get(0));
+        
+        List<String> queryList5 = (List<String>)params.get(5);
+        assertNotNull(queryList5);
+        assertEquals(0, queryList5.size());
     }
     
     @Test



Mime
View raw message