cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bimargul...@apache.org
Subject svn commit: r732059 - /cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
Date Tue, 06 Jan 2009 19:01:46 GMT
Author: bimargulies
Date: Tue Jan  6 11:01:46 2009
New Revision: 732059

URL: http://svn.apache.org/viewvc?rev=732059&view=rev
Log:
More JDOM reduction.

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

Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java?rev=732059&r1=732058&r2=732059&view=diff
==============================================================================
--- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
(original)
+++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/java5/EnumTypeTest.java
Tue Jan  6 11:01:46 2009
@@ -19,20 +19,22 @@
 package org.apache.cxf.aegis.type.java5;
 
 import javax.xml.namespace.QName;
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
 
 import org.w3c.dom.Document;
+import org.w3c.dom.Element;
 
 import org.apache.cxf.aegis.AbstractAegisTest;
 import org.apache.cxf.aegis.type.DefaultTypeMapping;
 import org.apache.cxf.aegis.type.Type;
 import org.apache.cxf.aegis.type.TypeCreationOptions;
 import org.apache.cxf.aegis.type.java5.CurrencyService.Currency;
-import org.apache.cxf.aegis.xml.jdom.JDOMReader;
-import org.apache.cxf.aegis.xml.jdom.JDOMWriter;
+import org.apache.cxf.aegis.xml.stax.ElementReader;
 import org.apache.cxf.common.util.SOAPConstants;
+import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.ws.commons.schema.XmlSchema;
 import org.apache.ws.commons.schema.XmlSchemaSerializer;
-import org.jdom.Element;
 
 import org.junit.Before;
 import org.junit.Test;
@@ -68,14 +70,12 @@
 
         tm.register(type);
 
-        Element root = new Element("root");
-        JDOMWriter writer = new JDOMWriter(root);
+        Element element = writeObjectToElement(type, smallEnum.VALUE1, getContext());
 
-        type.writeObject(smallEnum.VALUE1, writer, getContext());
-
-        assertEquals("VALUE1", root.getValue());
-
-        JDOMReader reader = new JDOMReader(root);
+        assertEquals("VALUE1", element.getTextContent());
+        
+        XMLStreamReader xreader = StaxUtils.createXMLStreamReader(element);
+        ElementReader reader = new ElementReader(xreader);
         Object value = type.readObject(reader, getContext());
 
         assertEquals(smallEnum.VALUE1, value);
@@ -150,12 +150,8 @@
 
         tm.register(type);
 
-        Element root = new Element("root");
-        JDOMWriter writer = new JDOMWriter(root);
-
-        type.writeObject(new EnumBean(), writer, getContext());
-
-        JDOMReader reader = new JDOMReader(root);
+        Element root = writeObjectToElement(type, new EnumBean(), getContext());
+        ElementReader reader = new ElementReader(StaxUtils.createXMLStreamReader(root));
         Object value = type.readObject(reader, getContext());
 
         assertTrue(value instanceof EnumBean);



Mime
View raw message