Return-Path: X-Original-To: apmail-cxf-commits-archive@www.apache.org Delivered-To: apmail-cxf-commits-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 1C61C10B5B for ; Tue, 3 Sep 2013 18:45:56 +0000 (UTC) Received: (qmail 96649 invoked by uid 500); 3 Sep 2013 18:45:51 -0000 Delivered-To: apmail-cxf-commits-archive@cxf.apache.org Received: (qmail 96588 invoked by uid 500); 3 Sep 2013 18:45:17 -0000 Mailing-List: contact commits-help@cxf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@cxf.apache.org Delivered-To: mailing list commits@cxf.apache.org Received: (qmail 96554 invoked by uid 99); 3 Sep 2013 18:45:10 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Sep 2013 18:45:10 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 03 Sep 2013 18:45:05 +0000 Received: from eris.apache.org (localhost [127.0.0.1]) by eris.apache.org (Postfix) with ESMTP id 69D4C2388900; Tue, 3 Sep 2013 18:44:45 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1519790 [1/2] - in /cxf/trunk: core/src/main/java/org/apache/cxf/helpers/ core/src/main/java/org/apache/cxf/service/factory/ core/src/test/java/org/apache/cxf/feature/transform/ core/src/test/java/org/apache/cxf/staxutils/ rt/bindings/soap... Date: Tue, 03 Sep 2013 18:44:43 -0000 To: commits@cxf.apache.org From: dkulp@apache.org X-Mailer: svnmailer-1.0.9 Message-Id: <20130903184445.69D4C2388900@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: dkulp Date: Tue Sep 3 18:44:41 2013 New Revision: 1519790 URL: http://svn.apache.org/r1519790 Log: remove the DOMUtils.readXML methods as all XML reading should be using StaxUtils Modified: cxf/trunk/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java cxf/trunk/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java cxf/trunk/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java cxf/trunk/core/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/SourceProviderTest.java cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java cxf/trunk/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java cxf/trunk/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java cxf/trunk/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedOutInterceptor.java cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/CertConstraintsTest.java cxf/trunk/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/misc/FilterEvaluationTest.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/Wsdl11XPointerDomainExpression.java cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertionBuilderTest.java cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AbstractSpringConfiguredAutoRewriteSoapAddressTest.java cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFFilterTest.java cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringAutoPublishServletTest.java cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java cxf/trunk/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java cxf/trunk/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java Modified: cxf/trunk/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java (original) +++ cxf/trunk/core/src/main/java/org/apache/cxf/helpers/DOMUtils.java Tue Sep 3 18:44:41 2013 @@ -20,8 +20,6 @@ package org.apache.cxf.helpers; import java.io.IOException; -import java.io.InputStream; -import java.io.Reader; import java.io.StringReader; import java.util.ArrayList; import java.util.Collections; @@ -37,7 +35,6 @@ import javax.xml.namespace.QName; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.stream.StreamSource; import org.w3c.dom.Attr; import org.w3c.dom.Comment; @@ -525,74 +522,7 @@ public final class DOMUtils { return new InputSource(new StringReader("")); } } - - /** - * Read XML as DOM. - */ - public static Document readXml(InputStream is) throws SAXException, IOException, - ParserConfigurationException { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - - dbf.setValidating(false); - dbf.setIgnoringComments(false); - dbf.setIgnoringElementContentWhitespace(true); - dbf.setNamespaceAware(true); - // dbf.setCoalescing(true); - // dbf.setExpandEntityReferences(true); - - DocumentBuilder db = null; - db = dbf.newDocumentBuilder(); - db.setEntityResolver(new NullResolver()); - - // db.setErrorHandler( new MyErrorHandler()); - - return db.parse(is); - } - - public static Document readXml(Reader is) throws SAXException, IOException, ParserConfigurationException { - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - - dbf.setValidating(false); - dbf.setIgnoringComments(false); - dbf.setIgnoringElementContentWhitespace(true); - dbf.setNamespaceAware(true); - // dbf.setCoalescing(true); - // dbf.setExpandEntityReferences(true); - - DocumentBuilder db = null; - db = dbf.newDocumentBuilder(); - db.setEntityResolver(new NullResolver()); - - // db.setErrorHandler( new MyErrorHandler()); - InputSource ips = new InputSource(is); - return db.parse(ips); - } - - public static Document readXml(StreamSource is) throws SAXException, IOException, - ParserConfigurationException { - - DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance(); - - dbf.setValidating(false); - dbf.setIgnoringComments(false); - dbf.setIgnoringElementContentWhitespace(true); - dbf.setNamespaceAware(true); - // dbf.setCoalescing(true); - // dbf.setExpandEntityReferences(true); - - DocumentBuilder db = null; - db = dbf.newDocumentBuilder(); - db.setEntityResolver(new NullResolver()); - - // db.setErrorHandler( new MyErrorHandler()); - InputSource is2 = new InputSource(); - is2.setSystemId(is.getSystemId()); - is2.setByteStream(is.getInputStream()); - is2.setCharacterStream(is.getReader()); - - return db.parse(is2); - } - + public static String getPrefixRecursive(Element el, String ns) { String prefix = getPrefix(el, ns); if (prefix == null && el.getParentNode() instanceof Element) { Modified: cxf/trunk/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java (original) +++ cxf/trunk/core/src/main/java/org/apache/cxf/service/factory/AbstractServiceFactoryBean.java Tue Sep 3 18:44:41 2013 @@ -37,13 +37,13 @@ import org.apache.cxf.common.logging.Log import org.apache.cxf.common.util.ModCountCopyOnWriteArrayList; import org.apache.cxf.databinding.AbstractDataBinding; import org.apache.cxf.databinding.DataBinding; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.interceptor.OneWayProcessorInterceptor; import org.apache.cxf.interceptor.OutgoingChainInterceptor; import org.apache.cxf.interceptor.ServiceInvokerInterceptor; import org.apache.cxf.resource.ResourceManager; import org.apache.cxf.resource.URIResolver; import org.apache.cxf.service.Service; +import org.apache.cxf.staxutils.StaxUtils; public abstract class AbstractServiceFactoryBean { private static final Logger LOG = LogUtils.getL7dLogger(AbstractServiceFactoryBean.class); @@ -146,7 +146,7 @@ public abstract class AbstractServiceFac } Document d; try { - d = DOMUtils.readXml(url.openStream()); + d = StaxUtils.read(url.openStream()); } catch (Exception e) { throw new ServiceConstructionException(new Message("ERROR_READING_SCHEMA", LOG, l), e); } Modified: cxf/trunk/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java (original) +++ cxf/trunk/core/src/test/java/org/apache/cxf/feature/transform/XSLTInterceptorsTest.java Tue Sep 3 18:44:41 2013 @@ -38,7 +38,6 @@ import org.w3c.dom.NodeList; import org.xml.sax.SAXException; import org.apache.cxf.common.classloader.ClassLoaderUtils; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.io.CachedOutputStream; import org.apache.cxf.io.CachedWriter; @@ -74,11 +73,11 @@ public class XSLTInterceptorsTest { } @Test - public void inStreamTest() throws SAXException, IOException, ParserConfigurationException { + public void inStreamTest() throws Exception { message.setContent(InputStream.class, messageIS); inInterceptor.handleMessage(message); InputStream transformedIS = message.getContent(InputStream.class); - Document doc = DOMUtils.readXml(transformedIS); + Document doc = StaxUtils.read(transformedIS); Assert.assertTrue("Message was not transformed", checkTransformedXML(doc)); } @@ -93,17 +92,17 @@ public class XSLTInterceptorsTest { } @Test - public void inReaderTest() throws SAXException, IOException, ParserConfigurationException { + public void inReaderTest() throws Exception { Reader reader = new InputStreamReader(messageIS); message.setContent(Reader.class, reader); inInterceptor.handleMessage(message); Reader transformedReader = message.getContent(Reader.class); - Document doc = DOMUtils.readXml(transformedReader); + Document doc = StaxUtils.read(transformedReader); Assert.assertTrue("Message was not transformed", checkTransformedXML(doc)); } @Test - public void outStreamTest() throws SAXException, IOException, ParserConfigurationException { + public void outStreamTest() throws Exception { CachedOutputStream cos = new CachedOutputStream(); cos.holdTempFile(); message.setContent(OutputStream.class, cos); @@ -112,7 +111,7 @@ public class XSLTInterceptorsTest { IOUtils.copy(messageIS, os); os.close(); cos.releaseTempFileHold(); - Document doc = DOMUtils.readXml(cos.getInputStream()); + Document doc = StaxUtils.read(cos.getInputStream()); Assert.assertTrue("Message was not transformed", checkTransformedXML(doc)); } @@ -127,19 +126,19 @@ public class XSLTInterceptorsTest { StaxUtils.copy(new StreamSource(messageIS), tXWriter); tXWriter.close(); cWriter.releaseTempFileHold(); - Document doc = DOMUtils.readXml(cWriter.getReader()); + Document doc = StaxUtils.read(cWriter.getReader()); Assert.assertTrue("Message was not transformed", checkTransformedXML(doc)); } @Test - public void outWriterStreamTest() throws IOException, SAXException, ParserConfigurationException { + public void outWriterStreamTest() throws Exception { CachedWriter cWriter = new CachedWriter(); message.setContent(Writer.class, cWriter); outInterceptor.handleMessage(message); Writer tWriter = message.getContent(Writer.class); IOUtils.copy(new InputStreamReader(messageIS), tWriter, IOUtils.DEFAULT_BUFFER_SIZE); tWriter.close(); - Document doc = DOMUtils.readXml(cWriter.getReader()); + Document doc = StaxUtils.read(cWriter.getReader()); Assert.assertTrue("Message was not transformed", checkTransformedXML(doc)); } Modified: cxf/trunk/core/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/core/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/core/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java (original) +++ cxf/trunk/core/src/test/java/org/apache/cxf/staxutils/W3CDOMStreamReaderTest.java Tue Sep 3 18:44:41 2013 @@ -33,7 +33,6 @@ import javax.xml.transform.dom.DOMSource import org.w3c.dom.Document; import org.w3c.dom.Element; -import org.apache.cxf.helpers.DOMUtils; import org.junit.Assert; import org.junit.Test; @@ -76,7 +75,7 @@ public class W3CDOMStreamReaderTest exte ByteArrayInputStream is = new ByteArrayInputStream( "gorilla" .getBytes("utf-8")); - Document doc = DOMUtils.readXml(is); + Document doc = StaxUtils.read(is); Element e = doc.getDocumentElement(); XMLStreamReader reader = StaxUtils.createXMLStreamReader(e); String value = reader.getElementText(); Modified: cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java (original) +++ cxf/trunk/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/interceptor/SoapFaultSerializerTest.java Tue Sep 3 18:44:41 2013 @@ -46,7 +46,6 @@ import org.apache.cxf.binding.soap.inter import org.apache.cxf.binding.soap.interceptor.Soap12FaultOutInterceptor.Soap12FaultOutInterceptorInternal; import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor; import org.apache.cxf.binding.soap.saaj.SAAJInInterceptor.SAAJPreInInterceptor; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.helpers.XPathUtils; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.message.ExchangeImpl; @@ -96,7 +95,7 @@ public class SoapFaultSerializerTest ext writer.writeEndDocument(); writer.close(); - Document faultDoc = DOMUtils.readXml(new ByteArrayInputStream(out.toByteArray())); + Document faultDoc = StaxUtils.read(new ByteArrayInputStream(out.toByteArray())); assertValid("//s:Fault/faultcode[text()='ns1:Client']", faultDoc); assertValid("//s:Fault/faultstring[text()='" + faultString + "']", faultDoc); @@ -140,7 +139,7 @@ public class SoapFaultSerializerTest ext writer.writeEndDocument(); writer.close(); - Document faultDoc = DOMUtils.readXml(new ByteArrayInputStream(out.toByteArray())); + Document faultDoc = StaxUtils.read(new ByteArrayInputStream(out.toByteArray())); assertValid("//soap12env:Fault/soap12env:Code/soap12env:Value[text()='ns1:Sender']", faultDoc); @@ -193,7 +192,7 @@ public class SoapFaultSerializerTest ext writer.writeEndDocument(); writer.close(); - Document faultDoc = DOMUtils.readXml(new ByteArrayInputStream(out.toByteArray())); + Document faultDoc = StaxUtils.read(new ByteArrayInputStream(out.toByteArray())); assertValid("//soap12env:Fault/soap12env:Code/soap12env:Value[text()='ns1:Sender']", faultDoc); Modified: cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java (original) +++ cxf/trunk/rt/databinding/aegis/src/test/java/org/apache/cxf/aegis/type/basic/BeanTest.java Tue Sep 3 18:44:41 2013 @@ -41,7 +41,6 @@ import org.apache.cxf.aegis.type.TypeCre import org.apache.cxf.aegis.type.TypeMapping; import org.apache.cxf.aegis.xml.stax.ElementReader; import org.apache.cxf.aegis.xml.stax.ElementWriter; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.staxutils.StaxUtils; import org.apache.ws.commons.schema.XmlSchema; import org.apache.ws.commons.schema.XmlSchemaAttribute; @@ -250,7 +249,7 @@ public class BeanTest extends AbstractAe bos.close(); - Document doc = DOMUtils.readXml(new ByteArrayInputStream(bos.toByteArray())); + Document doc = StaxUtils.read(new ByteArrayInputStream(bos.toByteArray())); Element element = doc.getDocumentElement(); addNamespace("b2", "urn:Bean2"); Modified: cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java (original) +++ cxf/trunk/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/utils/ResourceUtils.java Tue Sep 3 18:44:41 2013 @@ -91,6 +91,7 @@ import org.apache.cxf.jaxrs.model.UserRe import org.apache.cxf.jaxrs.provider.JAXBElementProvider; import org.apache.cxf.message.Message; import org.apache.cxf.resource.ResourceManager; +import org.apache.cxf.staxutils.StaxUtils; public final class ResourceUtils { @@ -506,7 +507,7 @@ public final class ResourceUtils { } public static List getUserResources(InputStream is) throws Exception { - Document doc = DOMUtils.readXml(new InputStreamReader(is, "UTF-8")); + Document doc = StaxUtils.read(new InputStreamReader(is, "UTF-8")); return getResourcesFromElement(doc.getDocumentElement()); } Modified: cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/SourceProviderTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/SourceProviderTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/SourceProviderTest.java (original) +++ cxf/trunk/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/provider/SourceProviderTest.java Tue Sep 3 18:44:41 2013 @@ -40,7 +40,6 @@ import javax.xml.transform.stream.Stream import org.w3c.dom.Document; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.jaxrs.ext.MessageContext; import org.apache.cxf.jaxrs.ext.MessageContextImpl; import org.apache.cxf.jaxrs.impl.MetadataMap; @@ -110,7 +109,7 @@ public class SourceProviderTest extends public void testWriteToDocument() throws Exception { SourceProvider p = new SourceProvider(); - Document doc = DOMUtils.readXml(new StringReader("")); + Document doc = StaxUtils.read(new StringReader("")); ByteArrayOutputStream os = new ByteArrayOutputStream(); Modified: cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java (original) +++ cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/dispatch/DispatchTest.java Tue Sep 3 18:44:41 2013 @@ -37,7 +37,6 @@ import org.apache.cxf.Bus; import org.apache.cxf.binding.soap.SoapMessage; import org.apache.cxf.binding.soap.interceptor.AbstractSoapInterceptor; import org.apache.cxf.bus.spring.SpringBusFactory; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.interceptor.Fault; import org.apache.cxf.interceptor.Interceptor; import org.apache.cxf.interceptor.LoggingInInterceptor; @@ -49,10 +48,12 @@ import org.apache.cxf.message.Message; import org.apache.cxf.phase.Phase; import org.apache.cxf.service.model.BindingOperationInfo; import org.apache.cxf.service.model.EndpointInfo; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.transport.Destination; import org.apache.hello_world_soap_http.SOAPService; import org.apache.hello_world_soap_http.types.SayHi; import org.apache.hello_world_soap_http.types.SayHiResponse; + import org.junit.Before; import org.junit.Test; @@ -103,7 +104,7 @@ public class DispatchTest extends Abstra d.setMessageObserver(new MessageReplayObserver("/org/apache/cxf/jaxws/sayHiResponse.xml")); - Document doc = DOMUtils.readXml(getResourceAsStream("/org/apache/cxf/jaxws/sayHi2.xml")); + Document doc = StaxUtils.read(getResourceAsStream("/org/apache/cxf/jaxws/sayHi2.xml")); DOMSource source = new DOMSource(doc); Source res = disp.invoke(source); assertNotNull(res); @@ -183,7 +184,7 @@ public class DispatchTest extends Abstra BindingOperationVerifier bov = new BindingOperationVerifier(); ((DispatchImpl)disp).getClient().getOutInterceptors().add(bov); - Document doc = DOMUtils.readXml(getResourceAsStream("/org/apache/cxf/jaxws/sayHi2.xml")); + Document doc = StaxUtils.read(getResourceAsStream("/org/apache/cxf/jaxws/sayHi2.xml")); DOMSource source = new DOMSource(doc); Source res = disp.invoke(source); assertNotNull(res); Modified: cxf/trunk/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java (original) +++ cxf/trunk/rt/rs/description/src/main/java/org/apache/cxf/jaxrs/model/wadl/WadlGenerator.java Tue Sep 3 18:44:41 2013 @@ -269,7 +269,7 @@ public class WadlGenerator implements Co return entity; } try { - return DOMUtils.readXml(new StringReader(entity)); + return StaxUtils.read(new StringReader(entity)); } catch (Exception ex) { throw new InternalServerErrorException(ex); } @@ -888,7 +888,7 @@ public class WadlGenerator implements Co try { InputStream is = ResourceUtils.getResourceStream(loc, (Bus)ep.get(Bus.class.getName())); if (is != null) { - Element appEl = DOMUtils.readXml(is).getDocumentElement(); + Element appEl = StaxUtils.read(is).getDocumentElement(); List grammarEls = DOMUtils.getChildrenWithName(appEl, WadlGenerator.WADL_NS, "grammars"); @@ -934,7 +934,7 @@ public class WadlGenerator implements Co } InputStream is = ResourceUtils.getResourceStream(loc, (Bus)ep.get(Bus.class.getName())); if (is != null) { - Element docEl = DOMUtils.readXml(is).getDocumentElement(); + Element docEl = StaxUtils.read(is).getDocumentElement(); if (fragmentIndex != -1) { List grammarEls = DOMUtils.getChildrenWithName(docEl, WadlGenerator.WADL_NS, "grammars"); Modified: cxf/trunk/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java (original) +++ cxf/trunk/rt/rs/description/src/test/java/org/apache/cxf/jaxrs/model/wadl/WadlGeneratorTest.java Tue Sep 3 18:44:41 2013 @@ -53,6 +53,7 @@ import org.apache.cxf.message.MessageImp import org.apache.cxf.service.Service; import org.apache.cxf.service.model.BindingInfo; import org.apache.cxf.service.model.EndpointInfo; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.transport.servlet.ServletDestination; import org.apache.ws.commons.schema.constants.Constants; import org.easymock.EasyMock; @@ -90,7 +91,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/bookstore/1", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); checkGrammars(doc.getDocumentElement(), "thebook", "thebook2", "thechapter"); List els = getWadlResourcesInfo(doc, "http://localhost:8080/baz", 1); checkBookStoreInfo(els.get(0), "prefix1:thebook", "prefix1:thebook2", "prefix1:thechapter"); @@ -106,7 +107,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/bar", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); List grammarEls = DOMUtils.getChildrenWithName(doc.getDocumentElement(), WadlGenerator.WADL_NS, "grammars"); assertEquals(1, grammarEls.size()); @@ -141,7 +142,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/bookstore/1", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); checkGrammarsWithLinks(doc.getDocumentElement(), Collections.singletonList("http://books.xsd")); List els = getWadlResourcesInfo(doc, "http://localhost:8080/baz", 1); checkBookStoreInfo(els.get(0), "prefix1:thebook", "prefix1:thebook2", "prefix1:thechapter"); @@ -157,7 +158,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/bookstore/1", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); checkGrammarsWithLinks(doc.getDocumentElement(), Collections.singletonList("http://localhost:8080/baz/books.xsd")); List els = getWadlResourcesInfo(doc, "http://localhost:8080/baz", 1); @@ -175,7 +176,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/bookstore/1", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); checkGrammarsWithLinks(doc.getDocumentElement(), Collections.singletonList("http://books")); List els = getWadlResourcesInfo(doc, "http://localhost:8080/baz", 1); @@ -193,7 +194,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/bookstore/1", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); checkGrammars(doc.getDocumentElement(), "book", "book2", "chapter"); List els = getWadlResourcesInfo(doc, "http://localhost:8080/baz", 1); checkBookStoreInfo(els.get(0), "prefix1:book", "prefix1:book2", "prefix1:chapter"); @@ -209,7 +210,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/bookstore/1", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); checkDocs(doc.getDocumentElement(), "My Application", "", ""); checkGrammars(doc.getDocumentElement(), "thebook", "books", "thebook2", "thechapter"); List els = getWadlResourcesInfo(doc, "http://localhost:8080/baz", 1); @@ -230,7 +231,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); checkDocs(doc.getDocumentElement(), "My Application", "", ""); List grammarEls = DOMUtils.getChildrenWithName(doc.getDocumentElement(), WadlGenerator.WADL_NS, @@ -258,7 +259,7 @@ public class WadlGeneratorTest extends A Message m = mockMessage("http://localhost:8080/baz", "/", WadlGenerator.WADL_QUERY, cri); Response r = handleRequest(wg, m); checkResponse(r); - Document doc = DOMUtils.readXml(new StringReader(r.getEntity().toString())); + Document doc = StaxUtils.read(new StringReader(r.getEntity().toString())); List rootEls = getWadlResourcesInfo(doc, "http://localhost:8080/baz", 1); assertEquals(1, rootEls.size()); Element resource = rootEls.get(0); @@ -303,7 +304,7 @@ public class WadlGeneratorTest extends A assertEquals(WadlGenerator.WADL_TYPE.toString(), r.getMetadata().getFirst(HttpHeaders.CONTENT_TYPE).toString()); String wadl = r.getEntity().toString(); - Document doc = DOMUtils.readXml(new StringReader(wadl)); + Document doc = StaxUtils.read(new StringReader(wadl)); checkGrammars(doc.getDocumentElement(), "thebook", "books", "thebook2", "thechapter"); List els = getWadlResourcesInfo(doc, "http://localhost:8080/baz", 2); checkBookStoreInfo(els.get(0), "prefix1:thebook", "prefix1:thebook2", "prefix1:thechapter"); Modified: cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java (original) +++ cxf/trunk/rt/rs/extensions/providers/src/main/java/org/apache/cxf/jaxrs/provider/dom4j/DOM4JProvider.java Tue Sep 3 18:44:41 2013 @@ -35,7 +35,7 @@ import javax.ws.rs.ext.MessageBodyReader import javax.ws.rs.ext.MessageBodyWriter; import javax.ws.rs.ext.Providers; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; @javax.ws.rs.Produces({"application/xml", "text/xml", "application/json" }) @javax.ws.rs.Consumes({"application/xml", "text/xml", "application/json" }) @@ -104,7 +104,7 @@ public class DOM4JProvider implements Me private org.w3c.dom.Document convertToDOM(org.dom4j.Document doc) { String xml = doc.asXML(); try { - return DOMUtils.readXml(new StringReader(xml)); + return StaxUtils.read(new StringReader(xml)); } catch (Exception ex) { throw new javax.ws.rs.InternalServerErrorException(ex); } Modified: cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java (original) +++ cxf/trunk/rt/rs/extensions/providers/src/test/java/org/apache/cxf/jaxrs/provider/json/JSONProviderTest.java Tue Sep 3 18:44:41 2013 @@ -62,7 +62,6 @@ import org.w3c.dom.Document; import org.apache.cxf.common.util.StringUtils; import org.apache.cxf.helpers.CastUtils; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.jaxrs.impl.MetadataMap; import org.apache.cxf.jaxrs.provider.JAXBElementProvider; import org.apache.cxf.jaxrs.resources.Book; @@ -509,7 +508,7 @@ public class JSONProviderTest extends As new JAXBElementProvider().writeTo(tag, TagVO.class, TagVO.class, TagVO.class.getAnnotations(), MediaType.APPLICATION_XML_TYPE, new MetadataMap(), os); - Document doc = DOMUtils.readXml(new StringReader(os.toString())); + Document doc = StaxUtils.read(new StringReader(os.toString())); ByteArrayOutputStream os2 = new ByteArrayOutputStream(); @@ -610,7 +609,7 @@ public class JSONProviderTest extends As @Test public void testDropRootElementFromDocument() throws Exception { JSONProvider p = new JSONProvider(); - Document doc = DOMUtils.readXml(new StringReader("2")); + Document doc = StaxUtils.read(new StringReader("2")); p.setDropRootElement(true); ByteArrayOutputStream os = new ByteArrayOutputStream(); Modified: cxf/trunk/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java (original) +++ cxf/trunk/rt/rs/security/oauth-parent/oauth2-saml/src/main/java/org/apache/cxf/rs/security/oauth2/grants/saml/Saml2BearerGrantHandler.java Tue Sep 3 18:44:41 2013 @@ -35,7 +35,6 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.apache.cxf.common.util.Base64Exception; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.jaxrs.utils.HttpUtils; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageUtils; @@ -57,6 +56,7 @@ import org.apache.cxf.rs.security.saml.a import org.apache.cxf.rs.security.saml.authorization.SecurityContextProviderImpl; import org.apache.cxf.security.SecurityContext; import org.apache.cxf.security.transport.TLSSessionInfo; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.ws.security.SecurityConstants; import org.apache.wss4j.common.saml.SAMLKeyInfo; import org.apache.wss4j.common.saml.SAMLUtil; @@ -163,7 +163,7 @@ public class Saml2BearerGrantHandler ext protected Element readToken(InputStream tokenStream) { try { - Document doc = DOMUtils.readXml(new InputStreamReader(tokenStream, "UTF-8")); + Document doc = StaxUtils.read(new InputStreamReader(tokenStream, "UTF-8")); return doc.getDocumentElement(); } catch (Exception ex) { throw new OAuthServiceException(OAuthConstants.INVALID_GRANT); Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java (original) +++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/AbstractServiceProviderFilter.java Tue Sep 3 18:44:41 2013 @@ -52,6 +52,7 @@ import org.apache.cxf.rs.security.saml.a import org.apache.cxf.rs.security.saml.sso.state.RequestState; import org.apache.cxf.rs.security.saml.sso.state.ResponseState; import org.apache.cxf.security.SecurityContext; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.wss4j.common.saml.OpenSAMLUtil; import org.apache.wss4j.common.saml.SamlAssertionWrapper; import org.opensaml.saml2.core.AuthnRequest; @@ -167,7 +168,7 @@ public abstract class AbstractServicePro String assertion = responseState.getAssertion(); SamlAssertionWrapper assertionWrapper = new SamlAssertionWrapper( - DOMUtils.readXml(new StringReader(assertion)).getDocumentElement()); + StaxUtils.read(new StringReader(assertion)).getDocumentElement()); setSecurityContext(m, assertionWrapper); } catch (Exception ex) { reportError("INVALID_RESPONSE_STATE"); Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java (original) +++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/RequestAssertionConsumerService.java Tue Sep 3 18:44:41 2013 @@ -52,11 +52,11 @@ import org.apache.cxf.common.logging.Log import org.apache.cxf.common.util.Base64Exception; import org.apache.cxf.common.util.Base64Utility; import org.apache.cxf.common.util.StringUtils; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.jaxrs.ext.MessageContext; import org.apache.cxf.rs.security.saml.DeflateEncoderDecoder; import org.apache.cxf.rs.security.saml.sso.state.RequestState; import org.apache.cxf.rs.security.saml.sso.state.ResponseState; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.saml.OpenSAMLUtil; import org.apache.wss4j.common.util.DOM2Writer; @@ -254,7 +254,7 @@ public class RequestAssertionConsumerSer Document responseDoc = null; try { - responseDoc = DOMUtils.readXml(new InputStreamReader(tokenStream, "UTF-8")); + responseDoc = StaxUtils.read(new InputStreamReader(tokenStream, "UTF-8")); } catch (Exception ex) { throw new WebApplicationException(400); } Modified: cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java (original) +++ cxf/trunk/rt/rs/security/sso/saml/src/main/java/org/apache/cxf/rs/security/saml/sso/SAMLProtocolResponseValidator.java Tue Sep 3 18:44:41 2013 @@ -36,9 +36,9 @@ import org.w3c.dom.NodeList; import org.apache.cxf.common.logging.LogUtils; import org.apache.cxf.common.util.Base64Exception; import org.apache.cxf.common.util.Base64Utility; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.rs.security.common.SecurityUtils; import org.apache.cxf.rs.security.xml.EncryptionUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.wss4j.common.crypto.Crypto; import org.apache.wss4j.common.ext.WSSecurityException; import org.apache.wss4j.common.saml.SAMLKeyInfo; @@ -440,7 +440,7 @@ public class SAMLProtocolResponseValidat Document payloadDoc = null; try { - payloadDoc = DOMUtils.readXml(new InputStreamReader(new ByteArrayInputStream(decryptedPayload), + payloadDoc = StaxUtils.read(new InputStreamReader(new ByteArrayInputStream(decryptedPayload), "UTF-8")); return payloadDoc.getDocumentElement(); } catch (Exception ex) { Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java (original) +++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/AbstractSamlInHandler.java Tue Sep 3 18:44:41 2013 @@ -38,7 +38,6 @@ import org.w3c.dom.Element; import org.w3c.dom.Node; import org.apache.cxf.common.logging.LogUtils; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.message.Message; import org.apache.cxf.message.MessageUtils; import org.apache.cxf.rs.security.common.CryptoLoader; @@ -47,6 +46,7 @@ import org.apache.cxf.rs.security.saml.a import org.apache.cxf.rs.security.saml.authorization.SecurityContextProviderImpl; import org.apache.cxf.security.SecurityContext; import org.apache.cxf.security.transport.TLSSessionInfo; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.ws.security.SecurityConstants; import org.apache.wss4j.common.saml.OpenSAMLUtil; import org.apache.wss4j.common.saml.SAMLKeyInfo; @@ -95,7 +95,7 @@ public abstract class AbstractSamlInHand protected Element readToken(Message message, InputStream tokenStream) { try { - Document doc = DOMUtils.readXml(new InputStreamReader(tokenStream, "UTF-8")); + Document doc = StaxUtils.read(new InputStreamReader(tokenStream, "UTF-8")); return doc.getDocumentElement(); } catch (Exception ex) { throwFault("Assertion can not be read as XML document", ex); Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java (original) +++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedInHandler.java Tue Sep 3 18:44:41 2013 @@ -33,6 +33,7 @@ import org.w3c.dom.NodeList; import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.jaxrs.utils.JAXRSUtils; import org.apache.cxf.message.Message; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.staxutils.W3CDOMStreamReader; public class SamlEnvelopedInHandler extends AbstractSamlInHandler { @@ -57,7 +58,7 @@ public class SamlEnvelopedInHandler exte InputStream is = message.getContent(InputStream.class); if (is != null) { try { - doc = DOMUtils.readXml(new InputStreamReader(is, "UTF-8")); + doc = StaxUtils.read(new InputStreamReader(is, "UTF-8")); } catch (Exception ex) { throwFault("Invalid XML payload", ex); } Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedOutInterceptor.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedOutInterceptor.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedOutInterceptor.java (original) +++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/saml/SamlEnvelopedOutInterceptor.java Tue Sep 3 18:44:41 2013 @@ -101,7 +101,7 @@ public class SamlEnvelopedOutInterceptor // DOMs CachedOutputStream bos = new CachedOutputStream(); StaxUtils.writeTo(newDoc, bos); - return DOMUtils.readXml(bos.getInputStream()); + return StaxUtils.read(bos.getInputStream()); } else { return newDoc; } Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java (original) +++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlEncInHandler.java Tue Sep 3 18:44:41 2013 @@ -35,11 +35,11 @@ import org.w3c.dom.Element; import org.apache.cxf.common.util.Base64Exception; import org.apache.cxf.common.util.Base64Utility; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.message.Message; import org.apache.cxf.rs.security.common.CryptoLoader; import org.apache.cxf.rs.security.common.SecurityUtils; import org.apache.cxf.rs.security.common.TrustValidator; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.staxutils.W3CDOMStreamReader; import org.apache.cxf.ws.security.SecurityConstants; import org.apache.wss4j.common.crypto.Crypto; @@ -83,7 +83,7 @@ public abstract class AbstractXmlEncInHa Document payloadDoc = null; try { - payloadDoc = DOMUtils.readXml(new InputStreamReader(new ByteArrayInputStream(decryptedPayload), + payloadDoc = StaxUtils.read(new InputStreamReader(new ByteArrayInputStream(decryptedPayload), "UTF-8")); } catch (Exception ex) { throwFault("Payload document can not be created", ex); Modified: cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java (original) +++ cxf/trunk/rt/rs/security/xml/src/main/java/org/apache/cxf/rs/security/xml/AbstractXmlSecInHandler.java Tue Sep 3 18:44:41 2013 @@ -32,8 +32,8 @@ import org.w3c.dom.Element; import org.w3c.dom.NodeList; import org.apache.cxf.common.logging.LogUtils; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.message.Message; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.staxutils.W3CDOMStreamReader; import org.apache.wss4j.dom.WSSConfig; @@ -62,7 +62,7 @@ public abstract class AbstractXmlSecInHa InputStream is = message.getContent(InputStream.class); if (is != null) { try { - doc = DOMUtils.readXml(new InputStreamReader(is, "UTF-8")); + doc = StaxUtils.read(new InputStreamReader(is, "UTF-8")); } catch (Exception ex) { throwFault("Invalid XML payload", ex); } Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java (original) +++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/spring/JettySpringTypesFactory.java Tue Sep 3 18:44:41 2013 @@ -37,7 +37,7 @@ import org.w3c.dom.Node; import org.apache.cxf.common.injection.NoJSR250Annotations; import org.apache.cxf.configuration.jsse.TLSServerParameters; import org.apache.cxf.configuration.jsse.TLSServerParametersConfig; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.transport.http_jetty.ThreadingParameters; import org.apache.cxf.transports.http_jetty.configuration.TLSServerParametersIdentifiedType; import org.apache.cxf.transports.http_jetty.configuration.ThreadingParametersIdentifiedType; @@ -83,7 +83,7 @@ public final class JettySpringTypesFacto public Map createThreadingParametersMap(String s, JAXBContext ctx) throws Exception { - Document doc = DOMUtils.readXml(new StringReader(s)); + Document doc = StaxUtils.read(new StringReader(s)); List threadingParametersIdentifiedTypes = JettySpringTypesFactory .parseListElement(doc.getDocumentElement(), @@ -98,7 +98,7 @@ public final class JettySpringTypesFacto public Map createTLSServerParametersMap(String s, JAXBContext ctx) throws Exception { - Document doc = DOMUtils.readXml(new StringReader(s)); + Document doc = StaxUtils.read(new StringReader(s)); List tlsServerParameters = JettySpringTypesFactory Modified: cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java (original) +++ cxf/trunk/rt/transports/http-jetty/src/test/java/org/apache/cxf/transport/http_jetty/spring/BeanDefinitionParsersTest.java Tue Sep 3 18:44:41 2013 @@ -21,14 +21,15 @@ package org.apache.cxf.transport.http_je import org.w3c.dom.Document; - -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.transport.http.spring.HttpConduitBeanDefinitionParser; import org.apache.cxf.transport.http.spring.HttpDestinationBeanDefinitionParser; import org.apache.cxf.transports.http.configuration.HTTPClientPolicy; import org.apache.cxf.transports.http.configuration.HTTPServerPolicy; + import org.junit.Assert; import org.junit.Test; + import org.springframework.beans.PropertyValue; import org.springframework.beans.factory.support.BeanDefinitionBuilder; @@ -41,7 +42,7 @@ public class BeanDefinitionParsersTest e HttpDestinationBeanDefinitionParser parser = new HttpDestinationBeanDefinitionParser(); - Document d = DOMUtils.readXml(getClass().getResourceAsStream("destination.xml")); + Document d = StaxUtils.read(getClass().getResourceAsStream("destination.xml")); parser.doParse(d.getDocumentElement(), null, bd); PropertyValue[] pvs = bd.getRawBeanDefinition().getPropertyValues().getPropertyValues(); @@ -56,7 +57,7 @@ public class BeanDefinitionParsersTest e HttpConduitBeanDefinitionParser parser = new HttpConduitBeanDefinitionParser(); - Document d = DOMUtils.readXml(getClass().getResourceAsStream("conduit.xml")); + Document d = StaxUtils.read(getClass().getResourceAsStream("conduit.xml")); parser.doParse(d.getDocumentElement(), null, bd); PropertyValue[] pvs = bd.getRawBeanDefinition().getPropertyValues().getPropertyValues(); Modified: cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java (original) +++ cxf/trunk/rt/transports/http-netty/netty-server/src/main/java/org/apache/cxf/transport/http/netty/server/spring/NettySpringTypesFactory.java Tue Sep 3 18:44:41 2013 @@ -37,7 +37,7 @@ import org.w3c.dom.Node; import org.apache.cxf.common.injection.NoJSR250Annotations; import org.apache.cxf.configuration.jsse.TLSServerParameters; import org.apache.cxf.configuration.jsse.TLSServerParametersConfig; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.transport.http.netty.server.ThreadingParameters; import org.apache.cxf.transports.http_netty_server.configuration.TLSServerParametersIdentifiedType; import org.apache.cxf.transports.http_netty_server.configuration.ThreadingParametersIdentifiedType; @@ -86,7 +86,7 @@ public final class NettySpringTypesFacto public Map createTLSServerParametersMap(String s, JAXBContext ctx) throws Exception { - Document doc = DOMUtils.readXml(new StringReader(s)); + Document doc = StaxUtils.read(new StringReader(s)); List tlsServerParameters = NettySpringTypesFactory @@ -103,7 +103,7 @@ public final class NettySpringTypesFacto public Map createThreadingParametersMap(String s, JAXBContext ctx) throws Exception { - Document doc = DOMUtils.readXml(new StringReader(s)); + Document doc = StaxUtils.read(new StringReader(s)); List threadingParametersIdentifiedTypes = NettySpringTypesFactory .parseListElement(doc.getDocumentElement(), Modified: cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/CertConstraintsTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/CertConstraintsTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/CertConstraintsTest.java (original) +++ cxf/trunk/rt/transports/http/src/test/java/org/apache/cxf/transport/https/CertConstraintsTest.java Tue Sep 3 18:44:41 2013 @@ -32,7 +32,7 @@ import javax.xml.bind.JAXBException; import javax.xml.bind.Unmarshaller; import org.apache.cxf.configuration.security.CertificateConstraintsType; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; public class CertConstraintsTest extends org.junit.Assert { @@ -168,7 +168,7 @@ public class CertConstraintsTest extends ) throws Exception { final java.io.InputStream inStream = CertConstraintsTest.class.getResourceAsStream(name); - return DOMUtils.readXml(inStream); + return StaxUtils.read(inStream); } private static T Modified: cxf/trunk/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/misc/FilterEvaluationTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/misc/FilterEvaluationTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/misc/FilterEvaluationTest.java (original) +++ cxf/trunk/rt/ws/eventing/src/test/java/org/apache/cxf/ws/eventing/misc/FilterEvaluationTest.java Tue Sep 3 18:44:41 2013 @@ -23,9 +23,11 @@ import java.io.CharArrayReader; import java.io.Reader; import org.w3c.dom.Document; -import org.apache.cxf.helpers.DOMUtils; + +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.ws.eventing.FilterType; import org.apache.cxf.ws.eventing.shared.utils.FilteringUtil; + import org.junit.Assert; import org.junit.Test; @@ -34,7 +36,7 @@ public class FilterEvaluationTest { @Test public void simpleFilterEvaluationPositive() throws Exception { Reader reader = new CharArrayReader("1".toCharArray()); - Document doc = DOMUtils.readXml(reader); + Document doc = StaxUtils.read(reader); FilterType filter = new FilterType(); filter.getContent().add("//tt"); Assert.assertTrue(FilteringUtil.doesConformToFilter(doc.getDocumentElement(), filter)); @@ -43,7 +45,7 @@ public class FilterEvaluationTest { @Test public void simpleFilterEvaluationNegative() throws Exception { Reader reader = new CharArrayReader("1".toCharArray()); - Document doc = DOMUtils.readXml(reader); + Document doc = StaxUtils.read(reader); FilterType filter = new FilterType(); filter.getContent().add("//ttx"); Assert.assertFalse(FilteringUtil.doesConformToFilter(doc.getDocumentElement(), filter)); Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/ExternalAttachmentProvider.java Tue Sep 3 18:44:41 2013 @@ -34,12 +34,12 @@ import org.apache.cxf.Bus; import org.apache.cxf.common.i18n.BundleUtils; import org.apache.cxf.common.i18n.Message; import org.apache.cxf.common.injection.NoJSR250Annotations; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.service.model.BindingFaultInfo; import org.apache.cxf.service.model.BindingMessageInfo; import org.apache.cxf.service.model.BindingOperationInfo; import org.apache.cxf.service.model.EndpointInfo; import org.apache.cxf.service.model.ServiceInfo; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.ws.policy.PolicyConstants; import org.apache.cxf.ws.policy.PolicyException; import org.apache.cxf.ws.policy.attachment.AbstractPolicyProvider; @@ -166,7 +166,7 @@ public class ExternalAttachmentProvider if (null == is) { throw new PolicyException(new Message("COULD_NOT_OPEN_ATTACHMENT_DOC_EXC", BUNDLE, location)); } - doc = DOMUtils.readXml(is); + doc = StaxUtils.read(is); } catch (Exception ex) { throw new PolicyException(ex); } Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/Wsdl11XPointerDomainExpression.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/Wsdl11XPointerDomainExpression.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/Wsdl11XPointerDomainExpression.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/external/Wsdl11XPointerDomainExpression.java Tue Sep 3 18:44:41 2013 @@ -28,7 +28,6 @@ import org.w3c.dom.NodeList; import org.xml.sax.InputSource; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.helpers.XPathUtils; import org.apache.cxf.resource.ExtendedURIResolver; import org.apache.cxf.service.model.BindingFaultInfo; @@ -39,6 +38,7 @@ import org.apache.cxf.service.model.Endp import org.apache.cxf.service.model.InterfaceInfo; import org.apache.cxf.service.model.OperationInfo; import org.apache.cxf.service.model.ServiceInfo; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.ws.policy.PolicyException; /** @@ -145,7 +145,7 @@ public class Wsdl11XPointerDomainExpress } Document doc = null; try { - doc = DOMUtils.readXml(is.getByteStream()); + doc = StaxUtils.read(is.getByteStream()); } catch (Exception ex) { throw new PolicyException(ex); } Modified: cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java (original) +++ cxf/trunk/rt/ws/policy/src/main/java/org/apache/cxf/ws/policy/attachment/reference/RemoteReferenceResolver.java Tue Sep 3 18:44:41 2013 @@ -24,8 +24,8 @@ import org.w3c.dom.Element; import org.xml.sax.InputSource; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.resource.ExtendedURIResolver; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.ws.policy.PolicyBuilder; import org.apache.cxf.ws.policy.PolicyConstants; import org.apache.cxf.ws.policy.PolicyException; @@ -55,7 +55,7 @@ public class RemoteReferenceResolver imp } Document doc = null; try { - doc = DOMUtils.readXml(is.getByteStream()); + doc = StaxUtils.read(is.getByteStream()); } catch (Exception ex) { throw new PolicyException(ex); } finally { Modified: cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertionBuilderTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertionBuilderTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertionBuilderTest.java (original) +++ cxf/trunk/rt/ws/policy/src/test/java/org/apache/cxf/ws/policy/builder/jaxb/JaxbAssertionBuilderTest.java Tue Sep 3 18:44:41 2013 @@ -27,6 +27,7 @@ import org.w3c.dom.Document; import org.w3c.dom.Element; import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.test.assertions.foo.FooType; import org.apache.neethi.Assertion; @@ -67,7 +68,7 @@ public class JaxbAssertionBuilderTest ex JaxbAssertionBuilder ab = new JaxbAssertionBuilder(FooType.class, qn); assertNotNull(ab); InputStream is = JaxbAssertionBuilderTest.class.getResourceAsStream("foo.xml"); - Document doc = DOMUtils.readXml(is); + Document doc = StaxUtils.read(is); Element elem = DOMUtils.findAllElementsByTagNameNS(doc.getDocumentElement(), "http://cxf.apache.org/test/assertions/foo", "foo").get(0); Modified: cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java (original) +++ cxf/trunk/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/AbstractSTSClient.java Tue Sep 3 18:44:41 2013 @@ -786,7 +786,7 @@ public abstract class AbstractSTSClient if (isString || isElement || isCallbackHandler) { if (isString) { final Document doc = - DOMUtils.readXml(new StringReader((String) delegationObject)); + StaxUtils.read(new StringReader((String) delegationObject)); return doc.getDocumentElement(); } else if (isElement) { return (Element) delegationObject; Modified: cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java (original) +++ cxf/trunk/rt/ws/security/src/test/java/org/apache/cxf/ws/security/wss4j/AbstractSecurityTest.java Tue Sep 3 18:44:41 2013 @@ -38,10 +38,10 @@ import org.xml.sax.SAXException; import org.apache.cxf.binding.soap.Soap11; import org.apache.cxf.binding.soap.SoapMessage; -import org.apache.cxf.helpers.DOMUtils; import org.apache.cxf.message.Exchange; import org.apache.cxf.message.ExchangeImpl; import org.apache.cxf.message.MessageImpl; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.test.AbstractCXFTest; import org.apache.wss4j.dom.WSConstants; @@ -64,10 +64,10 @@ public abstract class AbstractSecurityTe * Reads a classpath resource into a Document. * @param name the name of the classpath resource */ - protected Document readDocument(String name) throws SAXException, IOException, + protected Document readDocument(String name) throws Exception, ParserConfigurationException { InputStream inStream = getClass().getResourceAsStream(name); - return DOMUtils.readXml(inStream); + return StaxUtils.read(inStream); } /** Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java (original) +++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerResourceCreatedSpringProviderTest.java Tue Sep 3 18:44:41 2013 @@ -38,6 +38,7 @@ import org.apache.cxf.helpers.IOUtils; import org.apache.cxf.jaxrs.client.WebClient; import org.apache.cxf.jaxrs.model.AbstractResourceInfo; import org.apache.cxf.jaxrs.model.wadl.WadlGenerator; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; import org.apache.cxf.transport.http.HTTPConduit; @@ -108,7 +109,7 @@ public class JAXRSClientServerResourceCr public void testWadlPublishedEndpointUrl() throws Exception { String requestURI = "http://localhost:" + PORT + "/webapp/resources2"; WebClient client = WebClient.create(requestURI + "?_wadl&_type=xml"); - Document doc = DOMUtils.readXml(new InputStreamReader(client.get(InputStream.class), "UTF-8")); + Document doc = StaxUtils.read(new InputStreamReader(client.get(InputStream.class), "UTF-8")); Element root = doc.getDocumentElement(); assertEquals(WadlGenerator.WADL_NS, root.getNamespaceURI()); assertEquals("application", root.getLocalName()); @@ -132,7 +133,7 @@ public class JAXRSClientServerResourceCr private List getWadlResourcesInfo(String baseURI, String requestURI, int size) throws Exception { WebClient client = WebClient.create(requestURI + "?_wadl&_type=xml"); WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(10000000); - Document doc = DOMUtils.readXml(new InputStreamReader(client.get(InputStream.class), "UTF-8")); + Document doc = StaxUtils.read(new InputStreamReader(client.get(InputStream.class), "UTF-8")); Element root = doc.getDocumentElement(); assertEquals(WadlGenerator.WADL_NS, root.getNamespaceURI()); assertEquals("application", root.getLocalName()); Modified: cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java (original) +++ cxf/trunk/systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/JAXRSClientServerSpringBookTest.java Tue Sep 3 18:44:41 2013 @@ -54,6 +54,7 @@ import org.apache.cxf.jaxrs.model.Abstra import org.apache.cxf.jaxrs.model.wadl.WadlGenerator; import org.apache.cxf.jaxrs.provider.JAXBElementProvider; import org.apache.cxf.jaxrs.provider.aegis.AegisElementProvider; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase; import org.apache.ws.commons.schema.constants.Constants; @@ -163,7 +164,7 @@ public class JAXRSClientServerSpringBook String refAttrName) throws Exception { WebClient client = WebClient.create(address + schemaSegment); WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(10000000L); - Document doc = DOMUtils.readXml(new InputStreamReader(client.get(InputStream.class), "UTF-8")); + Document doc = StaxUtils.read(new InputStreamReader(client.get(InputStream.class), "UTF-8")); Element root = doc.getDocumentElement(); assertEquals(Constants.URI_2001_SCHEMA_XSD, root.getNamespaceURI()); assertEquals("schema", root.getLocalName()); @@ -182,7 +183,7 @@ public class JAXRSClientServerSpringBook WebClient client = WebClient.create(requestTypeURI); WebClient.getConfig(client).getHttpConduit().getClient().setReceiveTimeout(1000000); - Document doc = DOMUtils.readXml(new InputStreamReader(client.get(InputStream.class), "UTF-8")); + Document doc = StaxUtils.read(new InputStreamReader(client.get(InputStream.class), "UTF-8")); Element root = doc.getDocumentElement(); assertEquals(WadlGenerator.WADL_NS, root.getNamespaceURI()); assertEquals("application", root.getLocalName()); @@ -205,7 +206,7 @@ public class JAXRSClientServerSpringBook private List checkWadlResourcesInfo(String baseURI, String requestURI, String schemaRef, int size) throws Exception { WebClient client = WebClient.create(requestURI + "?_wadl&_type=xml"); - Document doc = DOMUtils.readXml(new InputStreamReader(client.get(InputStream.class), "UTF-8")); + Document doc = StaxUtils.read(new InputStreamReader(client.get(InputStream.class), "UTF-8")); Element root = doc.getDocumentElement(); assertEquals(WadlGenerator.WADL_NS, root.getNamespaceURI()); assertEquals("application", root.getLocalName()); Modified: cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AbstractSpringConfiguredAutoRewriteSoapAddressTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AbstractSpringConfiguredAutoRewriteSoapAddressTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AbstractSpringConfiguredAutoRewriteSoapAddressTest.java (original) +++ cxf/trunk/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/AbstractSpringConfiguredAutoRewriteSoapAddressTest.java Tue Sep 3 18:44:41 2013 @@ -23,9 +23,12 @@ import java.net.URL; import java.net.URLConnection; import java.util.LinkedList; import java.util.List; + import org.w3c.dom.Document; import org.w3c.dom.Element; + import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.cxf.test.AbstractCXFSpringTest; /** @@ -36,7 +39,7 @@ public abstract class AbstractSpringConf private Document retrieveWsdlDocument(String hostname, String port) throws Exception { URL wsdlUrlLocalhost = new URL("http://" + hostname + ":" + port + "/SpringEndpoint?wsdl"); URLConnection urlConnection = wsdlUrlLocalhost.openConnection(); - return DOMUtils.readXml(urlConnection.getInputStream()); + return StaxUtils.read(urlConnection.getInputStream()); } protected List findAllServiceUrlsFromWsdl(String hostname, String port) throws Exception { Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFFilterTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFFilterTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFFilterTest.java (original) +++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFFilterTest.java Tue Sep 3 18:44:41 2013 @@ -24,14 +24,13 @@ import java.util.Set; import org.w3c.dom.Document; - import com.meterware.httpunit.PostMethodWebRequest; import com.meterware.httpunit.WebLink; import com.meterware.httpunit.WebRequest; import com.meterware.httpunit.WebResponse; import com.meterware.servletunit.ServletUnitClient; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.junit.Test; @@ -75,7 +74,7 @@ public class CXFFilterTest extends Abstr assertEquals("text/xml", response.getContentType()); assertEquals("UTF-8", response.getCharacterSet()); - Document doc = DOMUtils.readXml(response.getInputStream()); + Document doc = StaxUtils.read(response.getInputStream()); assertNotNull(doc); addNamespace("h", "http://apache.org/hello_world_soap_http/types"); Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java (original) +++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/CXFServletTest.java Tue Sep 3 18:44:41 2013 @@ -41,7 +41,7 @@ import com.meterware.servletunit.Servlet import org.apache.cxf.Bus; import org.apache.cxf.BusException; import org.apache.cxf.BusFactory; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.apache.hello_world_soap_http.BaseGreeterImpl; import org.junit.Before; @@ -82,7 +82,7 @@ public class CXFServletTest extends Abst assertEquals("text/xml", response.getContentType()); assertTrue(encoding.equalsIgnoreCase(response.getCharacterSet())); - Document doc = DOMUtils.readXml(response.getInputStream()); + Document doc = StaxUtils.read(response.getInputStream()); assertNotNull(doc); addNamespace("h", "http://apache.org/hello_world_soap_http/types"); @@ -179,7 +179,7 @@ public class CXFServletTest extends Abst WebResponse res = client.getResponse(req); assertEquals(200, res.getResponseCode()); assertEquals("text/xml", res.getContentType()); - Document doc = DOMUtils.readXml(res.getInputStream()); + Document doc = StaxUtils.read(res.getInputStream()); assertNotNull(doc); assertValid("//wsdl:operation[@name='greetMe']", doc); @@ -197,7 +197,7 @@ public class CXFServletTest extends Abst WebResponse res = client.getResponse(req); assertEquals(200, res.getResponseCode()); assertEquals("text/xml", res.getContentType()); - Document doc = DOMUtils.readXml(res.getInputStream()); + Document doc = StaxUtils.read(res.getInputStream()); assertNotNull(doc); WSDLReader wsdlReader = WSDLFactory.newInstance().newWSDLReader(); wsdlReader.setFeature("javax.wsdl.verbose", false); @@ -219,7 +219,7 @@ public class CXFServletTest extends Abst WebResponse res = client.getResponse(req); assertEquals(200, res.getResponseCode()); assertEquals("text/xml", res.getContentType()); - Document doc = DOMUtils.readXml(res.getInputStream()); + Document doc = StaxUtils.read(res.getInputStream()); assertNotNull(doc); assertXPathEquals("//xsd:include/@schemaLocation", @@ -231,7 +231,7 @@ public class CXFServletTest extends Abst res = client.getResponse(req); assertEquals(200, res.getResponseCode()); assertEquals("text/xml", res.getContentType()); - doc = DOMUtils.readXml(res.getInputStream()); + doc = StaxUtils.read(res.getInputStream()); assertNotNull(doc); assertValid("//xsd:complexType[@name='ErrorCode']", doc); @@ -248,7 +248,7 @@ public class CXFServletTest extends Abst assertEquals(200, res.getResponseCode()); assertEquals("text/xml", res.getContentType()); - Document doc = DOMUtils.readXml(res.getInputStream()); + Document doc = StaxUtils.read(res.getInputStream()); assertNotNull(doc); addNamespace("http", "http://schemas.xmlsoap.org/wsdl/http/"); Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java (original) +++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/ExternalServicesServletTest.java Tue Sep 3 18:44:41 2013 @@ -24,7 +24,6 @@ import java.util.Set; import org.w3c.dom.Document; - import com.meterware.httpunit.PostMethodWebRequest; import com.meterware.httpunit.WebLink; import com.meterware.httpunit.WebRequest; @@ -33,7 +32,7 @@ import com.meterware.servletunit.Servlet import org.apache.cxf.Bus; import org.apache.cxf.BusException; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.junit.Test; @@ -94,7 +93,7 @@ public class ExternalServicesServletTest assertEquals("text/xml", response.getContentType()); assertEquals("UTF-8", response.getCharacterSet()); - Document doc = DOMUtils.readXml(response.getInputStream()); + Document doc = StaxUtils.read(response.getInputStream()); assertNotNull(doc); addNamespace("h", "http://apache.org/hello_world_soap_http/types"); Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java (original) +++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/JsFrontEndServletTest.java Tue Sep 3 18:44:41 2013 @@ -24,7 +24,7 @@ import com.meterware.httpunit.PostMethod import com.meterware.httpunit.WebRequest; import com.meterware.httpunit.WebResponse; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.junit.Test; @@ -46,7 +46,7 @@ public class JsFrontEndServletTest exten assertEquals("text/xml", response.getContentType()); //assertEquals("UTF-8", response.getCharacterSet()); - Document doc = DOMUtils.readXml(response.getInputStream()); + Document doc = StaxUtils.read(response.getInputStream()); assertNotNull(doc); addNamespace("h", "http://apache.org/hello_world_soap_http/types"); Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringAutoPublishServletTest.java URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringAutoPublishServletTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff ============================================================================== --- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringAutoPublishServletTest.java (original) +++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringAutoPublishServletTest.java Tue Sep 3 18:44:41 2013 @@ -27,7 +27,7 @@ import com.meterware.servletunit.Servlet import org.apache.cxf.Bus; import org.apache.cxf.BusException; -import org.apache.cxf.helpers.DOMUtils; +import org.apache.cxf.staxutils.StaxUtils; import org.junit.Test; @@ -64,7 +64,7 @@ public class SpringAutoPublishServletTes assertEquals("text/xml", response.getContentType()); assertTrue("utf-8".equalsIgnoreCase(response.getCharacterSet())); - Document doc = DOMUtils.readXml(response.getInputStream()); + Document doc = StaxUtils.read(response.getInputStream()); assertNotNull(doc); addNamespace("h", "http://apache.org/hello_world_soap_http/types"); @@ -85,7 +85,7 @@ public class SpringAutoPublishServletTes assertEquals(200, res.getResponseCode()); assertEquals("text/xml", res.getContentType()); - Document doc = DOMUtils.readXml(res.getInputStream()); + Document doc = StaxUtils.read(res.getInputStream()); assertNotNull(doc); assertValid("//wsdl:operation[@name='greetMe']", doc); @@ -97,7 +97,7 @@ public class SpringAutoPublishServletTes assertEquals(200, res.getResponseCode()); assertEquals("text/xml", res.getContentType()); - doc = DOMUtils.readXml(res.getInputStream()); + doc = StaxUtils.read(res.getInputStream()); assertNotNull(doc); assertValid("//wsdl:operation[@name='greetMe']", doc);