ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1199011 - in /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl: dom/ serializer/ streamwrapper/
Date Mon, 07 Nov 2011 23:35:28 GMT
Author: veithen
Date: Mon Nov  7 23:35:28 2011
New Revision: 1199011

URL: http://svn.apache.org/viewvc?rev=1199011&view=rev
Log:
Eliminated some references to deprecated APIs from the unit tests.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/OMTestUtils.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/NoNamespaceSerializerTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/OMSerializerTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OmStAXBuilderTest.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/OMTestUtils.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/OMTestUtils.java?rev=1199011&r1=1199010&r2=1199011&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/OMTestUtils.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/OMTestUtils.java
Mon Nov  7 23:35:28 2011
@@ -24,26 +24,23 @@ import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMNode;
+import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
-import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.soap.impl.dom.soap11.SOAP11Factory;
+import org.apache.axiom.om.impl.dom.factory.OMDOMMetaFactory;
 import org.w3c.dom.Attr;
 import org.w3c.dom.Element;
 import org.w3c.dom.NamedNodeMap;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import javax.xml.stream.XMLStreamReader;
 import java.io.InputStream;
 import java.util.Iterator;
 
 // TODO: more or less a copy & paste of the other OMTestUtils class; clean this up
 public class OMTestUtils {
     public static OMXMLParserWrapper getOMBuilder(InputStream in) throws Exception {
-        XMLStreamReader parser = StAXUtils.createXMLStreamReader(in);
-        return OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                new SOAP11Factory(), parser);
+        return OMXMLBuilderFactory.createSOAPModelBuilder(
+                new OMDOMMetaFactory(), in, null);
     }
 
     public static void walkThrough(OMElement omEle) {

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java?rev=1199011&r1=1199010&r2=1199011&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/ElementSerializerTest.java
Mon Nov  7 23:35:28 2011
@@ -26,10 +26,10 @@ import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMText;
+import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.OMConstants;
 import org.apache.axiom.om.TestConstants;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
@@ -55,8 +55,7 @@ public class ElementSerializerTest exten
         writer = StAXUtils.createXMLStreamWriter(new FileOutputStream(tempFile),
                 OMConstants.DEFAULT_CHAR_SET_ENCODING);
         builder =
-                OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                        OMAbstractFactory.getSOAP11Factory(), reader);
+                OMXMLBuilderFactory.createStAXSOAPModelBuilder(reader);
     }
 
     public void testElementSerilization() throws Exception {

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=1199011&r1=1199010&r2=1199011&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 Nov  7 23:35:28 2011
@@ -22,9 +22,9 @@ package org.apache.axiom.om.impl.seriali
 import junit.framework.TestCase;
 import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.OMConstants;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFactory;
@@ -83,11 +83,9 @@ public class NoNamespaceSerializerTest e
         writer = StAXUtils.createXMLStreamWriter(new ByteArrayOutputStream(),
                 OMConstants.DEFAULT_CHAR_SET_ENCODING);
         builderOne =
-                OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                        OMAbstractFactory.getSOAP11Factory(), readerOne);
+                OMXMLBuilderFactory.createStAXSOAPModelBuilder(readerOne);
         builderTwo =
-                OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                        OMAbstractFactory.getSOAP11Factory(), readerTwo);
+                OMXMLBuilderFactory.createStAXSOAPModelBuilder(readerTwo);
     }
 
     protected void tearDown() throws Exception {
@@ -116,11 +114,9 @@ public class NoNamespaceSerializerTest e
             throws Exception {
         SOAPFactory omFactory = OMAbstractFactory.getSOAP11Factory();
         SOAPEnvelope env = omFactory.getDefaultEnvelope();
-        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXOMBuilder(
-                omFactory,
-                StAXUtils.createXMLStreamReader(
-                        new InputStreamReader(
-                                new ByteArrayInputStream(xmlText2.getBytes()))));
+        OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(
+                omFactory, new InputStreamReader(
+                                new ByteArrayInputStream(xmlText2.getBytes())));
         env.getBody().addChild(builder.getDocumentElement());
 
         // not sure why this test was created. Just checking whether serialization has worked
or not. Someone

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=1199011&r1=1199010&r2=1199011&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
Mon Nov  7 23:35:28 2011
@@ -20,15 +20,14 @@
 package org.apache.axiom.om.impl.serializer;
 
 import org.apache.axiom.om.AbstractTestCase;
-import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMSourcedElement;
+import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.OMConstants;
 import org.apache.axiom.om.TestConstants;
 import org.apache.axiom.om.ds.custombuilder.ByteArrayCustomBuilder;
 import org.apache.axiom.om.impl.builder.StAXBuilder;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
 import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPBody;
@@ -77,7 +76,6 @@ public class OMSerializerTest extends Ab
 
     public void testElementPullStream1() throws Exception {
         OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                OMAbstractFactory.getSOAP11Factory(),
                 reader);
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
         StreamingOMSerializer serializer = new StreamingOMSerializer();
@@ -127,7 +125,6 @@ public class OMSerializerTest extends Ab
 
     public void testElementPullStream2() throws Exception {
         OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                OMAbstractFactory.getSOAP11Factory(),
                 reader);
         ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
         writer = StAXUtils.createXMLStreamWriter(byteArrayOutputStream);
@@ -158,8 +155,7 @@ public class OMSerializerTest extends Ab
         reader = StAXUtils.createXMLStreamReader(getTestResource("soap/OMElementTest.xml"));
         
         // Create a builder connected to the reader
-        StAXBuilder builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                OMAbstractFactory.getSOAP11Factory(),
+        StAXBuilder builder = (StAXBuilder)OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                 reader);
         
         // Create a custom builder to store the sub trees as a byte array instead of a full
tree
@@ -214,8 +210,7 @@ public class OMSerializerTest extends Ab
         reader = StAXUtils.createXMLStreamReader(getTestResource("soap/soapmessageWithXSI.xml"));
         
         // Create a builder connected to the reader
-        StAXBuilder builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                OMAbstractFactory.getSOAP11Factory(),
+        StAXBuilder builder = (StAXBuilder)OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                 reader);
         
         // Create a custom builder to store the sub trees as a byte array instead of a full
