You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by bi...@apache.org on 2008/08/29 03:32:37 UTC

svn commit: r690067 - in /cxf/trunk/rt/databinding/aegis/src: main/java/org/apache/cxf/aegis/type/collection/ test/java/org/apache/cxf/aegis/type/java5/

Author: bimargulies
Date: Thu Aug 28 18:32:37 2008
New Revision: 690067

URL: http://svn.apache.org/viewvc?rev=690067&view=rev
Log:
Fix CXF-1770.

Added:
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml   (with props)
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java   (with props)
Modified:
    cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/CollectionType.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest$CollectionService.aegis.xml
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java

Modified: cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/CollectionType.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/CollectionType.java?rev=690067&r1=690066&r2=690067&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/CollectionType.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/main/java/org/apache/cxf/aegis/type/collection/CollectionType.java Thu Aug 28 18:32:37 2008
@@ -24,6 +24,8 @@
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
 import java.util.Vector;
 
 import org.apache.cxf.aegis.Context;
@@ -58,6 +60,8 @@
 
         if (getTypeClass().isAssignableFrom(List.class)) {
             values = new ArrayList();
+        } else if (getTypeClass().isAssignableFrom(SortedSet.class)) {
+            values = new TreeSet();
         } else if (getTypeClass().isAssignableFrom(Set.class)) {
             values = new HashSet();
         } else if (getTypeClass().isAssignableFrom(Vector.class)) {

Added: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml?rev=690067&view=auto
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml (added)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml Thu Aug 28 18:32:37 2008
@@ -0,0 +1,13 @@
+<mappings>
+	<mapping>
+		<method name="getUnannotatedStrings">
+			<return-type name="UnannotatedStringCollection" componentType="java.lang.String"/>
+		</method>
+		<method name="takeDoubleList">
+            <parameter index="0" mappedName="doublesList" componentType="java.lang.Double"/>
+        </method> 
+        <method name="takeSortedStrings">
+        	<parameter index="0" mappedName="strings"/>
+        </method>
+	</mapping>
+</mappings>
\ No newline at end of file

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml
------------------------------------------------------------------------------
    svn:executable = *

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.aegis.xml
------------------------------------------------------------------------------
    svn:mime-type = text/xml

Added: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java?rev=690067&view=auto
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java (added)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java Thu Aug 28 18:32:37 2008
@@ -0,0 +1,41 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.aegis.type.java5;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.SortedSet;
+
+import javax.jws.WebParam;
+
+public interface CollectionServiceInterface {
+
+    Collection<String> getStrings();
+
+    void setLongs(Collection<Long> longs);
+
+    Collection getUnannotatedStrings();
+
+    Collection<Collection<String>> getStringCollections();
+
+    void takeDoubleList(List<Double> doublesList);
+
+    String takeSortedStrings(@WebParam(name = "strings")SortedSet<String> strings);
+
+}

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest$CollectionService.aegis.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest%24CollectionService.aegis.xml?rev=690067&r1=690066&r2=690067&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest$CollectionService.aegis.xml (original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest$CollectionService.aegis.xml Thu Aug 28 18:32:37 2008
@@ -6,5 +6,8 @@
 		<method name="takeDoubleList">
             <parameter index="0" mappedName="doublesList" componentType="java.lang.Double"/>
         </method> 
+        <method name="takeSortedStrings">
+        	<parameter index="0" mappedName="strings"/>
+        </method>
 	</mapping>
 </mappings>
\ No newline at end of file

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java?rev=690067&r1=690066&r2=690067&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java (original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTest.java Thu Aug 28 18:32:37 2008
@@ -24,12 +24,16 @@
 import java.util.Collection;
 import java.util.List;
 import java.util.Set;
+import java.util.SortedSet;
+import java.util.TreeSet;
 
 import javax.xml.namespace.QName;
 
 import org.w3c.dom.Document;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
+import org.apache.cxf.aegis.databinding.AegisDatabinding;
+import org.apache.cxf.aegis.databinding.XFireCompatibilityServiceConfiguration;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
@@ -38,9 +42,12 @@
 import org.apache.cxf.aegis.type.java5.dto.DTOService;
 import org.apache.cxf.aegis.type.java5.dto.ObjectDTO;
 import org.apache.cxf.common.util.SOAPConstants;
+import org.apache.cxf.frontend.ClientProxyFactoryBean;
 import org.junit.Before;
 import org.junit.Test;
 
+
+
 public class CollectionTest extends AbstractAegisTest {
     private DefaultTypeMapping tm;
     private Java5TypeCreator creator;
@@ -203,25 +210,55 @@
                     doc);
         
     }
+    
+    @Test
+    public void testSortedSet() throws Exception {
+        createService(CollectionService.class, new CollectionService(), null);
+        
+        ClientProxyFactoryBean proxyFac = new ClientProxyFactoryBean();
+        proxyFac.getServiceFactory().getServiceConfigurations().add(0, 
+                                                              new XFireCompatibilityServiceConfiguration());
+        proxyFac.setServiceClass(CollectionServiceInterface.class);
+        proxyFac.setDataBinding(new AegisDatabinding());
+        proxyFac.setAddress("local://CollectionService");
+        proxyFac.setBus(getBus());
+
+        CollectionServiceInterface csi = (CollectionServiceInterface)proxyFac.create();
+        SortedSet<String> strings = new TreeSet<String>();
+        strings.add("Able");
+        strings.add("Baker");
+        String first = csi.takeSortedStrings(strings);
+        assertEquals("Able", first);
+    }
 
-    public class CollectionService {
+    public class CollectionService implements CollectionServiceInterface {
         
+        /** {@inheritDoc}*/
         public Collection<String> getStrings() {
             return null;
         }
 
+        /** {@inheritDoc}*/
         public void setLongs(Collection<Long> longs) {
         }
 
+        /** {@inheritDoc}*/
         public Collection getUnannotatedStrings() {
             return null;
         }
 
+        /** {@inheritDoc}*/
         public Collection<Collection<String>> getStringCollections() {
             return null;
         }
         
+        /** {@inheritDoc}*/
         public void takeDoubleList(List<Double> doublesList) {
         }
+        
+        /** {@inheritDoc}*/
+        public String takeSortedStrings(SortedSet<String> strings) {
+            return strings.first();
+        }
     }
 }