cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r1519790 [2/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 GMT
Modified: cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff
==============================================================================
--- cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java
(original)
+++ cxf/trunk/systests/transports/src/test/java/org/apache/cxf/systest/servlet/SpringServletTest.java
Tue Sep  3 18:44:41 2013
@@ -30,7 +30,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;
 
@@ -67,7 +67,7 @@ public class SpringServletTest extends A
         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");
@@ -88,7 +88,7 @@ public class SpringServletTest extends A
         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);
@@ -100,7 +100,7 @@ public class SpringServletTest extends A
         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);
@@ -113,7 +113,7 @@ public class SpringServletTest extends A
         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);

Modified: cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff
==============================================================================
--- cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
(original)
+++ cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
Tue Sep  3 18:44:41 2013
@@ -31,7 +31,6 @@ import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
 import org.apache.cxf.attachment.AttachmentDeserializer;
-import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.message.Attachment;
@@ -39,6 +38,7 @@ import org.apache.cxf.message.ExchangeIm
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.test.TestUtilities;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
 import org.apache.cxf.testutil.common.TestUtil;
@@ -104,11 +104,11 @@ public class MtomPolicyTest extends Abst
         WSPolicyFeature policyFeature = new WSPolicyFeature();
         List<Element> policyElements = new ArrayList<Element>();
         if (mtomRequired) {
-            policyElements.add(DOMUtils.readXml(
+            policyElements.add(StaxUtils.read(
                 getClass().getResourceAsStream("mtom-policy.xml"))
                            .getDocumentElement());
         } else {
-            policyElements.add(DOMUtils.readXml(
+            policyElements.add(StaxUtils.read(
                 getClass().getResourceAsStream("mtom-policy-optional.xml"))
                            .getDocumentElement());
         } 

Modified: cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff
==============================================================================
--- cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
(original)
+++ cxf/trunk/systests/ws-security/src/test/java/org/apache/cxf/systest/ws/policy/JavaFirstPolicyServiceTest.java
Tue Sep  3 18:44:41 2013
@@ -36,6 +36,7 @@ import org.apache.cxf.frontend.ClientPro
 import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.service.model.MessageInfo.Type;
+import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.systest.ws.common.SecurityTestUtil;
 import org.apache.cxf.systest.ws.common.UTPasswordCallback;
 import org.apache.cxf.systest.ws.policy.javafirst.BindingSimpleService;
@@ -501,7 +502,7 @@ public class JavaFirstPolicyServiceTest 
         String wsdlContents = IOUtils.toString(is);
 
         // System.out.println(wsdlContents);
-        return DOMUtils.readXml(new StringReader(wsdlContents));
+        return StaxUtils.read(new StringReader(wsdlContents));
     }
 
     private String getPolicyId(Element element) {

Modified: cxf/trunk/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java?rev=1519790&r1=1519789&r2=1519790&view=diff
==============================================================================
--- cxf/trunk/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java (original)
+++ cxf/trunk/testutils/src/main/java/org/apache/cxf/test/TestUtilities.java Tue Sep  3 18:44:41
2013
@@ -44,17 +44,16 @@ import org.w3c.dom.Document;
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import org.xml.sax.SAXParseException;
 
 import org.apache.cxf.Bus;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.endpoint.ServerRegistry;
-import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.IOUtils;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.message.MessageImpl;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.EndpointInfo;
+import org.apache.cxf.staxutils.StaxUtils;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.ConduitInitiatorManager;
@@ -260,21 +259,13 @@ public class TestUtilities {
         byte[] bs = invokeBytes(address, transport, message);
 
         ByteArrayInputStream input = new ByteArrayInputStream(bs);
-        try {
-            return DOMUtils.readXml(input);
-        } catch (SAXParseException e) {
-            throw new IllegalStateException("Could not parse message:\n" + new String(bs),
e);
-        }
+        return StaxUtils.read(input);
     }
     public Node invoke(String address, String transport, byte[] message) throws Exception
{
         byte[] bs = invokeBytes(address, transport, message);
 
         ByteArrayInputStream input = new ByteArrayInputStream(bs);
-        try {
-            return DOMUtils.readXml(input);
-        } catch (SAXParseException e) {
-            throw new IllegalStateException("Could not parse message:\n" + new String(bs),
e);
-        }
+        return StaxUtils.read(input);
     }
 
     public InputStream getResourceAsStream(String resource) {

Modified: cxf/trunk/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java?rev=1519790&r1=1519789&r2=1519790&view=diff
==============================================================================
--- cxf/trunk/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java (original)
+++ cxf/trunk/testutils/src/test/java/org/apache/cxf/test/XPathAssertTest.java Tue Sep  3
18:44:41 2013
@@ -23,9 +23,11 @@ import java.util.HashMap;
 import java.util.Map;
 
 import org.w3c.dom.Document;
+
 import junit.framework.AssertionFailedError;
 
-import org.apache.cxf.helpers.DOMUtils;
+import org.apache.cxf.staxutils.StaxUtils;
+
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -33,7 +35,7 @@ public class XPathAssertTest extends Ass
     
     @Test
     public void testAssert() throws Exception {
-        Document document = DOMUtils.readXml(getClass().getResourceAsStream("test.xml"));
+        Document document = StaxUtils.read(getClass().getResourceAsStream("test.xml"));
 
         XPathAssert.assertValid("//a", document, null);
         XPathAssert.assertInvalid("//aasd", document, null);
@@ -57,7 +59,7 @@ public class XPathAssertTest extends Ass
 
     @Test
     public void testAssertNamespace() throws Exception {
-        Document document = DOMUtils.readXml(getClass().getResourceAsStream("test2.xml"));
+        Document document = StaxUtils.read(getClass().getResourceAsStream("test2.xml"));
 
         Map<String, String> namespaces = new HashMap<String, String>();
         namespaces.put("a", "urn:foo");

Modified: cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
URL: http://svn.apache.org/viewvc/cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java?rev=1519790&r1=1519789&r2=1519790&view=diff
==============================================================================
--- cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
(original)
+++ cxf/trunk/tools/wadlto/jaxrs/src/main/java/org/apache/cxf/tools/wadlto/jaxb/CustomizationParser.java
Tue Sep  3 18:44:41 2013
@@ -39,7 +39,6 @@ import org.apache.cxf.common.i18n.Messag
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.common.util.URIParserUtil;
-import org.apache.cxf.helpers.DOMUtils;
 import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.resource.URIResolver;
 import org.apache.cxf.staxutils.StaxUtils;
@@ -108,7 +107,7 @@ public final class CustomizationParser {
         Element root = null;
         try {
             URIResolver resolver = new URIResolver(bindingFile);
-            root = DOMUtils.readXml(resolver.getInputStream()).getDocumentElement();
+            root = StaxUtils.read(resolver.getInputStream()).getDocumentElement();
         } catch (Exception e1) {
             Message msg = new Message("CAN_NOT_READ_AS_ELEMENT", LOG, new Object[] {bindingFile});
             throw new ToolException(msg, e1);



Mime
View raw message