You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2013/01/11 21:28:10 UTC

svn commit: r1432269 [2/2] - in /webservices/axiom/branches/AXIOM-201: ./ apidocs/ code-coverage/ modules/axiom-api/src/main/java/org/apache/axiom/om/ modules/axiom-api/src/main/java/org/apache/axiom/om/impl/builder/ modules/axiom-api/src/main/java/org...

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMElementImpl.java Fri Jan 11 20:28:08 2013
@@ -225,6 +225,9 @@ public class OMElementImpl extends OMNod
         OMContainerHelper.addChild(this, omNode, fromBuilder);
     }
 
+    public void checkChild(OMNode child) {
+    }
+
     /**
      * Searches for children with a given QName and returns an iterator to traverse through the
      * OMNodes. This QName can contain any combination of prefix, localname and URI.

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/OMSourcedElementImpl.java Fri Jan 11 20:28:08 2013
@@ -93,8 +93,6 @@ public class OMSourcedElementImpl extend
     
     private static final Log forceExpandLog = LogFactory.getLog(OMSourcedElementImpl.class.getName() + ".forceExpand");
     
-    private XMLStreamReader readerFromDS = null;  // Reader from DataSource
-
     private static OMNamespace getOMNamespace(QName qName) {
         return qName.getNamespaceURI().length() == 0 ? null
                 : new OMNamespaceImpl(qName.getNamespaceURI(), qName.getPrefix());
@@ -251,6 +249,7 @@ public class OMSourcedElementImpl extend
                 }
             } else {
                 // Get the XMLStreamReader
+                XMLStreamReader readerFromDS;
                 try {
                     readerFromDS = dataSource.getReader();  
                 } catch (XMLStreamException ex) {
@@ -276,10 +275,10 @@ public class OMSourcedElementImpl extend
                 // 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;
-                super.setBuilder(new StAXOMBuilder(getOMFactory(), 
-                                                   readerFromDS, 
-                                                   this, 
-                                                   characterEncoding));
+                StAXOMBuilder builder = new StAXOMBuilder(getOMFactory(), readerFromDS, this, characterEncoding);
+                builder.setAutoClose(true);
+                builder.releaseParserOnClose(true);
+                super.setBuilder(builder);
                 setComplete(false);
             }
         }
@@ -845,6 +844,10 @@ public class OMSourcedElementImpl extend
         super.addChild(omNode, fromBuilder);
     }
 
+    public void checkChild(OMNode child) {
+        super.checkChild(child);
+    }
+
     public Iterator getChildrenWithName(QName elementQName) {
         forceExpand();
         return super.getChildrenWithName(elementQName);
@@ -1029,29 +1032,13 @@ 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 value) {
-        state = value ? COMPLETE : INCOMPLETE;
-        if (value == true) {
-            if (readerFromDS != null) {
-                try {
-                    readerFromDS.close();
-                } catch (XMLStreamException e) {
-                }
-                readerFromDS = null;
-            }
-            if (dataSource != null) {
-                if (dataSource instanceof OMDataSourceExt) {
-                    ((OMDataSourceExt)dataSource).close();
-                }
-                dataSource = null;
-            }
-        }
-        if (value == true && readerFromDS != null) {
-            try {
-                readerFromDS.close();
-            } catch (XMLStreamException e) {
+    public void setComplete(boolean complete) {
+        state = complete ? COMPLETE : INCOMPLETE;
+        if (complete && dataSource != null) {
+            if (dataSource instanceof OMDataSourceExt) {
+                ((OMDataSourceExt)dataSource).close();
             }
-            readerFromDS = null;
+            dataSource = null;
         }
     }
     

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListImplFactory.java Fri Jan 11 20:28:08 2013
@@ -20,6 +20,7 @@
 package org.apache.axiom.om.impl.llom.factory;
 
 import org.apache.axiom.ext.stax.datahandler.DataHandlerProvider;
+import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMComment;
 import org.apache.axiom.om.OMContainer;
@@ -57,10 +58,18 @@ import javax.xml.namespace.QName;
 public class OMLinkedListImplFactory implements OMFactoryEx {
     private final OMLinkedListMetaFactory metaFactory;
     
-    public OMLinkedListImplFactory(OMLinkedListMetaFactory metaFactory) {
+    /**
+     * For internal use only.
+     * 
+     * @param metaFactory
+     */
+    protected OMLinkedListImplFactory(OMLinkedListMetaFactory metaFactory) {
         this.metaFactory = metaFactory;
     }
     
