You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ch...@apache.org on 2006/08/21 09:03:43 UTC

svn commit: r433184 - /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java

Author: chinthaka
Date: Mon Aug 21 00:03:41 2006
New Revision: 433184

URL: http://svn.apache.org/viewvc?rev=433184&view=rev
Log:
Removing more System.out by actually testing what needs to be tested. - Take 3

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java?rev=433184&r1=433183&r2=433184&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java Mon Aug 21 00:03:41 2006
@@ -29,6 +29,7 @@
 import javax.xml.stream.XMLStreamReader;
 import javax.xml.stream.XMLStreamWriter;
 import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
 import java.io.InputStreamReader;
 
 public class NoNamespaceSerializerTest extends TestCase {
@@ -117,18 +118,33 @@
                                 new ByteArrayInputStream(xmlText2.getBytes()))));
         env.getBody().addChild(builder.getDocumentElement());
 
-        env.serialize(System.out);
+        // not sure why this test was created. Just checking whether serialization has worked or not. Someone
+        // wanna check the correct thing later?
+        String outputString = env.toString();
+        assertTrue(outputString != null && !"".equals(outputString) && outputString.length() > 1);
     }
 
+    /**
+     * Will just do a probe test to check serialize with caching on works without any exception
+     */
     public void testSerilizationWithCacheOn() throws Exception {
+        writer = XMLOutputFactory.newInstance().
+                createXMLStreamWriter(new ByteArrayOutputStream());
+
         SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
         env.serialize(writer);
         writer.flush();
     }
 
+    /**
+     * Will just do a probe test to check serialize with caching off works without any exception
+     */
     public void testSerilizationWithCacheOff() throws Exception {
+        writer = XMLOutputFactory.newInstance().
+                createXMLStreamWriter(new ByteArrayOutputStream());
+
         SOAPEnvelope env = (SOAPEnvelope) builderOne.getDocumentElement();
-        env.serialize(writer);
+        env.serializeAndConsume(writer);
         writer.flush();
     }
 }



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org