Author: veithen
Date: Thu Mar 31 17:01:56 2011
New Revision: 1087372
URL: http://svn.apache.org/viewvc?rev=1087372&view=rev
Log:
Make use of the API defined by AXIOM-353 in the unit tests.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/SpacesTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/builder/StAXOMBuilderTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/ElementHelperTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/CashWihBuildElementTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPEnvelopeBuildTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/xop/XOPRoundtripTest.java
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/AttrNsTest.java
Thu Mar 31 17:01:56 2011
@@ -19,11 +19,9 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.util.StAXUtils;
import org.custommonkey.xmlunit.Diff;
import org.custommonkey.xmlunit.XMLTestCase;
-import javax.xml.stream.XMLStreamReader;
import java.io.StringReader;
import java.util.Iterator;
@@ -58,12 +56,9 @@ public class AttrNsTest extends XMLTestC
public void testAttributesWithNamespaceSerialization() throws Exception {
String xmlString =
"<root xmlns='http://custom.com'><node cust:id='123'
xmlns:cust='http://custom.com' /></root>";
- XMLStreamReader xmlStreamReader = StAXUtils.createXMLStreamReader(
- new StringReader(xmlString));
// copied code from the generated stub class toOM method
- org.apache.axiom.om.impl.builder.StAXOMBuilder builder =
- new
org.apache.axiom.om.impl.builder.StAXOMBuilder(xmlStreamReader);
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new
StringReader(xmlString));
org.apache.axiom.om.OMElement documentElement = builder
.getDocumentElement();
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/DefaultNSHandlingTest.java
Thu Mar 31 17:01:56 2011
@@ -19,7 +19,6 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.om.xpath.AXIOMXPath;
import org.custommonkey.xmlunit.XMLTestCase;
@@ -29,7 +28,7 @@ import org.jaxen.XPath;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamWriter;
-import java.io.ByteArrayInputStream;
+import java.io.StringReader;
import java.util.Iterator;
public class DefaultNSHandlingTest extends XMLTestCase {
@@ -39,18 +38,13 @@ public class DefaultNSHandlingTest exten
"<head><title>Frobnostication</title></head>" +
"<body><p>Moved to <a
href='http://frob.com'>here</a>.</p></body>" +
"</html>";
- try {
- StAXOMBuilder stAXOMBuilder =
- new StAXOMBuilder(new
ByteArrayInputStream(testXML.getBytes()));
- OMElement documentElement = stAXOMBuilder.getDocumentElement();
-
- checkNS(documentElement);
+ OMXMLParserWrapper builder =
+ OMXMLBuilderFactory.createOMBuilder(new StringReader(testXML));
+ OMElement documentElement = builder.getDocumentElement();
- checkNSWithChildren(documentElement);
+ checkNS(documentElement);
- } catch (XMLStreamException e) {
- e.printStackTrace(); //To change body of catch statement use File
| Settings | File Templates.
- }
+ checkNSWithChildren(documentElement);
}
private void checkNSWithChildren(OMElement documentElement) {
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/NamespaceTest.java
Thu Mar 31 17:01:56 2011
@@ -19,8 +19,6 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
import org.apache.axiom.om.impl.llom.util.AXIOMUtil;
import org.apache.axiom.om.util.StAXUtils;
import org.custommonkey.xmlunit.XMLTestCase;
@@ -33,7 +31,6 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import java.io.ByteArrayInputStream;
import java.io.IOException;
-import java.io.Reader;
import java.io.StringReader;
import java.io.StringWriter;
import java.util.Iterator;
@@ -136,7 +133,7 @@ public class NamespaceTest extends XMLTe
"<soapenv:Envelope
xmlns:soapenv=\"http://schemas.xmlsoap.org/soap/envelope/\"><soapenv:Header
/><soapenv:Body><ns1:createAccountRequest
xmlns:ns1=\"http://www.wso2.com/types\"><clientinfo
xmlns=\"http://www.wso2.com/types\"><name>bob</name><ssn>123456789</ssn></clientinfo><password
xmlns=\"\">passwd</password></ns1:createAccountRequest></soapenv:Body></soapenv:Envelope>";
try {
- OMElement documentElement = new StAXOMBuilder(new
ByteArrayInputStream(xml.getBytes()))
+ OMElement documentElement =
OMXMLBuilderFactory.createOMBuilder(new StringReader(xml))
.getDocumentElement();
String actualXML = documentElement.toString();
assertXMLEqual(xml, actualXML);
@@ -247,9 +244,7 @@ public class NamespaceTest extends XMLTe
"</foo:foo>";
// read and build XML content
- Reader reader = new StringReader(content);
- XMLStreamReader parser = StAXUtils.createXMLStreamReader(reader);
- StAXOMBuilder builder = new StAXOMBuilder(parser);
+ OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(new
StringReader(content));
OMElement element = builder.getDocumentElement();
int count = 0;
@@ -272,9 +267,7 @@ public class NamespaceTest extends XMLTe
element.close(false);
// reread and rebuild XML content
- reader = new StringReader(output);
- parser = StAXUtils.createXMLStreamReader(reader);
- builder = new StAXOMBuilder(parser);
+ builder = OMXMLBuilderFactory.createOMBuilder(new
StringReader(output));
element = builder.getDocumentElement();
count = 0;
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMCachingTest.java
Thu Mar 31 17:01:56 2011
@@ -19,12 +19,8 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.util.StAXUtils;
-
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
-import java.io.FileNotFoundException;
public class OMCachingTest extends AbstractTestCase {
private XMLStreamReader xmlStreamReader;
@@ -44,13 +40,11 @@ public class OMCachingTest extends Abstr
OMElement documentElement = null;
try {
// first build the OM tree without caching and see whether up can
cosume it again
- StAXOMBuilder builder = new StAXOMBuilder(getXMLStreamReader());
+ OMXMLParserWrapper builder =
OMXMLBuilderFactory.createOMBuilder(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
documentElement = builder.getDocumentElement();
String envelopeString = documentElement.toStringWithConsume();
} catch (XMLStreamException e) {
e.printStackTrace(); //To change body of catch statement use File
| Settings | File Templates.
- } catch (FileNotFoundException e) {
- e.printStackTrace(); //To change body of catch statement use File
| Settings | File Templates.
}
try {
@@ -69,21 +63,15 @@ public class OMCachingTest extends Abstr
OMElement documentElement = null;
try {
// first build the OM tree without caching and see whether up can
cosume it again
- StAXOMBuilder builder = new StAXOMBuilder(getXMLStreamReader());
+ OMXMLParserWrapper builder =
OMXMLBuilderFactory.createOMBuilder(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
documentElement = builder.getDocumentElement();
String envelopeString = documentElement.toString();
envelopeString = documentElement.toStringWithConsume();
assertTrue(true);
} catch (XMLStreamException e) {
fail("Parser should not failt as the element was serialized with
caching");
- } catch (FileNotFoundException e) {
- fail("Parser should not failt as the element was serialized with
caching");
}
documentElement.close(false);
}
-
- private XMLStreamReader getXMLStreamReader() throws XMLStreamException,
FileNotFoundException {
- return
StAXUtils.createXMLStreamReader(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
- }
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDTDTest.java
Thu Mar 31 17:01:56 2011
@@ -19,7 +19,6 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.om.util.StAXUtils;
import javax.xml.stream.XMLStreamException;
@@ -35,7 +34,7 @@ public class OMDTDTest extends AbstractT
protected void setUp() throws Exception {
try {
- StAXOMBuilder stAXOMBuilder = new
StAXOMBuilder(getTestResource("dtd.xml"));
+ OMXMLParserWrapper stAXOMBuilder =
OMXMLBuilderFactory.createOMBuilder(getTestResource("dtd.xml"));
document = this.document = stAXOMBuilder.getDocument();
} catch (Exception e) {
e.printStackTrace();
@@ -87,7 +86,7 @@ public class OMDTDTest extends AbstractT
InputStream is = getTestResource("web_w_dtd2.xml");
XMLStreamReader reader =
StAXUtils.createNetworkDetachedXMLStreamReader(is);
- StAXOMBuilder builder = new StAXOMBuilder(reader);
+ OMXMLParserWrapper builder =
OMXMLBuilderFactory.createStAXOMBuilder(reader);
OMElement root = builder.getDocumentElement();
assertTrue(root.getLocalName().equals("web-app"));
OMDocument document = builder.getDocument();
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMDiscardTest.java
Thu Mar 31 17:01:56 2011
@@ -18,13 +18,6 @@
*/
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.util.StAXUtils;
-
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.FileNotFoundException;
-
/**
*Test the discard method
*/
@@ -41,7 +34,7 @@ public class OMDiscardTest extends Abstr
try {
// first build the OM tree without caching and see whether we can
discard
// an element from it
- StAXOMBuilder builder = new StAXOMBuilder(getXMLStreamReader());
+ OMXMLParserWrapper builder =
OMXMLBuilderFactory.createOMBuilder(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
documentElement = builder.getDocumentElement();
documentElement.getFirstElement().discard();
@@ -52,9 +45,4 @@ public class OMDiscardTest extends Abstr
}
documentElement.close(false);
}
-
- private XMLStreamReader getXMLStreamReader() throws XMLStreamException,
FileNotFoundException {
- return
StAXUtils.createXMLStreamReader(getTestResource(TestConstants.SOAP_SOAPMESSAGE));
- }
-
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java
Thu Mar 31 17:01:56 2011
@@ -19,7 +19,6 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPEnvelope;
import org.w3c.dom.Document;
@@ -41,9 +40,9 @@ public class OMElementCloneTest extends
SOAPBody body = soapEnvelope.getBody();
OMElement firstClonedBodyElement =
- new
StAXOMBuilder(body.getXMLStreamReader()).getDocumentElement();
+
OMXMLBuilderFactory.createStAXOMBuilder(body.getXMLStreamReader()).getDocumentElement();
OMElement secondClonedBodyElement =
- new
StAXOMBuilder(body.getXMLStreamReader()).getDocumentElement();
+
OMXMLBuilderFactory.createStAXOMBuilder(body.getXMLStreamReader()).getDocumentElement();
// first check whether both have the same information
String firstClonedBodyElementText = firstClonedBodyElement.toString();
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/SpacesTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/SpacesTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/SpacesTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/SpacesTest.java
Thu Mar 31 17:01:56 2011
@@ -19,8 +19,6 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
import org.apache.axiom.om.util.StAXUtils;
import org.custommonkey.xmlunit.Diff;
import org.w3c.dom.Document;
@@ -50,7 +48,7 @@ public class SpacesTest extends Abstract
}
private void checkOMConformance(InputStream iStream) throws Exception {
- StAXOMBuilder staxOMBuilder = OMXMLBuilderFactory.
+ OMXMLParserWrapper staxOMBuilder = OMXMLBuilderFactory.
createStAXOMBuilder(OMAbstractFactory.getOMFactory(),
StAXUtils.createXMLStreamReader(
iStream));
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/StaxParserTest.java
Thu Mar 31 17:01:56 2011
@@ -19,8 +19,6 @@
package org.apache.axiom.om;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
import org.apache.axiom.om.util.StAXUtils;
import javax.xml.stream.XMLStreamException;
@@ -81,8 +79,8 @@ public class StaxParserTest extends Abst
protected void tearDown() throws Exception {
parser1.close();
- ((StAXOMBuilder)builder2).close();
- ((StAXOMBuilder)builder3).close();
+ builder2.close();
+ builder3.close();
}
public void testParserEventsWithCache() throws Exception {
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/builder/StAXOMBuilderTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/builder/StAXOMBuilderTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/builder/StAXOMBuilderTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/builder/StAXOMBuilderTest.java
Thu Mar 31 17:01:56 2011
@@ -24,7 +24,8 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.testutils.InvocationCounter;
import org.apache.axiom.testutils.io.ExceptionInputStream;
@@ -36,7 +37,7 @@ import java.util.Iterator;
import javax.xml.stream.XMLStreamReader;
public class StAXOMBuilderTest extends AbstractTestCase {
- StAXOMBuilder stAXOMBuilder;
+ OMXMLParserWrapper stAXOMBuilder;
private OMElement rootElement;
/** Constructor. */
@@ -131,7 +132,7 @@ public class StAXOMBuilderTest extends A
InvocationCounter invocationCounter = new InvocationCounter();
XMLStreamReader reader =
(XMLStreamReader)invocationCounter.createProxy(originalReader);
- StAXOMBuilder stAXOMBuilder =
+ OMXMLParserWrapper stAXOMBuilder =
OMXMLBuilderFactory.createStAXOMBuilder(OMAbstractFactory.getSOAP11Factory(),
reader);
@@ -190,7 +191,7 @@ public class StAXOMBuilderTest extends A
InvocationCounter invocationCounter = new InvocationCounter();
XMLStreamReader reader =
(XMLStreamReader)invocationCounter.createProxy(originalReader);
- StAXOMBuilder builder = new StAXOMBuilder(reader);
+ OMXMLParserWrapper builder =
OMXMLBuilderFactory.createStAXOMBuilder(reader);
try {
while (true) {
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/dom/ConvertLLOMToDOOMTest.java
Thu Mar 31 17:01:56 2011
@@ -22,7 +22,8 @@ package org.apache.axiom.om.impl.dom;
import junit.framework.TestCase;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.soap.SOAP11Constants;
import org.apache.axiom.soap.SOAPEnvelope;
@@ -102,8 +103,8 @@ public class ConvertLLOMToDOOMTest exten
OMElement payload = doomEnv.getBody().getFirstElement();
- StAXOMBuilder llomBuilder =
- new StAXOMBuilder(payload.getXMLStreamReaderWithoutCaching());
+ OMXMLParserWrapper llomBuilder =
+
OMXMLBuilderFactory.createStAXOMBuilder(payload.getXMLStreamReaderWithoutCaching());
OMElement llomPayload = llomBuilder.getDocumentElement();
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMAttributeTest.java
Thu Mar 31 17:01:56 2011
@@ -25,11 +25,10 @@ import org.apache.axiom.om.OMAttribute;
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
-import javax.xml.stream.XMLStreamReader;
-import java.io.ByteArrayInputStream;
+import java.io.StringReader;
public class OMAttributeTest extends TestCase {
@@ -79,10 +78,7 @@ public class OMAttributeTest extends Tes
}
private String addAttributeMethod1(String xmlString) throws Exception {
- XMLStreamReader parser2;
-
- parser2 = StAXUtils.createXMLStreamReader(new
ByteArrayInputStream(xmlString.getBytes()));
- StAXOMBuilder builder2 = new StAXOMBuilder(parser2);
+ OMXMLParserWrapper builder2 = OMXMLBuilderFactory.createOMBuilder(new
StringReader(xmlString));
OMElement doc = builder2.getDocumentElement();
OMFactory factory = OMAbstractFactory.getOMFactory();
@@ -96,10 +92,7 @@ public class OMAttributeTest extends Tes
}
private String addAttributeMethod2(String xmlString) throws Exception {
- XMLStreamReader parser2;
-
- parser2 = StAXUtils.createXMLStreamReader(new
ByteArrayInputStream(xmlString.getBytes()));
- StAXOMBuilder builder2 = new StAXOMBuilder(parser2);
+ OMXMLParserWrapper builder2 = OMXMLBuilderFactory.createOMBuilder(new
StringReader(xmlString));
OMElement doc = builder2.getDocumentElement();
OMFactory factory = OMAbstractFactory.getOMFactory();
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/llom/OMSourcedElementTest.java
Thu Mar 31 17:01:56 2011
@@ -28,9 +28,10 @@ import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMNode;
import org.apache.axiom.om.OMOutputFormat;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.om.ds.CharArrayDataSource;
import org.apache.axiom.om.impl.OMNamespaceImpl;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.om.impl.llom.factory.OMLinkedListImplFactory;
import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
import org.apache.axiom.om.util.StAXUtils;
@@ -964,7 +965,7 @@ public class OMSourcedElementTest extend
StringWriter writer = new StringWriter();
XMLStreamWriter xmlwriter = StAXUtils.createXMLStreamWriter(writer);
- StAXOMBuilder builder = new
StAXOMBuilder(element.getXMLStreamReader());
+ OMXMLParserWrapper builder =
OMXMLBuilderFactory.createStAXOMBuilder(element.getXMLStreamReader());
OMDocument omDocument = builder.getDocument();
Iterator it = omDocument.getChildren();
while (it.hasNext()) {
@@ -992,7 +993,7 @@ public class OMSourcedElementTest extend
StringWriter writer = new StringWriter();
XMLStreamWriter xmlwriter = StAXUtils.createXMLStreamWriter(writer);
- StAXOMBuilder builder = new StAXOMBuilder(root.getXMLStreamReader());
+ OMXMLParserWrapper builder =
OMXMLBuilderFactory.createStAXOMBuilder(root.getXMLStreamReader());
OMDocument omDocument = builder.getDocument();
Iterator it = omDocument.getChildren();
while (it.hasNext()) {
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/impl/serializer/PreserveEnvelopeTest.java
Thu Mar 31 17:01:56 2011
@@ -20,11 +20,11 @@
package org.apache.axiom.om.impl.serializer;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.custommonkey.xmlunit.XMLTestCase;
-import javax.xml.stream.XMLStreamException;
-import java.io.ByteArrayInputStream;
+import java.io.StringReader;
public class PreserveEnvelopeTest extends XMLTestCase {
@@ -90,21 +90,15 @@ public class PreserveEnvelopeTest extend
public void testOMNS() {
- try {
- StAXOMBuilder builder =
- new StAXOMBuilder(new
ByteArrayInputStream(originalXML.getBytes()));
- OMElement documentElement = builder.getDocumentElement();
- //assertXMLEqual(originalXML, documentElement.toString());
- documentElement.build();
-
- String outstr = documentElement.toString();
- assertTrue(outstr.indexOf("xmlns:saml=") > 0);
- assertTrue(outstr.indexOf("<Assertion") == 0);
-
- } catch (XMLStreamException e) {
- e.printStackTrace();
-
- }
+ OMXMLParserWrapper builder =
+ OMXMLBuilderFactory.createOMBuilder(new
StringReader(originalXML));
+ OMElement documentElement = builder.getDocumentElement();
+ //assertXMLEqual(originalXML, documentElement.toString());
+ documentElement.build();
+
+ String outstr = documentElement.toString();
+ assertTrue(outstr.indexOf("xmlns:saml=") > 0);
+ assertTrue(outstr.indexOf("<Assertion") == 0);
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/ElementHelperTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/ElementHelperTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/ElementHelperTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/ElementHelperTest.java
Thu Mar 31 17:01:56 2011
@@ -40,8 +40,8 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMSourcedElement;
+import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.ds.WrappedTextNodeOMDataSourceFromDataSource;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
import org.apache.axiom.om.util.AXIOMUtil;
import org.apache.axiom.om.util.ElementHelper;
@@ -93,7 +93,7 @@ public class ElementHelperTest extends T
factory.setProperty(XMLInputFactory.IS_COALESCING, Boolean.FALSE);
XMLStreamReader reader = factory.createXMLStreamReader(
new SequenceInputStream(v.elements()), "ascii");
- OMElement element = new StAXOMBuilder(reader).getDocumentElement();
+ OMElement element =
OMXMLBuilderFactory.createStAXOMBuilder(reader).getDocumentElement();
Reader in = ElementHelper.getTextAsStream(element, false);
IOTestUtils.compareStreams(new InputStreamReader(ds.getInputStream(),
"ascii"), in);
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/util/OMElementHelperTest.java
Thu Mar 31 17:01:56 2011
@@ -22,21 +22,17 @@ package org.apache.axiom.om.util;
import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
-import javax.xml.stream.XMLStreamReader;
-
public class OMElementHelperTest extends AbstractTestCase {
private String testXMLFilePath = "soap/soapmessage.xml";
public void testImportOMElement() throws Exception {
- XMLStreamReader xmlStreamReader = StAXUtils.createXMLStreamReader(
- getTestResource(testXMLFilePath));
OMElement documentElement =
- new StAXOMBuilder(OMAbstractFactory.getOMFactory(),
xmlStreamReader)
+
OMXMLBuilderFactory.createOMBuilder(OMAbstractFactory.getOMFactory(),
getTestResource(testXMLFilePath))
.getDocumentElement();
// first lets try to import an element created from llom in to llom
factory. This should return the same element
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/CashWihBuildElementTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/CashWihBuildElementTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/CashWihBuildElementTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/CashWihBuildElementTest.java
Thu Mar 31 17:01:56 2011
@@ -22,14 +22,13 @@ package org.apache.axiom.soap;
import org.apache.axiom.om.AbstractTestCase;
import org.apache.axiom.om.OMAbstractFactory;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.axiom.om.impl.llom.factory.OMXMLBuilderFactory;
-import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.soap.impl.llom.soap11.SOAP11Factory;
public class CashWihBuildElementTest extends AbstractTestCase {
- StAXOMBuilder stAXOMBuilder;
+ OMXMLParserWrapper stAXOMBuilder;
private OMElement rootElement;
/**
@@ -41,10 +40,9 @@ public class CashWihBuildElementTest ext
protected void setUp() throws Exception {
stAXOMBuilder =
- OMXMLBuilderFactory.createStAXOMBuilder(
+ OMXMLBuilderFactory.createOMBuilder(
OMAbstractFactory.getSOAP11Factory(),
- StAXUtils.createXMLStreamReader(
- getTestResource("non_soap.xml")));
+ getTestResource("non_soap.xml"));
rootElement = stAXOMBuilder.getDocumentElement();
}
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPEnvelopeBuildTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPEnvelopeBuildTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPEnvelopeBuildTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/SOAPEnvelopeBuildTest.java
Thu Mar 31 17:01:56 2011
@@ -28,8 +28,9 @@ import junit.framework.TestCase;
import org.apache.axiom.om.util.CommonUtils;
import org.apache.axiom.om.util.StAXUtils;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.om.OMXMLParserWrapper;
import org.apache.axiom.soap.SOAPBody;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.SOAPHeader;
@@ -91,8 +92,7 @@ public class SOAPEnvelopeBuildTest exten
}
public void testBodyPreservedSerializeAndConsumeAsXML() throws Exception{
- XMLStreamReader parser = StAXUtils.createXMLStreamReader(new
StringReader(testMessage));
- StAXOMBuilder sob = new StAXOMBuilder(parser);
+ OMXMLParserWrapper sob =
OMXMLBuilderFactory.createOMBuilder(new StringReader(testMessage));
OMElement se = sob.getDocumentElement();
OMElement sh = se.getFirstElement();
Iterator iter = sh.getChildElements();
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/soap/impl/llom/OMElementTest.java
Thu Mar 31 17:01:56 2011
@@ -27,7 +27,7 @@ import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMNamespace;
import org.apache.axiom.om.OMTestCase;
import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.impl.dom.DOOMAbstractFactory;
import org.apache.axiom.soap.SOAPEnvelope;
import org.apache.axiom.soap.impl.builder.StAXSOAPModelBuilder;
@@ -156,7 +156,7 @@ public class OMElementTest extends OMTes
doomElement.setText(text);
llomRoot.addChild(doomElement);
- OMElement newElement = (new StAXOMBuilder(this.factory, llomRoot
+ OMElement newElement =
(OMXMLBuilderFactory.createStAXOMBuilder(this.factory, llomRoot
.getXMLStreamReader())).getDocumentElement();
newElement.build();
OMElement secondElement = newElement.getFirstElement();
@@ -173,7 +173,7 @@ public class OMElementTest extends OMTes
OMText doomText = doomFactory.createOMText(text);
llomRoot.addChild(doomText);
- OMElement newElement = (new StAXOMBuilder(this.factory, llomRoot
+ OMElement newElement =
(OMXMLBuilderFactory.createStAXOMBuilder(this.factory, llomRoot
.getXMLStreamReader())).getDocumentElement();
newElement.build();
assertEquals(newElement.getText(), text);
@@ -189,7 +189,7 @@ public class OMElementTest extends OMTes
llomElement.setText(text);
doomRoot.addChild(llomElement);
- OMElement newElement = (new StAXOMBuilder(this.factory, doomRoot
+ OMElement newElement =
(OMXMLBuilderFactory.createStAXOMBuilder(this.factory, doomRoot
.getXMLStreamReader())).getDocumentElement();
newElement.build();
OMElement secondElement = newElement.getFirstElement();
@@ -208,7 +208,7 @@ public class OMElementTest extends OMTes
doomRoot.addChild(llomText);
doomRoot.addChild(comment);
- OMElement newElement = (new StAXOMBuilder(this.factory, doomRoot
+ OMElement newElement =
(OMXMLBuilderFactory.createStAXOMBuilder(this.factory, doomRoot
.getXMLStreamReader())).getDocumentElement();
newElement.build();
assertEquals(newElement.getText(), text);
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/WrappedTextNodeStreamReaderTest.java
Thu Mar 31 17:01:56 2011
@@ -27,7 +27,7 @@ import javax.xml.stream.XMLStreamReader;
import javax.xml.stream.XMLStreamWriter;
import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.om.impl.serialize.StreamingOMSerializer;
import org.apache.axiom.om.util.StAXUtils;
import org.apache.axiom.util.stax.WrappedTextNodeStreamReader;
@@ -44,7 +44,7 @@ public class WrappedTextNodeStreamReader
StringReader reader = new StringReader(testString);
XMLStreamReader xmlStreamReader
= new WrappedTextNodeStreamReader(wrapperElementName, reader,
chunkSize);
- OMElement element = new
StAXOMBuilder(xmlStreamReader).getDocumentElement();
+ OMElement element =
OMXMLBuilderFactory.createStAXOMBuilder(xmlStreamReader).getDocumentElement();
assertEquals(wrapperElementName, element.getQName());
assertEquals(wrapperElementName.getPrefix(),
element.getQName().getPrefix());
assertEquals(testString, element.getText());
@@ -136,7 +136,7 @@ public class WrappedTextNodeStreamReader
StringReader reader = new StringReader(testString);
XMLStreamReader xmlStreamReader
= new WrappedTextNodeStreamReader(wrapperElementName, reader,
chunkSize);
- OMElement element = new
StAXOMBuilder(xmlStreamReader).getDocumentElement();
+ OMElement element =
OMXMLBuilderFactory.createStAXOMBuilder(xmlStreamReader).getDocumentElement();
StringWriter writer = new StringWriter();
element.serializeAndConsume(writer);
assertXMLEqual(expectedXML, writer.toString());
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/xop/XOPRoundtripTest.java
URL:
http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/xop/XOPRoundtripTest.java?rev=1087372&r1=1087371&r2=1087372&view=diff
==============================================================================
---
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/xop/XOPRoundtripTest.java
(original)
+++
webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/util/stax/xop/XOPRoundtripTest.java
Thu Mar 31 17:01:56 2011
@@ -29,7 +29,7 @@ import org.apache.axiom.om.OMAbstractFac
import org.apache.axiom.om.OMElement;
import org.apache.axiom.om.OMFactory;
import org.apache.axiom.om.OMText;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.axiom.om.OMXMLBuilderFactory;
import org.apache.axiom.testutils.activation.TestDataSource;
public class XOPRoundtripTest extends TestCase {
@@ -42,7 +42,7 @@ public class XOPRoundtripTest extends Te
XOPEncodingStreamReader encodedReader = new
XOPEncodingStreamReader(originalReader,
ContentIDGenerator.DEFAULT, OptimizationPolicy.DEFAULT);
XMLStreamReader decodedReader = new
XOPDecodingStreamReader(encodedReader, encodedReader);
- OMElement element2 = new
StAXOMBuilder(decodedReader).getDocumentElement();
+ OMElement element2 =
OMXMLBuilderFactory.createStAXOMBuilder(decodedReader).getDocumentElement();
OMText child = (OMText)element2.getFirstOMChild();
assertNotNull(child);
assertTrue(child.isBinary());