ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1337853 - /webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java
Date Sun, 13 May 2012 11:35:22 GMT
Author: veithen
Date: Sun May 13 11:35:22 2012
New Revision: 1337853

URL: http://svn.apache.org/viewvc?rev=1337853&view=rev
Log:
Removed unnecessary code.

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

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java?rev=1337853&r1=1337852&r2=1337853&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-tests/src/test/java/org/apache/axiom/om/OMElementCloneTest.java
Sun May 13 11:35:22 2012
@@ -21,14 +21,6 @@ package org.apache.axiom.om;
 
 import org.apache.axiom.soap.SOAPBody;
 import org.apache.axiom.soap.SOAPEnvelope;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
 
 public class OMElementCloneTest extends AbstractTestCase {
 
@@ -46,10 +38,10 @@ public class OMElementCloneTest extends 
         String firstClonedBodyElementText = firstClonedBodyElement.toString();
         String secondClonedBodyElementText = secondClonedBodyElement.toString();
         String bodyText = body.toString();
-        assertXMLEqual(newDocument(bodyText), newDocument(firstClonedBodyElementText));
-        assertXMLEqual(newDocument(bodyText), newDocument(secondClonedBodyElementText));
-        assertXMLEqual(newDocument(firstClonedBodyElementText),
-                       newDocument(secondClonedBodyElementText));
+        assertXMLEqual(bodyText, firstClonedBodyElementText);
+        assertXMLEqual(bodyText, secondClonedBodyElementText);
+        assertXMLEqual(firstClonedBodyElementText,
+                       secondClonedBodyElementText);
 
         // lets check some links. They must not be equal
         assertNotSame(body.getParent(), firstClonedBodyElement.getParent());
@@ -68,12 +60,12 @@ public class OMElementCloneTest extends 
         OMElement secondClonedBodyElement = body.cloneOMElement();
 
         // first check whether both have the same information
-        assertXMLEqual(newDocument(body.toString()),
-                       newDocument(firstClonedBodyElement.toString()));
-        assertXMLEqual(newDocument(body.toString()),
-                       newDocument(secondClonedBodyElement.toString()));
-        assertXMLEqual(newDocument(firstClonedBodyElement.toString()),
-                       newDocument(secondClonedBodyElement.toString()));
+        assertXMLEqual(body.toString(),
+                       firstClonedBodyElement.toString());
+        assertXMLEqual(body.toString(),
+                       secondClonedBodyElement.toString());
+        assertXMLEqual(firstClonedBodyElement.toString(),
+                       secondClonedBodyElement.toString());
 
         // lets check some links. They must not be equal
         assertNotSame(body.getParent(), firstClonedBodyElement.getParent());
@@ -82,12 +74,4 @@ public class OMElementCloneTest extends 
 
         soapEnvelope.close(false);
     }
-
-    public Document newDocument(String xml)
-            throws ParserConfigurationException, SAXException, IOException {
-        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
-        dbf.setNamespaceAware(true);
-        DocumentBuilder db = dbf.newDocumentBuilder();
-        return db.parse(new ByteArrayInputStream(xml.getBytes()));
-    }
 }



Mime
View raw message