cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r898831 - in /cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5: CollectionService.java CollectionServiceInterface.java CollectionTestsWithService.java
Date Wed, 13 Jan 2010 16:43:44 GMT
Author: bimargulies
Date: Wed Jan 13 16:43:43 2010
New Revision: 898831

URL: http://svn.apache.org/viewvc?rev=898831&view=rev
Log:
Leftover test improvements?

Modified:
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionService.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java
    cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTestsWithService.java

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionService.java?rev=898831&r1=898830&r2=898831&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionService.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionService.java
Wed Jan 13 16:43:43 2010
@@ -27,7 +27,12 @@
 import java.util.SortedSet;
 import java.util.Stack;
 
-import org.w3c.dom.DocumentFragment;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 public class CollectionService implements CollectionServiceInterface {
     
@@ -96,8 +101,26 @@
         return data;
     }
 
-    public Collection<DocumentFragment[]> returnCollectionOfDOMFragments() {
-        return null;
+    public Collection<Document[]> returnCollectionOfDOMFragments() {
+        try {
+            DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
+            Document d1 = builder.newDocument();
+            Element e = d1.createElement("Horse");
+            e.setAttribute("cover", "feathers");
+            d1.appendChild(e);
+            Document d2 = builder.newDocument();
+            e = d2.createElement("Cantelope");
+            d2.appendChild(e);
+            e.setAttribute("not-an", "ungulate");
+            Document[] da = new Document[] {d1, d2};
+            List<Document[]> l = new ArrayList<Document[]>();
+            l.add(da);
+            da = new Document[] {d2, d1};
+            l.add(da);
+            return l;
+        } catch (ParserConfigurationException e) {
+            throw new RuntimeException(e);
+        }
     }
 
 }
\ No newline at end of file

Modified: 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=898831&r1=898830&r2=898831&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionServiceInterface.java
Wed Jan 13 16:43:43 2010
@@ -18,6 +18,7 @@
  */
 package org.apache.cxf.aegis.type.java5;
 
+
 import java.util.ArrayList;
 import java.util.Collection;
 import java.util.HashSet;
@@ -26,7 +27,7 @@
 import java.util.SortedSet;
 import java.util.Stack;
 
-import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.Document;
 
 public interface CollectionServiceInterface {
 
@@ -54,5 +55,5 @@
     
     Collection<double[]> returnCollectionOfPrimitiveArrays();
     
-    Collection<DocumentFragment[]> returnCollectionOfDOMFragments();
+    Collection<Document[]> returnCollectionOfDOMFragments();
 }

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTestsWithService.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTestsWithService.java?rev=898831&r1=898830&r2=898831&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTestsWithService.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/CollectionTestsWithService.java
Wed Jan 13 16:43:43 2010
@@ -26,6 +26,8 @@
 import java.util.SortedSet;
 import java.util.TreeSet;
 
+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;
@@ -121,5 +123,11 @@
         assertEquals(3.14, data[1][1], .0001);
         assertEquals(2.0, data[1][2], .0001);
     }
+    
+    @Test
+    public void returnValueIsCollectionOfArraysOfAny() {
+        Collection<Document[]> r = csi.returnCollectionOfDOMFragments();
+        assertEquals(2, r.size());
+    }
 
 }



Mime
View raw message