ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1338888 - in /webservices/commons/trunk/modules/axiom: ./ modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/ modules/axiom-impl/src/main/java/org/apache/axiom/om/im...
Date Tue, 15 May 2012 21:02:27 GMT
Author: veithen
Date: Tue May 15 21:02:26 2012
New Revision: 1338888

URL: http://svn.apache.org/viewvc?rev=1338888&view=rev
Log:
AXIOM-422: Ensure that SOAPElement#checkParent is invoked consistently.

Added:
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent1.java
      - copied unchanged from r1338886, webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent1.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent2.java
      - copied unchanged from r1338886, webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent2.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent3.java
      - copied unchanged from r1338886, webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/fault/TestWrongParent3.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent1.java
      - copied unchanged from r1338886, webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent1.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent2.java
      - copied unchanged from r1338886, webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent2.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent3.java
      - copied unchanged from r1338886, webservices/axiom/branches/CHECK_PARENT_BUG/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/headerblock/TestWrongParent3.java
Modified:
    webservices/commons/trunk/modules/axiom/   (props changed)
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPElement.java
    webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.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-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java
    webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java

Propchange: webservices/commons/trunk/modules/axiom/
------------------------------------------------------------------------------
  Merged /webservices/axiom/branches/CHECK_PARENT_BUG:r1338398-1338886

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java?rev=1338888&r1=1338887&r2=1338888&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ChildNode.java
Tue May 15 21:02:26 2012
@@ -176,7 +176,7 @@ public abstract class ChildNode extends 
         setParent(element, false);
     }
     
-    void setParent(OMContainer element, boolean useDomSemantics) {
+    protected void setParent(OMContainer element, boolean useDomSemantics) {
         if (element == null) {
             ownerNode = useDomSemantics ? ownerDocument() : null;
             hasParent(false);

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPElement.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPElement.java?rev=1338888&r1=1338887&r2=1338888&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPElement.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPElement.java
Tue May 15 21:02:26 2012
@@ -19,6 +19,7 @@
 
 package org.apache.axiom.soap.impl.dom;
 
+import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
@@ -76,4 +77,11 @@ public abstract class SOAPElement extend
     protected abstract void checkParent(OMElement parent)
             throws SOAPProcessingException;
 
+    protected void setParent(OMContainer element, boolean useDomSemantics) {
+        super.setParent(element, useDomSemantics);
+
+        if (!useDomSemantics && element instanceof OMElement) {
+            checkParent((OMElement) element);
+        }
+    }
 }

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java?rev=1338888&r1=1338887&r2=1338888&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
Tue May 15 21:02:26 2012
@@ -20,6 +20,7 @@
 package org.apache.axiom.soap.impl.dom;
 
 import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMNamespace;
@@ -132,4 +133,15 @@ public abstract class SOAPHeaderBlockImp
     public Object getObject(Class dataSourceClass) {
         throw new UnsupportedOperationException();
     }
+
+    protected abstract void checkParent(OMElement parent)
+            throws SOAPProcessingException;
+    
+    protected void setParent(OMContainer element, boolean useDomSemantics) {
+        super.setParent(element, useDomSemantics);
+    
+        if (!useDomSemantics && element instanceof OMElement) {
+            checkParent((OMElement) element);
+        }
+    }
 }

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=1338888&r1=1338887&r2=1338888&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
Tue May 15 21:02:26 2012
@@ -325,7 +325,7 @@ public class OMElementImpl extends OMNod
                 child.detach();
             }
             
-            child.parent = this;
+            child.setParent(this);
 
             if (firstChild == null) {
                 firstChild = child;

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java?rev=1338888&r1=1338887&r2=1338888&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPHeaderBlockImpl.java
Tue May 15 21:02:26 2012
@@ -20,6 +20,7 @@
 package org.apache.axiom.soap.impl.llom;
 
 import org.apache.axiom.om.OMAttribute;
+import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMDataSourceExt;
 import org.apache.axiom.om.OMElement;
@@ -80,6 +81,16 @@ public abstract class SOAPHeaderBlockImp
         this.setNamespace(ns);
     }
 
+    protected abstract void checkParent(OMElement parent) throws SOAPProcessingException;
+
+    public void setParent(OMContainer element) {
+        super.setParent(element);
+
+        if (element instanceof OMElement) {
+            checkParent((OMElement) element);
+        }
+    }
+    
     /**
      * @param attributeName
      * @param attrValue

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1338888&r1=1338887&r2=1338888&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
Tue May 15 21:02:26 2012
@@ -118,6 +118,9 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap.fault.TestSetException(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.fault.TestSetReason(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.fault.TestSetRole(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.fault.TestWrongParent1(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.fault.TestWrongParent2(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.fault.TestWrongParent3(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.faultdetail.TestAddDetailEntry(metaFactory,
spec));
         addTest(new org.apache.axiom.ts.soap.faultdetail.TestDetailEntriesUsingDefaultNamespaceWithParser(metaFactory,
spec));
         addTest(new org.apache.axiom.ts.soap.faultdetail.TestGetAllDetailEntries(metaFactory,
spec));
@@ -145,6 +148,9 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap.headerblock.TestSetMustUnderstandString01(metaFactory,
spec));
         addTest(new org.apache.axiom.ts.soap.headerblock.TestSetMustUnderstandWithInvalidValue(metaFactory,
spec));
         addTest(new org.apache.axiom.ts.soap.headerblock.TestSetRole(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent1(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent2(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent3(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.xpath.TestXPathAppliedToSOAPEnvelope(metaFactory,
spec, true));
         addTest(new org.apache.axiom.ts.soap.xpath.TestXPathAppliedToSOAPEnvelope(metaFactory,
spec, false));
     }



Mime
View raw message