ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1337913 - in /webservices/commons/trunk/modules/axiom/modules: axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/ axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/ axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/
Date Sun, 13 May 2012 15:19:37 GMT
Author: veithen
Date: Sun May 13 15:19:36 2012
New Revision: 1337913

URL: http://svn.apache.org/viewvc?rev=1337913&view=rev
Log:
Slightly changed the behavior of the LLOM implementation of OMElement#cloneOMElement(). It
was creating an OMDocument as the parent of the clone, but this seems to be accidental rather
than intentional. DOOM's implementation doesn't create this OMDocument and the clone is orphaned.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
    webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java?rev=1337913&r1=1337912&r2=1337913&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
Sun May 13 15:19:36 2012
@@ -26,7 +26,6 @@ import org.apache.axiom.ts.om.OMTestSuit
 import org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource;
 import org.apache.axiom.ts.om.container.TestSerialize;
 import org.apache.axiom.ts.om.document.TestDigest;
-import org.apache.axiom.ts.om.element.TestCloneOMElement;
 import org.apache.axiom.ts.om.element.TestGetChildrenWithName4;
 import org.apache.axiom.ts.om.factory.TestCreateOMElementWithGeneratedPrefix;
 import org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope1;
@@ -65,9 +64,6 @@ public class OMImplementationTest extend
         // TODO: if there is a comment node surrounded by text, then these text nodes need
to be merged
         builder.exclude(TestDigest.class, "(|(file=digest3.xml)(file=digest4.xml))");
         
-        // TODO: there seems to be an issue in the builder
-        builder.exclude(TestCloneOMElement.class);
-        
         return builder.build();
     }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1337913&r1=1337912&r2=1337913&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
Sun May 13 15:19:36 2012
@@ -1028,7 +1028,7 @@ public class OMElementImpl extends OMNod
         
         // Build the (target) clonedElement from the parser
         OMElement clonedElement =
-                new StAXOMBuilder(xmlStreamReader).getDocumentElement();
+                new StAXOMBuilder(xmlStreamReader).getDocumentElement(true);
         clonedElement.build();
         return clonedElement;
     }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement.java?rev=1337913&r1=1337912&r2=1337913&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement.java
Sun May 13 15:19:36 2012
@@ -49,10 +49,9 @@ public class TestCloneOMElement extends 
         XMLAssert.assertXMLEqual(firstClonedBodyElement.toString(),
                                  secondClonedBodyElement.toString());
 
-        // lets check some links. They must not be equal
-        assertNotSame(body.getParent(), firstClonedBodyElement.getParent());
-        assertNotSame(body.getParent(), secondClonedBodyElement.getParent());
-        assertNotSame(firstClonedBodyElement.getParent(), secondClonedBodyElement.getParent());
+        // The clone is expected to be orphaned
+        assertNull(firstClonedBodyElement.getParent());
+        assertNull(secondClonedBodyElement.getParent());
 
         soapEnvelope.close(false);
     }



Mime
View raw message