+    /**
+     * @deprecated Use {@link OMAbstractFactory#getOMFactory()} to get an instance of this class.
+     */
     public OMLinkedListImplFactory() {
         this(new OMLinkedListMetaFactory());
     }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/factory/OMLinkedListMetaFactory.java Fri Jan 11 20:28:08 2013
@@ -51,4 +51,16 @@ public class OMLinkedListMetaFactory ext
     public SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
         return new SOAPMessageImpl(builder, null);
     }
+
+    public int hashCode() {
+        return getClass().hashCode();
+    }
+    
+    public boolean equals(Object obj) {
+        // All instances of this class are considered equal. This is only required
+        // to support legacy code that instantiates OMFactory implementations directly
+        // (in which case the OMMetaFactory implementation is not guaranteed to be
+        // a singleton). May be removed in Axiom 1.3.
+        return obj != null && obj.getClass() == getClass();
+    }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPEnvelopeImpl.java Fri Jan 11 20:28:08 2013
@@ -101,7 +101,8 @@ public class SOAPEnvelopeImpl extends SO
      * 
      * @param child
      */
-    private void checkChild(OMNode child) {
+    // TODO: this should be integrated into the checkChild API
+    private void internalCheckChild(OMNode child) {
         if ((child instanceof OMElement)
                 && !(child instanceof SOAPHeader || child instanceof SOAPBody)) {
             throw new SOAPProcessingException(
@@ -118,7 +119,7 @@ public class SOAPEnvelopeImpl extends SO
         // SOAP 1.1 allows for arbitrary elements after SOAPBody so do NOT check for
         // node types when appending to SOAP 1.1 envelope.
         if (getVersion() instanceof SOAP12Version) {
-            checkChild(child);
+            internalCheckChild(child);
         }
 
         if (child instanceof SOAPHeader) {

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/SOAPMessageImpl.java Fri Jan 11 20:28:08 2013
@@ -22,6 +22,7 @@ package org.apache.axiom.soap.impl.llom;
 import org.apache.axiom.om.OMCloneOptions;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.OMNodeEx;
 import org.apache.axiom.om.impl.llom.OMDocumentImpl;
@@ -49,13 +50,14 @@ public class SOAPMessageImpl extends OMD
         return (SOAPEnvelope) getOMDocumentElement();
     }
 
-    public void setSOAPEnvelope(SOAPEnvelope envelope) throws SOAPProcessingException {
-        super.addChild(envelope, true);
+    public void setSOAPEnvelope(SOAPEnvelope envelope) {
+        setOMDocumentElement(envelope);
     }
 
-    public void setOMDocumentElement(OMElement rootElement) {
-        throw new UnsupportedOperationException(
-                "This is not allowed. Use set SOAPEnvelope instead");
+    protected void checkDocumentElement(OMElement element) {
+        if (!(element instanceof SOAPEnvelope)) {
+            throw new OMException("Child not allowed; must be a SOAPEnvelope");
+        }
     }
 
     protected void internalSerialize(XMLStreamWriter writer, boolean cache,

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap11/SOAP11Factory.java Fri Jan 11 20:28:08 2013
@@ -19,6 +19,7 @@
 
 package org.apache.axiom.soap.impl.llom.soap11;
 
+import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
@@ -50,10 +51,19 @@ import org.apache.axiom.soap.impl.llom.S
 /**
  */
 public class SOAP11Factory extends OMLinkedListImplFactory implements SOAPFactoryEx {
+    /**
+     * For internal use only.
+     * 
+     * @param metaFactory
+     */
     public SOAP11Factory(OMLinkedListMetaFactory metaFactory) {
         super(metaFactory);
     }
 
+    /**
+     * @deprecated Use {@link OMAbstractFactory#getSOAP11Factory()} to get an instance of this
+     *             class.
+     */
     public SOAP11Factory() {
     }
 
@@ -324,7 +334,12 @@ public class SOAP11Factory extends OMLin
     }
 
     public SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
-        return new SOAPMessageImpl(builder, this);
+        if (builder == null) {
+            // For Spring-WS compatibility
+            return createSOAPMessage();
+        } else {
+            return new SOAPMessageImpl(builder, this);
+        }
     }
 
     public SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper builder) {

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/soap/impl/llom/soap12/SOAP12Factory.java Fri Jan 11 20:28:08 2013
@@ -19,6 +19,7 @@
 
 package org.apache.axiom.soap.impl.llom.soap12;
 
+import org.apache.axiom.om.OMAbstractFactory;
 import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMXMLParserWrapper;
@@ -50,10 +51,19 @@ import org.apache.axiom.soap.impl.llom.S
 /**
  */
 public class SOAP12Factory extends OMLinkedListImplFactory implements SOAPFactoryEx {
+    /**
+     * For internal use only.
+     * 
+     * @param metaFactory
+     */
     public SOAP12Factory(OMLinkedListMetaFactory metaFactory) {
         super(metaFactory);
     }
 
+    /**
+     * @deprecated Use {@link OMAbstractFactory#getSOAP12Factory()} to get an instance of this
+     *             class.
+     */
     public SOAP12Factory() {
     }
 
@@ -327,7 +337,12 @@ public class SOAP12Factory extends OMLin
     }
 
     public SOAPMessage createSOAPMessage(OMXMLParserWrapper builder) {
-        return new SOAPMessageImpl(builder, this);
+        if (builder == null) {
+            // For Spring-WS compatibility
+            return createSOAPMessage();
+        } else {
+            return new SOAPMessageImpl(builder, this);
+        }
     }
 
     public SOAPEnvelope createSOAPEnvelope(SOAPMessage message, OMXMLParserWrapper builder) {

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/OMTestSuiteBuilder.java Fri Jan 11 20:28:08 2013
@@ -132,6 +132,7 @@ public class OMTestSuiteBuilder extends 
             }
         }
         addTest(new org.apache.axiom.ts.om.document.TestAddChildIncomplete(metaFactory));
+        addTest(new org.apache.axiom.ts.om.document.TestAddChildWithExistingDocumentElement(metaFactory));
         for (int i=0; i<conformanceFiles.length; i++) {
             addTest(new org.apache.axiom.ts.om.document.TestClone(metaFactory, conformanceFiles[i]));
         }
@@ -433,6 +434,7 @@ public class OMTestSuiteBuilder extends 
             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.TestExpand(metaFactory));
             addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetDocumentFromBuilder(metaFactory));
@@ -506,7 +508,8 @@ public class OMTestSuiteBuilder extends 
         addTest(new org.apache.axiom.ts.om.text.TestBase64StreamingWithSerialize(metaFactory));
         addTest(new org.apache.axiom.ts.om.text.TestDigest(metaFactory));
         addTest(new org.apache.axiom.ts.om.text.TestGetTextCharactersFromDataHandler(metaFactory));
-        addTest(new org.apache.axiom.ts.om.xop.TestSerialize(metaFactory));
+        addTest(new org.apache.axiom.ts.om.xop.TestSerialize(metaFactory, false));
+        addTest(new org.apache.axiom.ts.om.xop.TestSerialize(metaFactory, true));
         addTest(new org.apache.axiom.ts.om.xop.XOPRoundtripTest(metaFactory));
         Method[] methods = AXIOMXPathTestCase.class.getMethods();
         for (int i=0; i<methods.length; i++) {

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestRootPartStreaming.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestRootPartStreaming.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestRootPartStreaming.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestRootPartStreaming.java Fri Jan 11 20:28:08 2013
@@ -49,7 +49,7 @@ public class TestRootPartStreaming exten
         
         // Programmatically create the message
         OMElement orgRoot = factory.createOMElement("root", null);
-        for (int i=0; i<1000; i++) {
+        for (int i=0; i<10000; i++) {
             factory.createOMElement("child", null, orgRoot).setText("Some text content");
         }
         

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/xop/TestSerialize.java Fri Jan 11 20:28:08 2013
@@ -18,7 +18,6 @@
  */
 package org.apache.axiom.ts.om.xop;
 
-import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.InputStream;
 
@@ -36,8 +35,12 @@ import org.apache.axiom.om.util.StAXPars
 import org.apache.axiom.ts.AxiomTestCase;
 
 public class TestSerialize extends AxiomTestCase {
-    public TestSerialize(OMMetaFactory metaFactory) {
+    private final boolean base64;
+    
+    public TestSerialize(OMMetaFactory metaFactory, boolean base64) {
         super(metaFactory);
+        this.base64 = base64;
+        addTestProperty("base64", String.valueOf(base64));
     }
 
     protected void runTest() throws Throwable {
@@ -47,14 +50,14 @@ public class TestSerialize extends Axiom
         InputStream inStream = AbstractTestCase.getTestResource(testMessage.getName());
         Attachments attachments = new Attachments(inStream, testMessage.getContentType());
         
-        attachments.getRootPartInputStream();
-
-        String[] contentIDs = attachments.getAllContentIDs();
-        
         OMOutputFormat oof = new OMOutputFormat();
         oof.setDoOptimize(true);
         oof.setMimeBoundary(testMessage.getBoundary());
         oof.setRootContentId(testMessage.getStart());
+        if (base64) {
+            oof.setProperty(OMOutputFormat.USE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS, 
+                    Boolean.TRUE);
+        }
         
         // Write out the message
         ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -65,65 +68,15 @@ public class TestSerialize extends Axiom
         OMElement om = builder.getDocumentElement();
         om.serialize(writer);
         om.close(false);
-        String outNormal = baos.toString();
-        
-        assertTrue(outNormal.indexOf("base64") == -1);
-        
-        // Now do it again but use base64 content-type-encoding for 
-        // binary attachments
-        baos = new ByteArrayOutputStream();
-        oof.setProperty(OMOutputFormat.USE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS, 
-                        Boolean.TRUE);
-        writer = new MTOMXMLStreamWriter(baos, oof);
-        builder = 
-            OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), StAXParserConfiguration.DEFAULT, attachments);
-        om = builder.getDocumentElement();
-        om.serialize(writer);
-        om.close(false);
-        String outBase64 = baos.toString();
-        
-        
-        // Do a quick check to see if the data is base64 and is
-        // writing base64 compliant code.
-        assertTrue(outBase64.indexOf("base64") != -1);
-        assertTrue(outBase64.indexOf("GBgcGBQgHBwcJCQgKDBQNDAsL") != -1);
-        
-        // Now read the data back in
-        InputStream is = new ByteArrayInputStream(outBase64.getBytes());
-        Attachments attachments2 = new Attachments(is, testMessage.getContentType());
-        
-        // Now write it back out with binary...
-        baos = new ByteArrayOutputStream();
-        oof.setProperty(OMOutputFormat.USE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS, 
-                        Boolean.FALSE);
-        writer = new MTOMXMLStreamWriter(baos, oof);
-        builder = 
-            OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), StAXParserConfiguration.DEFAULT, attachments2);
-        om = builder.getDocumentElement();
-        om.serialize(writer);
-        om.close(false);
-        String outBase64ToNormal = baos.toString();
-        
-        assertTrue(outBase64ToNormal.indexOf("base64") == -1);
-        
-        // Now do it again but use base64 content-type-encoding for 
-        // binary attachments
-        is = new ByteArrayInputStream(outBase64.getBytes());
-        attachments2 = new Attachments(is, testMessage.getContentType());
-        baos = new ByteArrayOutputStream();
-        oof.setProperty(OMOutputFormat.USE_CTE_BASE64_FOR_NON_TEXTUAL_ATTACHMENTS, 
-                        Boolean.TRUE);
-        writer = new MTOMXMLStreamWriter(baos, oof);
-        builder = 
-            OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), StAXParserConfiguration.DEFAULT, attachments2);
-        om = builder.getDocumentElement();
-        om.serialize(writer);
-        om.close(false);
-        String outBase64ToBase64 = baos.toString();
+        String out = baos.toString();
         
-        // Do a quick check to see if the data is base64 and is
-        // writing base64 compliant code.
-        assertTrue(outBase64ToBase64.indexOf("base64") != -1);
-        assertTrue(outBase64ToBase64.indexOf("GBgcGBQgHBwcJCQgKDBQNDAsL") != -1);
+        if (base64) {
+            // Do a quick check to see if the data is base64 and is
+            // writing base64 compliant code.
+            assertTrue(out.indexOf("base64") != -1);
+            assertTrue(out.indexOf("GBgcGBQgHBwcJCQgKDBQNDAsL") != -1);
+        } else {
+            assertTrue(out.indexOf("base64") == -1);
+        }
     }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap/SOAPTestSuiteBuilder.java Fri Jan 11 20:28:08 2013
@@ -201,6 +201,8 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap.message.TestCloneIncomplete(metaFactory, spec, false));
         addTest(new org.apache.axiom.ts.soap.message.TestGetCharsetEncodingWithParser(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.message.TestGetOMFactoryWithParser(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.message.TestSetOMDocumentElement(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.message.TestSetOMDocumentElementNonSOAPEnvelope(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));
     }

Modified: webservices/axiom/branches/AXIOM-201/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/pom.xml?rev=1432269&r1=1432268&r2=1432269&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/pom.xml Fri Jan 11 20:28:08 2013
@@ -379,7 +379,7 @@
                         <artifactId>stax-api</artifactId>
                     </exclusion>
                 </exclusions>
-        </dependency>
+            </dependency>
         </dependencies>
     </dependencyManagement>
     <properties>
@@ -423,6 +423,7 @@
                         <includes>
                             <include>**/*Test.java</include>
                         </includes>
+                        <argLine>${jacoco.surefireArgLine}</argLine>
                         <systemProperties>
                             <property>
                                 <name>java.io.tmpdir</name>
@@ -516,6 +517,10 @@
                         </goals>
                         <configuration>
                             <rules>
+                                <requireJavaVersion>
+                                    <!-- We require Java 6 for the build, but we enforce Java 5 compatibility using Animal Sniffer -->
+                                    <version>1.6.0</version>
+                                </requireJavaVersion>
                                 <requireNoRepositories>
                                     <message>The POM must not include repository definitions since non Apache repositories threaten the build stability.</message>
                                     <banRepositories>true</banRepositories>
@@ -560,11 +565,33 @@
                 <version>2.3.2</version>
                 <inherited>true</inherited>
                 <configuration>
-                    <source>1.3</source>
+                    <source>1.4</source>
                     <target>1.5</target>
                 </configuration>
             </plugin>
             <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>animal-sniffer-maven-plugin</artifactId>
+                <!-- Note: 1.9 contains a call to a Java 7 specific method (java.nio.CharBuffer.subSequence(II)Ljava/nio/CharBuffer;)
+                           that is triggered when an undefined reference is found. This breaks error reporting on Java 6. -->
+                <version>1.8</version>
+                <executions>
+                    <execution>
+                        <phase>verify</phase>
+                        <goals>
+                            <goal>check</goal>
+                        </goals>
+                        <configuration>
+                            <signature>
+                                <groupId>org.codehaus.mojo.signature</groupId>
+                                <artifactId>java15</artifactId>
+                                <version>1.0</version>
+                            </signature>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+            <plugin>
                 <!-- This serves two purposes:
                       (1) we want to generate source JARs for all builds, not just release builds;
                       (2) we need (some of) the source JARs to generate the Javadoc in the apidocs module. -->
@@ -590,16 +617,20 @@
                 <version>${jacoco.version}</version>
                 <executions>
                     <execution>
+                        <id>prepare-agent-for-surefire</id>
                         <goals>
                             <goal>prepare-agent</goal>
                         </goals>
                         <configuration>
-                            <skip>${skipJacoco}</skip>
+                            <propertyName>jacoco.surefireArgLine</propertyName>
                             <!-- Anonymize the session ID (by default it contains the name of the host executing the build) -->
-                            <sessionId>mvn:${project.groupId}:${project.artifactId}:${project.version}</sessionId>
+                            <sessionId>mvn:${project.groupId}:${project.artifactId}:${project.version}:surefire</sessionId>
                         </configuration>
                     </execution>
                 </executions>
+                <configuration>
+                    <skip>${skipJacoco}</skip>
+                </configuration>
             </plugin>
             <plugin>
                 <groupId>org.codehaus.mojo</groupId>
@@ -712,10 +743,10 @@
         <module>modules/axiom-jaxb</module>
         <module>modules/axiom-c14n</module>
         <module>modules/axiom-tests</module>
-        <module>modules/axiom-osgi-tests</module>
         <module>modules/axiom-integration</module>
         <module>modules/axiom-all</module>
         <module>modules/axiom-samples</module>
+        <module>systests</module>
         <module>devguide</module>
         <module>userguide</module>
         <module>apidocs</module>

Propchange: webservices/axiom/branches/AXIOM-201/systests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jan 11 20:28:08 2013
@@ -0,0 +1 @@
+target

Propchange: webservices/axiom/branches/AXIOM-201/systests/jboss-tests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jan 11 20:28:08 2013
@@ -0,0 +1,4 @@
+.settings
+target
+.classpath
+.project

Propchange: webservices/axiom/branches/AXIOM-201/systests/osgi-tests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jan 11 20:28:08 2013
@@ -0,0 +1,4 @@
+.settings
+target
+.classpath
+.project

Propchange: webservices/axiom/branches/AXIOM-201/systests/spring-ws-tests/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Fri Jan 11 20:28:08 2013
@@ -0,0 +1,4 @@
+.settings
+target
+.classpath
+.project