axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r344431 - in /webservices/axis2/trunk/java/modules/xml: src/org/apache/axis2/om/impl/llom/OMElementImpl.java test/org/apache/axis2/om/impl/serializer/OMSerializerTest.java test/org/apache/axis2/soap/impl/llom/soap11/SOAP11SerializerTest.java
Date Tue, 15 Nov 2005 20:22:46 GMT
Author: dims
Date: Tue Nov 15 12:22:39 2005
New Revision: 344431

URL: http://svn.apache.org/viewcvs?rev=344431&view=rev
Log:
Trying to get the code/test cases working with woodstox stax parser.

#1: OMElementImpl - check explicitly for END_DOCUMENT, don't rely on the IO exception behavior
in RI
#2: OMSerializerTest - woodstox throws IllegalStateException (logged a bug with them)
#3: SOAP11SerializerTest - use separate createXMLStreamWriter for serialize and serializeAndConsume


Modified:
    webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
    webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/serializer/OMSerializerTest.java
    webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/soap11/SOAP11SerializerTest.java

Modified: webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java?rev=344431&r1=344430&r2=344431&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
Tue Nov 15 12:22:39 2005
@@ -31,6 +31,7 @@
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamConstants;
 import java.io.ByteArrayOutputStream;
 import java.util.HashMap;
 import java.util.Iterator;
@@ -248,7 +249,10 @@
      */
     public OMNode getNextOMSibling() throws OMException {
         while (!done) {
-            builder.next();
+            int token = builder.next();
+            if(token == XMLStreamConstants.END_DOCUMENT) {
+                throw new OMException();
+            }
         }
         return super.getNextOMSibling();
     }

Modified: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/serializer/OMSerializerTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/serializer/OMSerializerTest.java?rev=344431&r1=344430&r2=344431&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/serializer/OMSerializerTest.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/om/impl/serializer/OMSerializerTest.java
Tue Nov 15 12:22:39 2005
@@ -91,6 +91,8 @@
            fail();
         } catch (XMLStreamException e) {
            assertTrue(true);
+        } catch (Exception e) {
+           assertTrue(true);
         }
     }
 

Modified: webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/soap11/SOAP11SerializerTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/soap11/SOAP11SerializerTest.java?rev=344431&r1=344430&r2=344431&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/soap11/SOAP11SerializerTest.java
(original)
+++ webservices/axis2/trunk/java/modules/xml/test/org/apache/axis2/soap/impl/llom/soap11/SOAP11SerializerTest.java
Tue Nov 15 12:22:39 2005
@@ -28,7 +28,6 @@
 public class SOAP11SerializerTest extends OMTestCase {
 
     private Log log = LogFactory.getLog(getClass());
-    private XMLStreamWriter output;
 
     public SOAP11SerializerTest(String testName) {
         super(testName);
@@ -43,20 +42,15 @@
         soapEnvelope =
                 (SOAPEnvelope) getOMBuilder("soap/soap11/soap11fault.xml")
                 .getDocumentElement();
-        output = XMLOutputFactory.newInstance().
-                createXMLStreamWriter(System.out);
     }
 
-    public void testSerialize() {
-        try {
-            soapEnvelope.serialize(output);
-
-//            System.out.println("");
-//            System.out.println("=======================");
-            soapEnvelope.serializeAndConsume(output);
-        } catch (XMLStreamException e) {
-            log.info(e.getMessage());
-        }
+    public void testSerialize() throws Exception {
+        XMLStreamWriter output = XMLOutputFactory.newInstance().
+                createXMLStreamWriter(System.out);
+        soapEnvelope.serialize(output);
 
+        output = XMLOutputFactory.newInstance().
+                createXMLStreamWriter(System.out);
+        soapEnvelope.serializeAndConsume(output);
     }
 }



Mime
View raw message