You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2012/12/27 14:36:30 UTC

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

Author: veithen
Date: Thu Dec 27 13:36:30 2012
New Revision: 1426198

URL: http://svn.apache.org/viewvc?rev=1426198&view=rev
Log:
Prefer local variables in unit tests.

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

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/OMSerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/OMSerializerTest.java?rev=1426198&r1=1426197&r2=1426198&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/OMSerializerTest.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/OMSerializerTest.java Thu Dec 27 13:36:30 2012
@@ -40,13 +40,11 @@ import java.io.PrintWriter;
 import java.io.StringWriter;
 
 public class OMSerializerTest extends AbstractTestCase {
-    private XMLStreamWriter writer;
-
     public void testRawSerializer() throws Exception {
         XMLStreamReader reader = StAXUtils.createXMLStreamReader(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
         StreamingOMSerializer serializer = new StreamingOMSerializer();
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
         //serializer.setNamespacePrefixStack(new Stack());
         serializer.serialize(reader, writer);
         writer.flush();
@@ -62,7 +60,7 @@ public class OMSerializerTest extends Ab
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
         StreamingOMSerializer serializer = new StreamingOMSerializer();
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
 
         serializer.serialize(env.getXMLStreamReaderWithoutCaching(), writer);
         writer.flush();
@@ -76,7 +74,7 @@ public class OMSerializerTest extends Ab
         OMXMLParserWrapper builder = OMXMLBuilderFactory.createSOAPModelBuilder(
                 getTestResource(TestConstants.SOAP_SOAPMESSAGE), null);
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream,
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream,
                 OMConstants.DEFAULT_CHAR_SET_ENCODING);
 
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
@@ -110,7 +108,7 @@ public class OMSerializerTest extends Ab
         OMXMLParserWrapper builder = OMXMLBuilderFactory.createSOAPModelBuilder(
                 getTestResource(TestConstants.SOAP_SOAPMESSAGE), null);
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
 
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
         SOAPBody body = env.getBody();
@@ -147,7 +145,7 @@ public class OMSerializerTest extends Ab
         
         // Create an output stream
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
 
         // Now use StreamingOMSerializer to write the input stream to the output stream
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
@@ -199,7 +197,7 @@ public class OMSerializerTest extends Ab
         
         // Create an output stream
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
 
         // Now use StreamingOMSerializer to write the input stream to the output stream
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
@@ -247,7 +245,7 @@ public class OMSerializerTest extends Ab
         
         // Create an output stream
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
 
         // Now use StreamingOMSerializer to write the input stream to the output stream
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
@@ -294,7 +292,7 @@ public class OMSerializerTest extends Ab
         
         StreamingOMSerializer serializer = new StreamingOMSerializer();
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
-        writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
+        XMLStreamWriter writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
 
         // Serializing the body should cause the usr prefix to be pulled down from the
         // envelope and written in the message.