tree
@@ -266,8 +261,7 @@ public class OMSerializerTest extends Ab
         reader = StAXUtils.createXMLStreamReader(getTestResource("soap/noprettyprint.xml"));
         
         // Create a builder connected to the reader
-        StAXBuilder builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                OMAbstractFactory.getSOAP11Factory(),
+        StAXBuilder builder = (StAXBuilder)OMXMLBuilderFactory.createStAXSOAPModelBuilder(
                 reader);
         
         // Create a custom builder to store the sub trees as a byte array instead of a full
tree
@@ -324,8 +318,7 @@ public class OMSerializerTest extends Ab
             XMLInputFactory.newInstance()
                            .createXMLStreamReader(getTestResource("soap/soapmessageWithXSI.xml"));
         OMXMLParserWrapper builder =
-            OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMAbstractFactory.getSOAP11Factory(),
-                                                           reader);
+            OMXMLBuilderFactory.createStAXSOAPModelBuilder(reader);
         
         // Get the envelope and then get the body
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();
@@ -357,8 +350,7 @@ public class OMSerializerTest extends Ab
             XMLInputFactory.newInstance()
                            .createXMLStreamReader(getTestResource("soap/soapmessageWithXSI.xml"));
         OMXMLParserWrapper builder =
-            OMXMLBuilderFactory.createStAXSOAPModelBuilder(OMAbstractFactory.getSOAP11Factory(),
-                                                           reader);
+            OMXMLBuilderFactory.createStAXSOAPModelBuilder(reader);
         
         // Get and build the whole tree...this will cause no streaming when doing the write
         SOAPEnvelope env = (SOAPEnvelope) builder.getDocumentElement();

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java?rev=1199011&r1=1199010&r2=1199011&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OMStaxStreamingWrapperTest.java
Mon Nov  7 23:35:28 2011
@@ -20,11 +20,9 @@
 package org.apache.axiom.om.impl.streamwrapper;
 
 import org.apache.axiom.om.AbstractTestCase;
-import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.TestConstants;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
-import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 
 import javax.xml.stream.XMLStreamReader;
@@ -40,10 +38,8 @@ public class OMStaxStreamingWrapperTest 
     }
 
     protected void setUp() throws Exception {
-        XMLStreamReader xmlStreamReader = StAXUtils.createXMLStreamReader(
-                getTestResource(TestConstants.SOAP_SOAPMESSAGE1));
-        OMXMLParserWrapper builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(
-                OMAbstractFactory.getSOAP11Factory(), xmlStreamReader);
+        OMXMLParserWrapper builder = OMXMLBuilderFactory.createSOAPModelBuilder(
+                getTestResource(TestConstants.SOAP_SOAPMESSAGE1), null);
         envelope = (SOAPEnvelope) builder.getDocumentElement();
         tempFile = File.createTempFile("temp", "xml");
 

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OmStAXBuilderTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OmStAXBuilderTest.java?rev=1199011&r1=1199010&r2=1199011&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OmStAXBuilderTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/streamwrapper/OmStAXBuilderTest.java
Mon Nov  7 23:35:28 2011
@@ -20,20 +20,15 @@
 package org.apache.axiom.om.impl.streamwrapper;
 
 import org.apache.axiom.om.AbstractTestCase;
-import org.apache.axiom.om.OMAbstractFactory;
+import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.TestConstants;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
-import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
-import org.apache.axiom.soap.SOAPFactory;
 
-import javax.xml.stream.XMLStreamReader;
 import java.io.File;
 import java.io.FileOutputStream;
 
 public class OmStAXBuilderTest extends AbstractTestCase {
-    private SOAPFactory factory = null;
     private OMXMLParserWrapper builder;
     private File tempFile;
 
@@ -42,12 +37,8 @@ public class OmStAXBuilderTest extends A
     }
 
     protected void setUp() throws Exception {
-        factory = OMAbstractFactory.getSOAP11Factory();
-        XMLStreamReader reader = StAXUtils.createXMLStreamReader(
-                getTestResource(TestConstants.SOAP_SOAPMESSAGE));
-        builder =
-                OMXMLBuilderFactory.createStAXSOAPModelBuilder(factory,
-                                                               reader);
+        builder = OMXMLBuilderFactory.createSOAPModelBuilder(getTestResource(
+                TestConstants.SOAP_SOAPMESSAGE), null);
         tempFile = File.createTempFile("temp", "xml");
     }
 



Mime
View raw message