ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1700364 - in /webservices/axiom/trunk: aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/ implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/ implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl...
Date Mon, 31 Aug 2015 22:18:10 GMT
Author: veithen
Date: Mon Aug 31 22:18:09 2015
New Revision: 1700364

URL: http://svn.apache.org/r1700364
Log:
AXIOM-471: Move the OMSourcedElement code to om-aspects and enable OMSourcedElement support for DOOM.

Added:
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomSourcedElementSupport.aj
      - copied, changed from r1700360, webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/DeferredNamespace.java
      - copied, changed from r1700360, webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/DeferredNamespace.java
    webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/PushOMBuilder.java
      - copied, changed from r1700360, webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/OMSourcedElementImpl.java   (with props)
Removed:
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/DeferredNamespace.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java
Modified:
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
    webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
    webservices/axiom/trunk/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
    webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
    webservices/axiom/trunk/implementations/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
    webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestDetach.java

Copied: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomSourcedElementSupport.aj (from r1700360, webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomSourcedElementSupport.aj?p2=webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomSourcedElementSupport.aj&p1=webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java&r1=1700360&r2=1700364&rev=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/AxiomSourcedElementSupport.aj Mon Aug 31 22:18:09 2015
@@ -16,16 +16,15 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-
-package org.apache.axiom.om.impl.llom;
+package org.apache.axiom.om.impl.common;
 
 import org.apache.axiom.core.ClonePolicy;
 import org.apache.axiom.core.CoreElement;
+import org.apache.axiom.core.CoreNode;
 import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMDataSourceExt;
 import org.apache.axiom.om.OMException;
-import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMOutputFormat;
 import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
@@ -58,13 +57,13 @@ import java.util.Iterator;
  * #forceExpand()} method) before the base class method is called. This will typically involve a
  * heavy overhead penalty, so should be avoided if possible.</p>
  */
-public class OMSourcedElementImpl extends OMElementImpl implements AxiomSourcedElement {
+public aspect AxiomSourcedElementSupport {
     
     /** Data source for element data. */
-    private OMDataSource dataSource;
+    private OMDataSource AxiomSourcedElement.dataSource;
 
     /** Namespace for element, needed in order to bypass base class handling. */
-    private OMNamespace definedNamespace;
+    private OMNamespace AxiomSourcedElement.definedNamespace;
     
     /**
      * Flag indicating whether the {@link #definedNamespace} attribute has been set. If this flag is
@@ -73,21 +72,25 @@ public class OMSourcedElementImpl extend
      * is always <code>null</code>) then the namespace is not known and needs to be determined
      * lazily. The flag is used only if {@link #isExpanded} is <code>false</code>.
      */
-    private boolean definedNamespaceSet;
+    private boolean AxiomSourcedElement.definedNamespaceSet;
 
     /** Flag for parser provided to base element class. */
-    private boolean isExpanded = true;
+    private boolean AxiomSourcedElement.isExpanded = true;
 
-    private static final Log log = LogFactory.getLog(OMSourcedElementImpl.class);
+    private static final Log log = LogFactory.getLog(AxiomSourcedElementSupport.class);
     
-    private static final Log forceExpandLog = LogFactory.getLog(OMSourcedElementImpl.class.getName() + ".forceExpand");
+    private static final Log forceExpandLog = LogFactory.getLog(AxiomSourcedElementSupport.class.getName() + ".forceExpand");
     
     private static OMNamespace getOMNamespace(QName qName) {
         return qName.getNamespaceURI().length() == 0 ? null
                 : new OMNamespaceImpl(qName.getNamespaceURI(), qName.getPrefix());
     }
     
-    public void init(OMDataSource source) {
+    public Class<? extends CoreNode> AxiomSourcedElement.coreGetNodeClass() {
+        return AxiomSourcedElement.class;
+    }
+    
+    public void AxiomSourcedElement.init(OMDataSource source) {
         dataSource = source;
         isExpanded = false;
     }
@@ -100,7 +103,7 @@ public class OMSourcedElementImpl extend
      * @param factory
      * @param source
      */
-    public void init(String localName, OMNamespace ns, OMDataSource source) {
+    public void AxiomSourcedElement.init(String localName, OMNamespace ns, OMDataSource source) {
         if (source == null) {
             throw new IllegalArgumentException("OMDataSource can't be null");
         }
@@ -131,7 +134,7 @@ public class OMSourcedElementImpl extend
      * @param factory
      * @param source
      */
-    public void init(QName qName, OMDataSource source) {
+    public void AxiomSourcedElement.init(QName qName, OMDataSource source) {
         if (source == null) {
             throw new IllegalArgumentException("OMDataSource can't be null");
         }
@@ -149,10 +152,6 @@ public class OMSourcedElementImpl extend
         definedNamespaceSet = true;
     }
 
-    public OMSourcedElementImpl(OMFactory factory) {
-        super(factory);
-    }
-
     /**
      * The namespace uri is immutable, but the OMDataSource may change
      * the value of the prefix.  This method queries the OMDataSource to 
@@ -175,7 +174,7 @@ public class OMSourcedElementImpl extend
      *
      * @return name
      */
-    private String getPrintableName() {
+    private String AxiomSourcedElement.getPrintableName() {
         if (isExpanded || (definedNamespaceSet && internalGetLocalName() != null)) {
             String uri = null;
             if (getNamespace() != null) {
@@ -195,7 +194,7 @@ public class OMSourcedElementImpl extend
      * Set parser for OM, if not previously set. Since the builder is what actually constructs the
      * tree on demand, this first creates a builder
      */
-    public void forceExpand() {
+    public void AxiomSourcedElement.forceExpand() {
         // The dataSource != null is required because this method may be called indirectly
         // by the constructor before the data source is set. After the constructor has completed,
         // isExpanded is always true if dataSource is null.
@@ -267,7 +266,7 @@ public class OMSourcedElementImpl extend
      * @param staxLocalName
      * @param staxNamespaceURI
      */
-    void validateName(String staxPrefix, String staxLocalName, String staxNamespaceURI) {
+    void AxiomSourcedElement.validateName(String staxPrefix, String staxLocalName, String staxNamespaceURI) {
         if (internalGetLocalName() == null) {
             // The local name was not known in advance; initialize it from the reader
             internalSetLocalName(staxLocalName);
@@ -305,11 +304,11 @@ public class OMSourcedElementImpl extend
      *
      * @return <code>true</code> if expanded, <code>false</code> if not
      */
-    public boolean isExpanded() {
+    public boolean AxiomSourcedElement.isExpanded() {
         return isExpanded;
     }
 
-    public XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration configuration) {
+    public XMLStreamReader AxiomSourcedElement.getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration configuration) {
         if (log.isDebugEnabled()) {
             log.debug("getting XMLStreamReader for " + getPrintableName()
                     + " with cache=" + cache);
@@ -330,7 +329,7 @@ public class OMSourcedElementImpl extend
         }
     }
 
-    public final void updateLocalName() {
+    public final void AxiomSourcedElement.updateLocalName() {
         if (dataSource instanceof QNameAwareOMDataSource) {
             internalSetLocalName(((QNameAwareOMDataSource)dataSource).getLocalName());
         }
@@ -339,7 +338,7 @@ public class OMSourcedElementImpl extend
         }
     }
 
-    public OMNamespace getNamespace() throws OMException {
+    public OMNamespace AxiomSourcedElement.getNamespace() throws OMException {
         if (isExpanded()) {
             return defaultGetNamespace();
         } else if (definedNamespaceSet) {
@@ -377,7 +376,7 @@ public class OMSourcedElementImpl extend
         }
     }
 
-    public QName getQName() {
+    public QName AxiomSourcedElement.getQName() {
         if (isExpanded()) {
             return defaultGetQName();
         } else if (getNamespace() != null) {
@@ -388,8 +387,8 @@ public class OMSourcedElementImpl extend
         }
     }
 
-    public <T> void initSource(ClonePolicy<T> policy, T options, CoreElement other) {
-        OMSourcedElementImpl o = (OMSourcedElementImpl)other;
+    public <T> void AxiomSourcedElement.initSource(ClonePolicy<T> policy, T options, CoreElement other) {
+        AxiomSourcedElement o = (AxiomSourcedElement)other;
         // If already expanded or this is not an OMDataSourceExt, then
         // create a copy of the OM Tree
         OMDataSource ds = o.getDataSource();
@@ -420,7 +419,7 @@ public class OMSourcedElementImpl extend
         }
     }
 
-    public void internalSerialize(Serializer serializer, OMOutputFormat format, boolean cache)
+    public void AxiomSourcedElement.internalSerialize(Serializer serializer, OMOutputFormat format, boolean cache)
             throws OutputException {
         if (isExpanded()) {
             defaultInternalSerialize(serializer, format, cache);
@@ -442,14 +441,14 @@ public class OMSourcedElementImpl extend
      *
      * @return the internal datasource
      */
-    public OMDataSource getDataSource() {
+    public OMDataSource AxiomSourcedElement.getDataSource() {
         return dataSource;
     }
     
     /**
      * setOMDataSource
      */
-    public OMDataSource setDataSource(OMDataSource dataSource) {
+    public OMDataSource AxiomSourcedElement.setDataSource(OMDataSource dataSource) {
         if (!isExpanded()) {
             OMDataSource oldDS = this.dataSource;
             this.dataSource = dataSource;
@@ -481,7 +480,7 @@ public class OMSourcedElementImpl extend
      * expansion process. Thus calls to setCompete should stop here and not propogate up to the
      * parent (which may have a different builder or no builder).
      */
-    public void setComplete(boolean complete) {
+    public void AxiomSourcedElement.setComplete(boolean complete) {
         coreSetState(complete ? COMPLETE : INCOMPLETE);
         if (complete && dataSource != null) {
             if (dataSource instanceof OMDataSourceExt) {
@@ -491,7 +490,7 @@ public class OMSourcedElementImpl extend
         }
     }
     
-    public Object getObject(Class dataSourceClass) {
+    public Object AxiomSourcedElement.getObject(Class dataSourceClass) {
         if (dataSource == null || isExpanded || !dataSourceClass.isInstance(dataSource)) {
             return null;
         } else {

Copied: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/DeferredNamespace.java (from r1700360, webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/DeferredNamespace.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/DeferredNamespace.java?p2=webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/DeferredNamespace.java&p1=webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/DeferredNamespace.java&r1=1700360&r2=1700364&rev=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/DeferredNamespace.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/DeferredNamespace.java Mon Aug 31 22:18:09 2015
@@ -16,17 +16,17 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.impl.llom;
+package org.apache.axiom.om.impl.common;
 
 import org.apache.axiom.om.OMNamespace;
 
 final class DeferredNamespace implements OMNamespace {
-    private final OMSourcedElementImpl element;
+    private final AxiomSourcedElement element;
     
     final String uri;
     
-    DeferredNamespace(OMSourcedElementImpl omSourcedElementImpl, String ns) {
-        element = omSourcedElementImpl;
+    DeferredNamespace(AxiomSourcedElement element, String ns) {
+        this.element = element;
         this.uri = ns;
     }
 

Copied: webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/PushOMBuilder.java (from r1700360, webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java)
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/PushOMBuilder.java?p2=webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/PushOMBuilder.java&p1=webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java&r1=1700360&r2=1700364&rev=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java (original)
+++ webservices/axiom/trunk/aspects/om-aspects/src/main/java/org/apache/axiom/om/impl/common/PushOMBuilder.java Mon Aug 31 22:18:09 2015
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations
  * under the License.
  */
-package org.apache.axiom.om.impl.llom;
+package org.apache.axiom.om.impl.common;
 
 import java.io.IOException;
 import java.util.Iterator;
@@ -37,11 +37,11 @@ import org.apache.axiom.om.impl.builder.
 import org.apache.axiom.util.stax.AbstractXMLStreamWriter;
 
 public class PushOMBuilder extends AbstractXMLStreamWriter implements DataHandlerWriter {
-    private final OMSourcedElementImpl root;
+    private final AxiomSourcedElement root;
     private final OMFactoryEx factory;
     private OMElement parent;
     
-    public PushOMBuilder(OMSourcedElementImpl root) throws XMLStreamException {
+    public PushOMBuilder(AxiomSourcedElement root) throws XMLStreamException {
         this.root = root;
         factory = (OMFactoryEx)root.getOMFactory();
         // Seed the namespace context with the namespace context from the parent
@@ -148,7 +148,7 @@ public class PushOMBuilder extends Abstr
         // Use the internal appendAttribute method instead of addAttribute in order to avoid
         // automatic of a namespace declaration (the OMDataSource is required to produce well formed
         // XML with respect to namespaces, so it will take care of the namespace declarations).
-        ((OMElementImpl)parent).internalAppendAttribute(attr);
+        ((AxiomElement)parent).internalAppendAttribute(attr);
     }
 
     protected void doWriteAttribute(String localName, String value) throws XMLStreamException {
@@ -156,7 +156,7 @@ public class PushOMBuilder extends Abstr
     }
 
     protected void doWriteNamespace(String prefix, String namespaceURI) {
-        ((OMElementImpl)parent).addNamespaceDeclaration(getOMNamespace(prefix, namespaceURI, true));
+        ((AxiomElement)parent).addNamespaceDeclaration(getOMNamespace(prefix, namespaceURI, true));
     }
 
     protected void doWriteDefaultNamespace(String namespaceURI) {

Added: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/OMSourcedElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/OMSourcedElementImpl.java?rev=1700364&view=auto
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/OMSourcedElementImpl.java (added)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/OMSourcedElementImpl.java Mon Aug 31 22:18:09 2015
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.axiom.om.impl.dom;
+
+import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.impl.common.AxiomSourcedElement;
+
+public class OMSourcedElementImpl extends NSAwareElement implements AxiomSourcedElement {
+    public OMSourcedElementImpl(OMFactory factory) {
+        super(factory);
+    }
+}

Propchange: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/OMSourcedElementImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java?rev=1700364&r1=1700363&r2=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/om/impl/dom/factory/OMDOMFactory.java Mon Aug 31 22:18:09 2015
@@ -60,6 +60,7 @@ import org.apache.axiom.om.impl.common.A
 import org.apache.axiom.om.impl.common.AxiomEntityReference;
 import org.apache.axiom.om.impl.common.AxiomNamespaceDeclaration;
 import org.apache.axiom.om.impl.common.AxiomProcessingInstruction;
+import org.apache.axiom.om.impl.common.AxiomSourcedElement;
 import org.apache.axiom.om.impl.common.factory.AxiomNodeFactory;
 import org.apache.axiom.om.impl.dom.CDATASectionImpl;
 import org.apache.axiom.om.impl.dom.CommentImpl;
@@ -72,6 +73,7 @@ import org.apache.axiom.om.impl.dom.NSAw
 import org.apache.axiom.om.impl.dom.NSUnawareAttribute;
 import org.apache.axiom.om.impl.dom.NSUnawareElement;
 import org.apache.axiom.om.impl.dom.NamespaceDeclaration;
+import org.apache.axiom.om.impl.dom.OMSourcedElementImpl;
 import org.apache.axiom.om.impl.dom.ProcessingInstructionImpl;
 import org.apache.axiom.om.impl.dom.TextImpl;
 import org.apache.axiom.soap.impl.common.AxiomSOAP11Body;
@@ -173,6 +175,8 @@ public class OMDOMFactory implements Axi
             node = new NSUnawareElement(this);
         } else if (type == CoreProcessingInstruction.class || type == AxiomProcessingInstruction.class || type == DOMProcessingInstruction.class) {
             node = new ProcessingInstructionImpl(this);
+        } else if (type == AxiomSourcedElement.class) {
+            node = new OMSourcedElementImpl(this);
         } else if (type == AxiomSOAPMessage.class) {
             node = new SOAPMessageImpl(this);
         } else if (type == AxiomSOAPEnvelope.class) {

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java?rev=1700364&r1=1700363&r2=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/main/java/org/apache/axiom/soap/impl/dom/SOAPHeaderBlockImpl.java Mon Aug 31 22:18:09 2015
@@ -19,44 +19,12 @@
 
 package org.apache.axiom.soap.impl.dom;
 
-import javax.xml.namespace.QName;
-
-import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.impl.dom.NSAwareElement;
+import org.apache.axiom.om.impl.dom.OMSourcedElementImpl;
 import org.apache.axiom.soap.impl.common.AxiomSOAPHeaderBlock;
 
-public abstract class SOAPHeaderBlockImpl extends NSAwareElement implements AxiomSOAPHeaderBlock {
+public abstract class SOAPHeaderBlockImpl extends OMSourcedElementImpl implements AxiomSOAPHeaderBlock {
     public SOAPHeaderBlockImpl(OMFactory factory) {
         super(factory);
     }
-
-    public final void init(OMDataSource source) {
-        throw new UnsupportedOperationException();
-    }
-
-    public final void init(String localName, OMNamespace ns, OMDataSource source) {
-        throw new UnsupportedOperationException();
-    }
-
-    public final void init(QName qName, OMDataSource source) {
-        throw new UnsupportedOperationException();
-    }
-
-    public OMDataSource getDataSource() {
-        throw new UnsupportedOperationException();
-    }
-
-    public boolean isExpanded() {
-        return true;
-    }
-
-    public OMDataSource setDataSource(OMDataSource dataSource) {
-        throw new UnsupportedOperationException();
-    }
-
-    public Object getObject(Class dataSourceClass) {
-        throw new UnsupportedOperationException();
-    }
 }

Modified: webservices/axiom/trunk/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java?rev=1700364&r1=1700363&r2=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java (original)
+++ webservices/axiom/trunk/implementations/axiom-dom/src/test/java/org/apache/axiom/om/impl/dom/OMImplementationTest.java Mon Aug 31 22:18:09 2015
@@ -37,7 +37,7 @@ import org.apache.axiom.ts.om.sourcedele
 
 public class OMImplementationTest extends TestCase {
     public static TestSuite suite() {
-        OMTestSuiteBuilder builder = new OMTestSuiteBuilder(new OMDOMMetaFactory(), false);
+        OMTestSuiteBuilder builder = new OMTestSuiteBuilder(new OMDOMMetaFactory());
         
         // TODO: Axiom should throw an exception if an attempt is made to create a cyclic parent-child relationship
         builder.exclude(TestInsertSiblingAfterOnChild.class);

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java?rev=1700364&r1=1700363&r2=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java Mon Aug 31 22:18:09 2015
@@ -19,483 +19,11 @@
 
 package org.apache.axiom.om.impl.llom;
 
-import org.apache.axiom.core.ClonePolicy;
-import org.apache.axiom.core.CoreElement;
-import org.apache.axiom.om.OMCloneOptions;
-import org.apache.axiom.om.OMDataSource;
-import org.apache.axiom.om.OMDataSourceExt;
-import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
-import org.apache.axiom.om.OMNamespace;
-import org.apache.axiom.om.OMOutputFormat;
-import org.apache.axiom.om.OMXMLStreamReaderConfiguration;
-import org.apache.axiom.om.QNameAwareOMDataSource;
-import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.impl.common.AxiomSourcedElement;
-import org.apache.axiom.om.impl.common.OMDataSourceUtil;
-import org.apache.axiom.om.impl.common.OMNamespaceImpl;
-import org.apache.axiom.om.impl.common.serializer.push.OutputException;
-import org.apache.axiom.om.impl.common.serializer.push.Serializer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamConstants;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-
-import java.util.Iterator;
-
-/**
- * <p>Element backed by an arbitrary data source. When necessary, this element will be expanded by
- * creating a parser from the data source.</p>
- * <p/>
- * <p>Whenever methods are added to the base {@link OMElementImpl}
- * class the corresponding methods must be added to this class (there's a unit test to verify that
- * this has been done, just to make sure nothing gets accidentally broken). If the method only
- * requires the element name and/or namespace information, the base class method can be called
- * directly. Otherwise, the element must be expanded into a full OM tree (by calling the {@link
- * #forceExpand()} method) before the base class method is called. This will typically involve a
- * heavy overhead penalty, so should be avoided if possible.</p>
- */
 public class OMSourcedElementImpl extends OMElementImpl implements AxiomSourcedElement {
-    
-    /** Data source for element data. */
-    private OMDataSource dataSource;
-
-    /** Namespace for element, needed in order to bypass base class handling. */
-    private OMNamespace definedNamespace;
-    
-    /**
-     * Flag indicating whether the {@link #definedNamespace} attribute has been set. If this flag is
-     * <code>true</code> and {@link #definedNamespace} is <code>null</code> then the element has no
-     * namespace. If this flag is set to <code>false</code> (in which case {@link #definedNamespace}
-     * is always <code>null</code>) then the namespace is not known and needs to be determined
-     * lazily. The flag is used only if {@link #isExpanded} is <code>false</code>.
-     */
-    private boolean definedNamespaceSet;
-
-    /** Flag for parser provided to base element class. */
-    private boolean isExpanded = true;
-
-    private static final Log log = LogFactory.getLog(OMSourcedElementImpl.class);
-    
-    private static final Log forceExpandLog = LogFactory.getLog(OMSourcedElementImpl.class.getName() + ".forceExpand");
-    
-    private static OMNamespace getOMNamespace(QName qName) {
-        return qName.getNamespaceURI().length() == 0 ? null
-                : new OMNamespaceImpl(qName.getNamespaceURI(), qName.getPrefix());
-    }
-    
-    public void init(OMDataSource source) {
-        dataSource = source;
-        isExpanded = false;
-    }
-    
-    /**
-     * Constructor.
-     *
-     * @param localName
-     * @param ns
-     * @param factory
-     * @param source
-     */
-    public void init(String localName, OMNamespace ns, OMDataSource source) {
-        if (source == null) {
-            throw new IllegalArgumentException("OMDataSource can't be null");
-        }
-        internalSetLocalName(localName);
-        dataSource = source;
-        isExpanded = false;
-        // Normalize the namespace. Note that this also covers the case where the
-        // namespace URI is empty and the prefix is null (in which case we know that
-        // the actual prefix must be empty)
-        if (ns != null && ns.getNamespaceURI().length() == 0) {
-            ns = null;
-        }
-        if (ns == null || !(isLossyPrefix(dataSource) || ns.getPrefix() == null)) {
-            // Believe the prefix and create a normal OMNamespace
-            definedNamespace = ns;
-        } else {
-            // Create a deferred namespace that forces an expand to get the prefix
-            String uri = ns.getNamespaceURI();
-            definedNamespace = new DeferredNamespace(this, uri);
-        }
-        definedNamespaceSet = true;
-    }
-
-    /**
-     * Constructor that takes a QName instead of the local name and the namespace seperately
-     *
-     * @param qName
-     * @param factory
-     * @param source
-     */
-    public void init(QName qName, OMDataSource source) {
-        if (source == null) {
-            throw new IllegalArgumentException("OMDataSource can't be null");
-        }
-        internalSetLocalName(qName.getLocalPart());
-        dataSource = source;
-        isExpanded = false;
-        if (!isLossyPrefix(dataSource)) {
-            // Believe the prefix and create a normal OMNamespace
-            definedNamespace = getOMNamespace(qName);
-        } else {
-            // Create a deferred namespace that forces an expand to get the prefix
-            String uri = qName.getNamespaceURI();
-            definedNamespace = uri.length() == 0 ? null : new DeferredNamespace(this, uri);
-        }
-        definedNamespaceSet = true;
-    }
-
     public OMSourcedElementImpl(OMFactory factory) {
         super(factory);
     }
-
-    /**
-     * The namespace uri is immutable, but the OMDataSource may change
-     * the value of the prefix.  This method queries the OMDataSource to 
-     * see if the prefix is known.
-     * @param source
-     * @return true or false
-     */
-    private static boolean isLossyPrefix(OMDataSource source) {
-        Object lossyPrefix = null;
-        if (source instanceof OMDataSourceExt) {
-            lossyPrefix = 
-                ((OMDataSourceExt) source).getProperty(OMDataSourceExt.LOSSY_PREFIX);
-                        
-        }
-        return lossyPrefix == Boolean.TRUE;
-    }
-
-    /**
-     * Generate element name for output.
-     *
-     * @return name
-     */
-    private String getPrintableName() {
-        if (isExpanded || (definedNamespaceSet && internalGetLocalName() != null)) {
-            String uri = null;
-            if (getNamespace() != null) {
-                uri = getNamespace().getNamespaceURI();
-            }
-            if (uri == null || uri.length() == 0) {
-                return getLocalName();
-            } else {
-                return "{" + uri + '}' + getLocalName();
-            }
-        } else {
-            return "<unknown>";
-        }
-    }
-
-    /**
-     * Set parser for OM, if not previously set. Since the builder is what actually constructs the
-     * tree on demand, this first creates a builder
-     */
-    public void forceExpand() {
-        // The dataSource != null is required because this method may be called indirectly
-        // by the constructor before the data source is set. After the constructor has completed,
-        // isExpanded is always true if dataSource is null.
-        if (!isExpanded && dataSource != null) {
-
-            if (log.isDebugEnabled()) {
-                log.debug("forceExpand: expanding element " +
-                        getPrintableName());
-                if(forceExpandLog.isDebugEnabled()){
-                    // When using an OMSourcedElement, it can be particularly difficult to
-                    // determine why an expand occurs... a stack trace should help debugging this
-                    Exception e = new Exception("Debug Stack Trace");
-                    forceExpandLog.debug("forceExpand stack", e);
-                }
-            }
-
-            if (OMDataSourceUtil.isPushDataSource(dataSource)) {
-                // Set this before we start expanding; otherwise this would result in an infinite recursion
-                isExpanded = true;
-                try {
-                    dataSource.serialize(new PushOMBuilder(this));
-                } catch (XMLStreamException ex) {
-                    throw new OMException("Failed to expand data source", ex);
-                }
-            } else {
-                // Get the XMLStreamReader
-                XMLStreamReader readerFromDS;
-                try {
-                    readerFromDS = dataSource.getReader();  
-                } catch (XMLStreamException ex) {
-                    throw new OMException("Error obtaining parser from data source for element " + getPrintableName(), ex);
-                }
-                
-                // Advance past the START_DOCUMENT to the start tag.
-                // Remember the character encoding.
-                String characterEncoding = readerFromDS.getCharacterEncodingScheme();
-                if (characterEncoding != null) {
-                    characterEncoding = readerFromDS.getEncoding();
-                }
-                try {
-                    if (readerFromDS.getEventType() != XMLStreamConstants.START_ELEMENT) {
-                        while (readerFromDS.next() != XMLStreamConstants.START_ELEMENT) ;
-                    }
-                } catch (XMLStreamException ex) {
-                    throw new OMException("Error parsing data source document for element " + getLocalName(), ex);
-                }
-    
-                validateName(readerFromDS.getPrefix(), readerFromDS.getLocalName(), readerFromDS.getNamespaceURI());
-    
-                // Set the builder for this element. Note that the StAXOMBuilder constructor will also
-                // update the namespace of the element, so we don't need to do that here.
-                isExpanded = true;
-                StAXOMBuilder builder = new StAXOMBuilder(getOMFactory(), readerFromDS, this, characterEncoding);
-                builder.setAutoClose(true);
-                coreSetBuilder(builder);
-                setComplete(false);
-            }
-        }
-    }
-    
-    /**
-     * Validates that the actual name of the element obtained from StAX matches the information
-     * specified when the sourced element was constructed or retrieved through the
-     * {@link QNameAwareOMDataSource} interface. Also updates the local name if necessary. Note that
-     * the namespace information is not updated; this is the responsibility of the builder (and is
-     * done at the same time as namespace repairing).
-     * 
-     * @param staxPrefix
-     * @param staxLocalName
-     * @param staxNamespaceURI
-     */
-    void validateName(String staxPrefix, String staxLocalName, String staxNamespaceURI) {
-        if (internalGetLocalName() == null) {
-            // The local name was not known in advance; initialize it from the reader
-            internalSetLocalName(staxLocalName);
-        } else {
-            // Make sure element local name and namespace matches what was expected
-            if (!staxLocalName.equals(internalGetLocalName())) {
-                throw new OMException("Element name from data source is " +
-                        staxLocalName + ", not the expected " + internalGetLocalName());
-            }
-        }
-        if (definedNamespaceSet) {
-            if (staxNamespaceURI == null) {
-                staxNamespaceURI = "";
-            }
-            String namespaceURI = definedNamespace == null ? "" : definedNamespace.getNamespaceURI();
-            if (!staxNamespaceURI.equals(namespaceURI)) {
-                throw new OMException("Element namespace from data source is " +
-                        staxNamespaceURI + ", not the expected " + namespaceURI);
-            }
-            if (!(definedNamespace instanceof DeferredNamespace)) {
-                if (staxPrefix == null) {
-                    staxPrefix = "";
-                }
-                String prefix = definedNamespace == null ? "" : definedNamespace.getPrefix();
-                if (!staxPrefix.equals(prefix)) {
-                    throw new OMException("Element prefix from data source is '" +
-                            staxPrefix + "', not the expected '" + prefix + "'");
-                }
-            }
-        }
-    }
-    
-    /**
-     * Check if element has been expanded into tree.
-     *
-     * @return <code>true</code> if expanded, <code>false</code> if not
-     */
-    public boolean isExpanded() {
-        return isExpanded;
-    }
-
-    public XMLStreamReader getXMLStreamReader(boolean cache, OMXMLStreamReaderConfiguration configuration) {
-        if (log.isDebugEnabled()) {
-            log.debug("getting XMLStreamReader for " + getPrintableName()
-                    + " with cache=" + cache);
-        }
-        if (isExpanded) {
-            return defaultGetXMLStreamReader(cache, configuration);
-        } else {
-            if ((cache && OMDataSourceUtil.isDestructiveRead(dataSource)) || OMDataSourceUtil.isPushDataSource(dataSource)) {
-                forceExpand();
-                return defaultGetXMLStreamReader(true, configuration);
-            } else {
-                try {
-                    return dataSource.getReader();  
-                } catch (XMLStreamException ex) {
-                    throw new OMException("Error obtaining parser from data source for element " + getPrintableName(), ex);
-                }
-            }
-        }
-    }
-
-    public final void updateLocalName() {
-        if (dataSource instanceof QNameAwareOMDataSource) {
-            internalSetLocalName(((QNameAwareOMDataSource)dataSource).getLocalName());
-        }
-        if (internalGetLocalName() == null) {
-            forceExpand();
-        }
-    }
-
-    public OMNamespace getNamespace() throws OMException {
-        if (isExpanded()) {
-            return defaultGetNamespace();
-        } else if (definedNamespaceSet) {
-            return definedNamespace;
-        } else {
-            if (dataSource instanceof QNameAwareOMDataSource) {
-                String namespaceURI = ((QNameAwareOMDataSource)dataSource).getNamespaceURI();
-                if (namespaceURI != null) {
-                    if (namespaceURI.length() == 0) {
-                        // No namespace case. definedNamespace is already null, so we only need
-                        // to set definedNamespaceSet to true. Note that we don't need to retrieve
-                        // the namespace prefix because a prefix can't be bound to the empty
-                        // namespace URI.
-                        definedNamespaceSet = true;
-                    } else {
-                        String prefix = ((QNameAwareOMDataSource)dataSource).getPrefix();
-                        if (prefix == null) {
-                            // Prefix is unknown
-                            definedNamespace = new DeferredNamespace(this, namespaceURI);
-                        } else {
-                            definedNamespace = new OMNamespaceImpl(namespaceURI, prefix);
-                        }
-                        definedNamespaceSet = true;
-                    }
-                }
-            }
-            if (definedNamespaceSet) {
-                return definedNamespace;
-            } else {
-                // We have no information about the namespace of the element. Need to expand
-                // the element to get it.
-                forceExpand();
-                return defaultGetNamespace();
-            }
-        }
-    }
-
-    public QName getQName() {
-        if (isExpanded()) {
-            return defaultGetQName();
-        } else if (getNamespace() != null) {
-            // always ignore prefix on name from sourced element
-            return new QName(getNamespace().getNamespaceURI(), getLocalName());
-        } else {
-            return new QName(getLocalName());
-        }
-    }
-
-    public <T> void initSource(ClonePolicy<T> policy, T options, CoreElement other) {
-        OMSourcedElementImpl o = (OMSourcedElementImpl)other;
-        // If already expanded or this is not an OMDataSourceExt, then
-        // create a copy of the OM Tree
-        OMDataSource ds = o.getDataSource();
-        if (!(options instanceof OMCloneOptions) || !((OMCloneOptions)options).isCopyOMDataSources() ||
-            ds == null || 
-            o.isExpanded() || 
-            !(ds instanceof OMDataSourceExt)) {
-            return;
-        }
-        
-        // If copying is destructive, then copy the OM tree
-        OMDataSourceExt sourceDS = (OMDataSourceExt) ds;
-        if (sourceDS.isDestructiveRead() ||
-            sourceDS.isDestructiveWrite()) {
-            return;
-        }
-        OMDataSourceExt targetDS = ((OMDataSourceExt) ds).copy();
-        if (targetDS == null) {
-            return;
-        }
-        // Otherwise create a target OMSE with the copied DataSource
-        init(targetDS);
-        definedNamespaceSet = o.definedNamespaceSet;
-        if (o.definedNamespace instanceof DeferredNamespace) {
-            definedNamespace = new DeferredNamespace(this, o.definedNamespace.getNamespaceURI());
-        } else {
-            definedNamespace = o.definedNamespace;
-        }
-    }
-
-    public void internalSerialize(Serializer serializer, OMOutputFormat format, boolean cache)
-            throws OutputException {
-        if (isExpanded()) {
-            defaultInternalSerialize(serializer, format, cache);
-        } else if (cache) {
-            if (OMDataSourceUtil.isDestructiveWrite(dataSource)) {
-                forceExpand();
-                defaultInternalSerialize(serializer, format, true);
-            } else {
-                serializer.serialize(dataSource);
-            }
-        } else {
-            serializer.serialize(dataSource); 
-        }
-    }
-
-    /**
-     * Provide access to the data source encapsulated in OMSourcedElement. 
-     * This is usesful when we want to access the raw data in the data source.
-     *
-     * @return the internal datasource
-     */
-    public OMDataSource getDataSource() {
-        return dataSource;
-    }
-    
-    /**
-     * setOMDataSource
-     */
-    public OMDataSource setDataSource(OMDataSource dataSource) {
-        if (!isExpanded()) {
-            OMDataSource oldDS = this.dataSource;
-            this.dataSource = dataSource;
-            return oldDS;  // Caller is responsible for closing the data source
-        } else {
-            // TODO
-            // Remove the entire subtree and replace with 
-            // new datasource.  There maybe a more performant way to do this.
-            OMDataSource oldDS = this.dataSource;
-            Iterator it = getChildren();
-            while(it.hasNext()) {
-                it.next();
-                it.remove();
-            }
-            this.dataSource = dataSource;
-            setComplete(false);
-            isExpanded = false;
-            coreSetBuilder(null);
-            if (isLossyPrefix(dataSource)) {
-                // Create a deferred namespace that forces an expand to get the prefix
-                definedNamespace = new DeferredNamespace(this, definedNamespace.getNamespaceURI());
-            }
-            return oldDS;
-        }
-    }
-
-    /**
-     * setComplete override The OMSourcedElement has its own isolated builder/reader during the
-     * expansion process. Thus calls to setCompete should stop here and not propogate up to the
-     * parent (which may have a different builder or no builder).
-     */
-    public void setComplete(boolean complete) {
-        coreSetState(complete ? COMPLETE : INCOMPLETE);
-        if (complete && dataSource != null) {
-            if (dataSource instanceof OMDataSourceExt) {
-                ((OMDataSourceExt)dataSource).close();
-            }
-            dataSource = null;
-        }
-    }
-    
-    public Object getObject(Class dataSourceClass) {
-        if (dataSource == null || isExpanded || !dataSourceClass.isInstance(dataSource)) {
-            return null;
-        } else {
-            return ((OMDataSourceExt)dataSource).getObject();
-        }
-    }
 }

Modified: webservices/axiom/trunk/implementations/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/implementations/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java?rev=1700364&r1=1700363&r2=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/implementations/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java (original)
+++ webservices/axiom/trunk/implementations/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java Mon Aug 31 22:18:09 2015
@@ -34,7 +34,7 @@ import org.apache.axiom.ts.om.sourcedele
 
 public class OMImplementationTest extends TestCase {
     public static TestSuite suite() {
-        OMTestSuiteBuilder builder = new OMTestSuiteBuilder(new OMLinkedListMetaFactory(), true);
+        OMTestSuiteBuilder builder = new OMTestSuiteBuilder(new OMLinkedListMetaFactory());
         // TODO: Axiom should throw an exception if an attempt is made to create a cyclic parent-child relationship
         builder.exclude(TestInsertSiblingAfterOnChild.class);
         builder.exclude(TestInsertSiblingBeforeOnChild.class);

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1700364&r1=1700363&r2=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Mon Aug 31 22:18:09 2015
@@ -57,11 +57,9 @@ public class OMTestSuiteBuilder extends
         new QName("urn:test", "root") };
     
     private final OMMetaFactory metaFactory;
-    private final boolean supportsOMSourcedElement;
     
-    public OMTestSuiteBuilder(OMMetaFactory metaFactory, boolean supportsOMSourcedElement) {
+    public OMTestSuiteBuilder(OMMetaFactory metaFactory) {
         this.metaFactory = metaFactory;
-        this.supportsOMSourcedElement = supportsOMSourcedElement;
     }
     
     protected void addTests() {
@@ -455,10 +453,8 @@ public class OMTestSuiteBuilder extends
                 addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNamespaceInScope4(metaFactory, variant));
             }
         }
-        if (supportsOMSourcedElement) {
-            addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullOMDataSource1(metaFactory));
-            addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullOMDataSource2(metaFactory));
-        }
+        addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullOMDataSource1(metaFactory));
+        addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullOMDataSource2(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMElementWithNullURIAndPrefix(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMEntityReference(metaFactory));
         addTest(new org.apache.axiom.ts.om.factory.TestCreateOMEntityReferenceWithNullParent(metaFactory));
@@ -499,104 +495,102 @@ public class OMTestSuiteBuilder extends
         addTest(new org.apache.axiom.ts.om.node.TestInsertSiblingBeforeOnOrphan(metaFactory));
         addTest(new org.apache.axiom.ts.om.node.TestInsertSiblingBeforeOnSelf(metaFactory));
         addTest(new org.apache.axiom.ts.om.node.TestInsertSiblingBeforeSameParent(metaFactory));
-        if (supportsOMSourcedElement) {
-            for (int i=0; i<OMSourcedElementVariant.INSTANCES.length; i++) {
-                OMSourcedElementVariant variant = OMSourcedElementVariant.INSTANCES[i];
-                for (int j=0; j<qnames.length; j++) {
-                    QName qname = qnames[j];
-                    addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetLocalName(metaFactory, variant, qname));
-                    addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNamespace(metaFactory, variant, qname));
-                    addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetPrefix(metaFactory, variant, qname));
-                    addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNamespaceURI(metaFactory, variant, qname));
-                    addTest(new org.apache.axiom.ts.om.sourcedelement.TestHasName(metaFactory, variant, qname));
-                }
+        for (int i=0; i<OMSourcedElementVariant.INSTANCES.length; i++) {
+            OMSourcedElementVariant variant = OMSourcedElementVariant.INSTANCES[i];
+            for (int j=0; j<qnames.length; j++) {
+                QName qname = qnames[j];
+                addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetLocalName(metaFactory, variant, qname));
+                addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNamespace(metaFactory, variant, qname));
+                addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetPrefix(metaFactory, variant, qname));
+                addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNamespaceURI(metaFactory, variant, qname));
+                addTest(new org.apache.axiom.ts.om.sourcedelement.TestHasName(metaFactory, variant, qname));
             }
-            for (AddAttributeStrategy strategy : getInstances(AddAttributeStrategy.class)) {
-                addTest(new org.apache.axiom.ts.om.sourcedelement.TestAddAttribute(metaFactory, strategy));
-            }
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestByteArrayDS(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestCharArrayDS(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloneNonDestructive(metaFactory, true));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloneNonDestructive(metaFactory, false));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloneUnknownName(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloseOnComplete(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestComplete(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestDeclareNamespace(metaFactory));
+        }
+        for (AddAttributeStrategy strategy : getInstances(AddAttributeStrategy.class)) {
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestAddAttribute(metaFactory, strategy));
+        }
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestByteArrayDS(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestCharArrayDS(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloneNonDestructive(metaFactory, true));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloneNonDestructive(metaFactory, false));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloneUnknownName(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloseOnComplete(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestComplete(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestDeclareNamespace(metaFactory));
+        for (ExpansionStrategy es : getInstances(ExpansionStrategy.class)) {
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestDetach(metaFactory, es));
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestDiscard(metaFactory, es));
+        }
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestExpand(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetAllAttributes(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetAllDeclaredNamespaces(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetAttribute(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetAttributeValue(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetDocumentFromBuilder(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNamespaceNormalized(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNamespaceNormalized2(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNextOMSiblingIncomplete(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetObject(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetReaderException(metaFactory));
+        for (int i=0; i<PushOMDataSourceScenario.INSTANCES.length; i++) {
+            PushOMDataSourceScenario scenario = PushOMDataSourceScenario.INSTANCES[i];
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetSAXSourceWithPushOMDataSource(metaFactory, scenario, false));
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetSAXSourceWithPushOMDataSource(metaFactory, scenario, true));
+        }
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetTextAsStreamWithNonDestructiveOMDataSource(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestInputStreamDS(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName1DefaultPrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName1QualifiedPrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName1Unqualified(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName2DefaultPrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName2QualifiedPrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName2Unqualified(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName3DefaultPrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName3QualifiedPrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName3Unqualified(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName4DefaultPrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName4QualifiedPrefix(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestName4Unqualified(metaFactory));
+        for (int i=0; i<PushOMDataSourceScenario.INSTANCES.length; i++) {
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestPushOMDataSourceExpansion(metaFactory, PushOMDataSourceScenario.INSTANCES[i]));
+        }
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestRemoveChildrenUnexpanded(metaFactory));
+        for (ElementContext ec : getInstances(ElementContext.class)) {
             for (ExpansionStrategy es : getInstances(ExpansionStrategy.class)) {
-                addTest(new org.apache.axiom.ts.om.sourcedelement.TestDetach(metaFactory, es));
-                addTest(new org.apache.axiom.ts.om.sourcedelement.TestDiscard(metaFactory, es));
-            }
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestExpand(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetAllAttributes(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetAllDeclaredNamespaces(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetAttribute(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetAttributeValue(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetDocumentFromBuilder(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNamespaceNormalized(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNamespaceNormalized2(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetNextOMSiblingIncomplete(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetObject(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetReaderException(metaFactory));
-            for (int i=0; i<PushOMDataSourceScenario.INSTANCES.length; i++) {
-                PushOMDataSourceScenario scenario = PushOMDataSourceScenario.INSTANCES[i];
-                addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetSAXSourceWithPushOMDataSource(metaFactory, scenario, false));
-                addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetSAXSourceWithPushOMDataSource(metaFactory, scenario, true));
-            }
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetTextAsStreamWithNonDestructiveOMDataSource(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestInputStreamDS(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName1DefaultPrefix(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName1QualifiedPrefix(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName1Unqualified(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName2DefaultPrefix(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName2QualifiedPrefix(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName2Unqualified(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName3DefaultPrefix(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName3QualifiedPrefix(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName3Unqualified(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName4DefaultPrefix(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName4QualifiedPrefix(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestName4Unqualified(metaFactory));
-            for (int i=0; i<PushOMDataSourceScenario.INSTANCES.length; i++) {
-                addTest(new org.apache.axiom.ts.om.sourcedelement.TestPushOMDataSourceExpansion(metaFactory, PushOMDataSourceScenario.INSTANCES[i]));
-            }
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestRemoveChildrenUnexpanded(metaFactory));
-            for (ElementContext ec : getInstances(ElementContext.class)) {
-                for (ExpansionStrategy es : getInstances(ExpansionStrategy.class)) {
-                    for (SerializationStrategy ss : getInstances(SerializationStrategy.class)) {
-                        for (int count = 1; count <= 2; count++) {
-                            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, false, false, ec, es, ss, false, count));
-                            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, false, true, ec, es, ss, false, count));
+                for (SerializationStrategy ss : getInstances(SerializationStrategy.class)) {
+                    for (int count = 1; count <= 2; count++) {
+                        addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, false, false, ec, es, ss, false, count));
+                        addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, false, true, ec, es, ss, false, count));
+                        if (ec != ElementContext.ORPHAN) {
+                            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, false, false, ec, es, ss, true, count));
+                            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, false, true, ec, es, ss, true, count));
+                        }
+                        if (es != ExpansionStrategy.PARTIAL) {
+                            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, true, false, ec, es, ss, false, count));
+                            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, true, true, ec, es, ss, false, count));
                             if (ec != ElementContext.ORPHAN) {
-                                addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, false, false, ec, es, ss, true, count));
-                                addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, false, true, ec, es, ss, true, count));
-                            }
-                            if (es != ExpansionStrategy.PARTIAL) {
-                                addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, true, false, ec, es, ss, false, count));
-                                addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, true, true, ec, es, ss, false, count));
-                                if (ec != ElementContext.ORPHAN) {
-                                    addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, true, false, ec, es, ss, true, count));
-                                    addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, true, true, ec, es, ss, true, count));
-                                }
+                                addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, true, false, ec, es, ss, true, count));
+                                addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerialize(metaFactory, true, true, ec, es, ss, true, count));
                             }
                         }
                     }
                 }
             }
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeModifiedOMSEWithNonDestructiveDataSource(metaFactory));
-            for (SerializationStrategy ss : getInstances(SerializationStrategy.class)) {
-                addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeOMDataSourceWritingToOutputStream(metaFactory, ss, false));
-                addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeOMDataSourceWritingToOutputStream(metaFactory, ss, true));
-            }
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetDataSource(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetDataSourceOnAlreadyExpandedElement(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetLocalName(metaFactory, false));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetLocalName(metaFactory, true));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestWrappedTextNodeOMDataSourceFromReader(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestWriteTextToWithNonDestructiveOMDataSource(metaFactory));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.sr.TestGetName(metaFactory));
-            for (int events = 0; events < 7; events++) {
-                addTest(new org.apache.axiom.ts.om.sourcedelement.sr.TestCloseWithoutCaching(metaFactory, events));
-            }
+        }
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeModifiedOMSEWithNonDestructiveDataSource(metaFactory));
+        for (SerializationStrategy ss : getInstances(SerializationStrategy.class)) {
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeOMDataSourceWritingToOutputStream(metaFactory, ss, false));
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeOMDataSourceWritingToOutputStream(metaFactory, ss, true));
+        }
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetDataSource(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetDataSourceOnAlreadyExpandedElement(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetLocalName(metaFactory, false));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestSetLocalName(metaFactory, true));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestWrappedTextNodeOMDataSourceFromReader(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.TestWriteTextToWithNonDestructiveOMDataSource(metaFactory));
+        addTest(new org.apache.axiom.ts.om.sourcedelement.sr.TestGetName(metaFactory));
+        for (int events = 0; events < 7; events++) {
+            addTest(new org.apache.axiom.ts.om.sourcedelement.sr.TestCloseWithoutCaching(metaFactory, events));
         }
         addTest(new org.apache.axiom.ts.om.pi.TestDigest(metaFactory));
         addTest(new org.apache.axiom.ts.om.text.TestBase64StreamingWithGetSAXSource(metaFactory));

Modified: webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestDetach.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestDetach.java?rev=1700364&r1=1700363&r2=1700364&view=diff
==============================================================================
--- webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestDetach.java (original)
+++ webservices/axiom/trunk/testing/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/sourcedelement/TestDetach.java Mon Aug 31 22:18:09 2015
@@ -56,7 +56,7 @@ public class TestDetach extends AxiomTes
         omse.detach();
         ASSERT.that(ds.hasUnclosedReaders()).isEqualTo(expansionStrategy == PARTIAL);
         ASSERT.that(ds.getReaderRequestCount()).isEqualTo(expansionStrategy == DONT_EXPAND ? 0 : 1);
-        ASSERT.about(xml()).that(parent).hasSameContentAs(xml1);
-        ASSERT.about(xml()).that(omse).hasSameContentAs(xml2);
+        ASSERT.about(xml()).that(xml(OMElement.class, parent)).hasSameContentAs(xml1);
+        ASSERT.about(xml()).that(xml(OMElement.class, omse)).hasSameContentAs(xml2);
     }
 }



Mime
View raw message