cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1081560 - in /cxf/trunk: rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/ systests/databinding/src/test/java/org/apache/cxf/systest/aegis/
Date Mon, 14 Mar 2011 21:00:15 GMT
Author: dkulp
Date: Mon Mar 14 21:00:15 2011
New Revision: 1081560

URL: http://svn.apache.org/viewvc?rev=1081560&view=rev
Log:
[CXF-3376] Make sure byte[] is properly mapped in Aegis.

Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
    cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
    cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
    cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java?rev=1081560&r1=1081559&r2=1081560&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/AbstractTypeCreator.java
Mon Mar 14 21:00:15 2011
@@ -120,6 +120,8 @@ public abstract class AbstractTypeCreato
             result = createCollectionType(info);
         } else if (isEnum(javaClass)) {
             result = createEnumType(info);
+        } else if (javaClass.equals(byte[].class)) {
+            result = getTypeMapping().getType(javaClass);
         } else {
             AegisType type = getTypeMapping().getType(info.getType());
             if (type == null) {

Modified: cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java?rev=1081560&r1=1081559&r2=1081560&view=diff
==============================================================================
--- cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
(original)
+++ cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWs.java
Mon Mar 14 21:00:15 2011
@@ -57,4 +57,7 @@ public interface AegisJaxWs {
     
     @WebMethod
     java.util.List<String> echoBigList(java.util.List<String> l);
+    
+    @WebMethod
+    byte[] export(java.util.List<java.lang.Integer> integers);
 }

Modified: cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java?rev=1081560&r1=1081559&r2=1081560&view=diff
==============================================================================
--- cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
(original)
+++ cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsImpl.java
Mon Mar 14 21:00:15 2011
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.systest.aegis;
 
+import java.io.UnsupportedEncodingException;
 import java.util.Arrays;
 import java.util.HashMap;
 import java.util.List;
@@ -66,4 +67,16 @@ public class AegisJaxWsImpl implements A
         return l;
     }
 
+    public byte[] export(List<Integer> integers) {
+        StringBuilder b = new StringBuilder(integers.size() * 3);
+        for (Integer i : integers) {
+            b.append(i.toString());
+        }
+        try {
+            return b.toString().getBytes("utf-8");
+        } catch (UnsupportedEncodingException e) {
+            throw new RuntimeException(e);
+        }
+    }
+
 }

Modified: cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java?rev=1081560&r1=1081559&r2=1081560&view=diff
==============================================================================
--- cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
(original)
+++ cxf/trunk/systests/databinding/src/test/java/org/apache/cxf/systest/aegis/AegisJaxWsTest.java
Mon Mar 14 21:00:15 2011
@@ -136,4 +136,19 @@ public class AegisJaxWsTest extends Abst
         File f = FileUtils.getDefaultTempDir();
         Assert.assertEquals(0, f.listFiles().length);
     }
+    
+    @Test 
+    //CXF-3376
+    public void testByteArray() throws Exception {
+        int size = 50;
+        List<Integer> ints = new ArrayList<Integer>(size);
+        for (int x = 0; x < size; x++) {
+            ints.add(x);
+        }        
+        setupForTest(false);
+        byte[] bytes = client.export(ints);
+        Assert.assertNotNull(bytes);
+        Assert.assertTrue(bytes.length > 50);
+        
+    }
 }



Mime
View raw message