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 2012/07/27 00:04:09 UTC

svn commit: r1366210 [3/3] - in /webservices/axiom/branches/AXIOM-201: ./ modules/axiom-api/src/main/java/org/apache/axiom/ext/stax/ modules/axiom-api/src/main/java/org/apache/axiom/om/ modules/axiom-api/src/main/java/org/apache/axiom/om/dom/ modules/a...

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=1366210&r1=1366209&r2=1366210&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 Thu Jul 26 22:04:05 2012
@@ -27,6 +27,7 @@ import org.apache.axiom.om.OMDataSourceE
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMFactory;
+import org.apache.axiom.om.OMInformationItem;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMOutputFormat;
@@ -650,8 +651,8 @@ public class OMSourcedElementImpl extend
         return super.cloneOMElement();
     }
 
-    public OMElement cloneOMElement(OMCloneOptions options) {
-        return super.cloneOMElement(options);
+    public OMInformationItem clone(OMCloneOptions options) {
+        return super.clone(options);
     }
 
     OMNode clone(OMCloneOptions options, OMContainer targetParent) {
@@ -1120,4 +1121,14 @@ public class OMSourcedElementImpl extend
             return ((OMDataSourceExt)dataSource).getObject();
         }
     }
+
+    public void removeChildren() {
+        // One might think that if the element is not expanded, we don't need to expand it because
+        // we are going to remove the children anyway. However, this is not true for two reasons:
+        //  * The element may have attributes and they must be available after removeChildren().
+        //  * The local name, namespace URI and/or prefix of the element may be unknown. In that
+        //    case, we need to expand the element to make this information available.
+        forceExpand();
+        super.removeChildren();
+    }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/main/java/org/apache/axiom/om/impl/llom/PushOMBuilder.java Thu Jul 26 22:04:05 2012
@@ -29,7 +29,6 @@ import org.apache.axiom.ext.stax.datahan
 import org.apache.axiom.om.OMAttribute;
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMElement;
-import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMText;
@@ -39,12 +38,12 @@ import org.apache.axiom.util.stax.Abstra
 
 public class PushOMBuilder extends AbstractXMLStreamWriter implements DataHandlerWriter {
     private final OMSourcedElementImpl root;
-    private final OMFactory factory;
+    private final OMFactoryEx factory;
     private OMElement parent;
     
     public PushOMBuilder(OMSourcedElementImpl root) throws XMLStreamException {
         this.root = root;
-        factory = root.getOMFactory();
+        factory = (OMFactoryEx)root.getOMFactory();
         // Seed the namespace context with the namespace context from the parent
         OMContainer parent = root.getParent();
         if (parent instanceof OMElement) {
@@ -113,7 +112,7 @@ public class PushOMBuilder extends Abstr
         } else {
             // We use the createOMElement variant that takes a OMXMLParserWrapper parameter and
             // don't pass the namespace. This avoids creation of a namespace declaration.
-            parent = ((OMFactoryEx)factory).createOMElement(localName, parent, null);
+            parent = factory.createOMElement(localName, parent, null);
         }
         if (ns != null) {
             parent.setNamespaceWithNoFindInCurrentScope(ns);
@@ -169,24 +168,23 @@ public class PushOMBuilder extends Abstr
     }
 
     protected void doWriteCharacters(String text) {
-        factory.createOMText(parent, text);
+        factory.createOMText(parent, text, OMNode.TEXT_NODE, true);
     }
 
     protected void doWriteCData(String data) {
-        factory.createOMText(parent, data, OMNode.CDATA_SECTION_NODE);
+        factory.createOMText(parent, data, OMNode.CDATA_SECTION_NODE, true);
     }
 
     protected void doWriteComment(String data) {
-        factory.createOMComment(parent, data);
+        factory.createOMComment(parent, data, true);
     }
 
     protected void doWriteEntityRef(String name) throws XMLStreamException {
-        // TODO: this is equivalent to what StAXOMBuilder does; however, it doesn't look correct
-        factory.createOMText(parent, name, OMNode.ENTITY_REFERENCE_NODE);
+        factory.createOMEntityReference(parent, name, null, true);
     }
 
     protected void doWriteProcessingInstruction(String target, String data) {
-        factory.createOMProcessingInstruction(parent, target, data);
+        factory.createOMProcessingInstruction(parent, target, data, true);
     }
 
     protected void doWriteProcessingInstruction(String target) {

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=1366210&r1=1366209&r2=1366210&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 Thu Jul 26 22:04:05 2012
@@ -27,6 +27,7 @@ import org.apache.axiom.om.OMDataSource;
 import org.apache.axiom.om.OMDocType;
 import org.apache.axiom.om.OMDocument;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMEntityReference;
 import org.apache.axiom.om.OMException;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMNamespace;
@@ -43,6 +44,7 @@ import org.apache.axiom.om.impl.llom.OMC
 import org.apache.axiom.om.impl.llom.OMDocTypeImpl;
 import org.apache.axiom.om.impl.llom.OMDocumentImpl;
 import org.apache.axiom.om.impl.llom.OMElementImpl;
+import org.apache.axiom.om.impl.llom.OMEntityReferenceImpl;
 import org.apache.axiom.om.impl.llom.OMProcessingInstructionImpl;
 import org.apache.axiom.om.impl.llom.OMSourcedElementImpl;
 import org.apache.axiom.om.impl.llom.OMTextImpl;
@@ -294,19 +296,14 @@ public class OMLinkedListImplFactory imp
         return new OMAttributeImpl(localName, ns, value, this);
     }
 
-    /**
-     * Creates DocType/DTD.
-     *
-     * @param parent
-     * @param content
-     * @return Returns doctype.
-     */
-    public OMDocType createOMDocType(OMContainer parent, String content) {
-        return createOMDocType(parent, content, false);
+    public OMDocType createOMDocType(OMContainer parent, String rootName, String publicId,
+            String systemId, String internalSubset) {
+        return createOMDocType(parent, rootName, publicId, systemId, internalSubset, false);
     }
 
-    public OMDocType createOMDocType(OMContainer parent, String content, boolean fromBuilder) {
-        return new OMDocTypeImpl(parent, content, this, fromBuilder);
+    public OMDocType createOMDocType(OMContainer parent, String rootName, String publicId,
+            String systemId, String internalSubset, boolean fromBuilder) {
+        return new OMDocTypeImpl(parent, rootName, publicId, systemId, internalSubset, this, fromBuilder);
     }
 
     /**
@@ -356,6 +353,10 @@ public class OMLinkedListImplFactory imp
         return new OMDocumentImpl(builder, this);
     }
 
+    public OMEntityReference createOMEntityReference(OMContainer parent, String name, String replacementText, boolean fromBuilder) {
+        return new OMEntityReferenceImpl(parent, name, replacementText, this, fromBuilder);
+    }
+
     /**
      * This method is intended only to be used by Axiom intenals when merging Objects from different
      * Axiom implementations to the LLOM implementation.
@@ -401,7 +402,9 @@ public class OMLinkedListImplFactory imp
             }
             case (OMNode.DTD_NODE) : {
                 OMDocType importedDocType = (OMDocType) child;
-                return createOMDocType(null, importedDocType.getValue());
+                return createOMDocType(null, importedDocType.getRootName(),
+                        importedDocType.getPublicId(), importedDocType.getSystemId(),
+                        importedDocType.getInternalSubset());
             }
             default: {
                 throw new UnsupportedOperationException(

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=1366210&r1=1366209&r2=1366210&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 Thu Jul 26 22:04:05 2012
@@ -335,6 +335,10 @@ public class SOAPEnvelopeImpl extends SO
     }
 
     protected OMElement createClone(OMCloneOptions options, OMContainer targetParent) {
-        return ((SOAPFactory)factory).createSOAPEnvelope(getNamespace());
+        SOAPEnvelope clone = ((SOAPFactory)factory).createSOAPEnvelope(getNamespace());
+        if (targetParent != null) {
+            targetParent.addChild(clone);
+        }
+        return clone;
     }
 }

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=1366210&r1=1366209&r2=1366210&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 Thu Jul 26 22:04:05 2012
@@ -19,6 +19,8 @@
 
 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.OMXMLParserWrapper;
 import org.apache.axiom.om.impl.OMNodeEx;
@@ -60,4 +62,10 @@ public class SOAPMessageImpl extends OMD
                                      boolean includeXMLDeclaration) throws XMLStreamException {
         ((OMNodeEx)getOMDocumentElement()).internalSerialize(writer, cache);
     }
+
+    protected OMDocument createClone(OMCloneOptions options) {
+        // Note: we need to use getOMFactory here (instead of the factory attribute)
+        // directly because the factory for a SOAPMessage may be determined lazily.
+        return new SOAPMessageImpl((SOAPFactory)getOMFactory());
+    }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-impl/src/test/java/org/apache/axiom/om/impl/llom/OMImplementationTest.java Thu Jul 26 22:04:05 2012
@@ -25,6 +25,7 @@ import org.apache.axiom.om.impl.llom.fac
 import org.apache.axiom.ts.om.OMTestSuiteBuilder;
 import org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource;
 import org.apache.axiom.ts.om.container.TestSerialize;
+import org.apache.axiom.ts.om.document.TestClone;
 import org.apache.axiom.ts.om.document.TestDigest;
 import org.apache.axiom.ts.om.element.TestGetXMLStreamReaderWithOMSourcedElementDescendant;
 import org.apache.axiom.ts.om.node.TestInsertSiblingAfterOnChild;
@@ -43,15 +44,8 @@ public class OMImplementationTest extend
         // TODO: this case is not working because Axiom generates an XML declaration
         //       but uses another charset encoding to serialize the document
         builder.exclude(TestSerialize.class, "(&(file=iso-8859-1.xml)(container=document))");
-        
-        // TODO: this case is not working because Axiom doesn't serialize the DTD
-        builder.exclude(TestSerialize.class, "(&(file=spaces.xml)(container=document))");
-        
-        // TODO: CDATA sections are lost when using createOMBuilder with a DOMSource
-        builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(|(file=cdata.xml)(file=test.xml))");
-        
-        // TODO: suspecting Woodstox bug here
-        builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(file=spaces.xml)");
+        builder.exclude(TestCreateOMBuilderFromDOMSource.class, "(file=iso-8859-1.xml)");
+        builder.exclude(TestClone.class, "(file=iso-8859-1.xml)");
         
         // TODO: if there is a comment node surrounded by text, then these text nodes need to be merged
         builder.exclude(TestDigest.class, "(|(file=digest3.xml)(file=digest4.xml))");

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-integration/src/test/java/org/apache/axiom/om/impl/builder/SAXOMBuilderSAXParserTest.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-integration/src/test/java/org/apache/axiom/om/impl/builder/SAXOMBuilderSAXParserTest.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-integration/src/test/java/org/apache/axiom/om/impl/builder/SAXOMBuilderSAXParserTest.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-integration/src/test/java/org/apache/axiom/om/impl/builder/SAXOMBuilderSAXParserTest.java Thu Jul 26 22:04:05 2012
@@ -28,16 +28,17 @@ import javax.xml.parsers.SAXParserFactor
 import junit.framework.TestSuite;
 
 import org.apache.axiom.om.AbstractTestCase;
-import org.apache.axiom.testutils.conformance.Conformance;
+import org.apache.axiom.testutils.XMLAssertEx;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 import org.custommonkey.xmlunit.XMLUnit;
 import org.xml.sax.InputSource;
 import org.xml.sax.XMLReader;
 
 public class SAXOMBuilderSAXParserTest extends AbstractTestCase {
     private final SAXParserFactory factory;
-    private final String file;
+    private final ConformanceTestFile file;
     
-    public SAXOMBuilderSAXParserTest(String name, SAXParserFactory factory, String file) {
+    public SAXOMBuilderSAXParserTest(String name, SAXParserFactory factory, ConformanceTestFile file) {
         super(name);
         this.factory = factory;
         this.file = file;
@@ -49,30 +50,21 @@ public class SAXOMBuilderSAXParserTest e
         XMLReader reader = factory.newSAXParser().getXMLReader();
         SAXOMBuilder builder = new SAXOMBuilder();
         reader.setContentHandler(builder);
+        reader.setDTDHandler(builder);
         reader.setProperty("http://xml.org/sax/properties/lexical-handler", builder);
-        InputStream in = getTestResource(file);
-        try {
-            reader.parse(new InputSource(in));
-        } finally {
-            in.close();
-        }
-        in = getTestResource(file);
-        try {
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            builder.getDocument().serialize(baos);
-            XMLUnit.setIgnoreAttributeOrder(true);
-            assertXMLIdentical(compareXML(
-                    toDocumentWithoutDTD(in),
-                    toDocumentWithoutDTD(new ByteArrayInputStream(baos.toByteArray()))), true);
-        } finally {
-            in.close();
-        }
+        reader.setProperty("http://xml.org/sax/properties/declaration-handler", builder);
+        reader.parse(new InputSource(file.getUrl().toString()));
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        builder.getDocument().serialize(baos);
+        XMLUnit.setIgnoreAttributeOrder(true);
+        XMLAssertEx.assertXMLIdentical(file.getUrl(),
+                new ByteArrayInputStream(baos.toByteArray()), true);
     }
     
     private static void addTests(TestSuite suite, SAXParserFactory factory, String name) throws Exception {
-        for (String file : Conformance.getConformanceTestFiles()) {
+        for (ConformanceTestFile file : ConformanceTestFile.getConformanceTestFiles()) {
             suite.addTest(new SAXOMBuilderSAXParserTest(
-                    file.substring(file.lastIndexOf('/')+1) + " - " + name, factory, file));
+                    file.getShortName() + " - " + name, factory, file));
         }
     }
     

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-parent/pom.xml Thu Jul 26 22:04:05 2012
@@ -465,6 +465,11 @@
                 <artifactId>xalan</artifactId>
                 <version>2.7.1</version>
             </dependency>
+            <dependency>
+                <groupId>xerces</groupId>
+                <artifactId>xercesImpl</artifactId>
+                <version>2.9.1</version>
+            </dependency>
         </dependencies>
     </dependencyManagement>
     <distributionManagement>

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/AxiomTestCase.java Thu Jul 26 22:04:05 2012
@@ -20,12 +20,28 @@ package org.apache.axiom.ts;
 
 import java.util.Iterator;
 
+import javax.xml.stream.XMLInputFactory;
+
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.om.util.StAXParserConfiguration;
 import org.apache.axiom.testutils.suite.TestCaseEx;
+import org.apache.axiom.util.stax.dialect.StAXDialect;
 import org.apache.commons.io.output.NullOutputStream;
 
 public abstract class AxiomTestCase extends TestCaseEx {
+    protected static final StAXParserConfiguration TEST_PARSER_CONFIGURATION = new StAXParserConfiguration() {
+        public XMLInputFactory configure(XMLInputFactory factory, StAXDialect dialect) {
+            // For the tests, preserve as much of the syntactic structure of the test documents
+            factory.setProperty(XMLInputFactory.IS_REPLACING_ENTITY_REFERENCES, Boolean.FALSE);
+            return dialect.enableCDataReporting(factory);
+        }
+        
+        public String toString() {
+            return "TEST";
+        }
+    };
+    
     protected final OMMetaFactory metaFactory;
 
     public AxiomTestCase(OMMetaFactory metaFactory) {

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/ConformanceTestCase.java Thu Jul 26 22:04:05 2012
@@ -18,10 +18,8 @@
  */
 package org.apache.axiom.ts;
 
-import java.io.InputStream;
-
-import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.om.OMMetaFactory;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 
 /**
  * Base class for test cases that are executed against the files from the conformance test set.
@@ -29,16 +27,11 @@ import org.apache.axiom.om.OMMetaFactory
  * @see org.apache.axiom.om.AbstractTestCase#getConformanceTestFiles()
  */
 public abstract class ConformanceTestCase extends AxiomTestCase {
-    private final String file;
+    protected final ConformanceTestFile file;
 
-    public ConformanceTestCase(OMMetaFactory metaFactory, String file) {
+    public ConformanceTestCase(OMMetaFactory metaFactory, ConformanceTestFile file) {
         super(metaFactory);
         this.file = file;
-        int idx = file.lastIndexOf('/');
-        addTestProperty("file", file.substring(idx+1));
-    }
-
-    protected InputStream getFileAsStream() {
-        return AbstractTestCase.getTestResource(file);
+        addTestProperty("file", file.getShortName());
     }
 }

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=1366210&r1=1366209&r2=1366210&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 Thu Jul 26 22:04:05 2012
@@ -23,7 +23,7 @@ import java.lang.reflect.Method;
 import javax.xml.namespace.QName;
 
 import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.testutils.conformance.Conformance;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 import org.apache.axiom.testutils.suite.TestSuiteBuilder;
 import org.apache.axiom.ts.om.container.OMContainerFactory;
 import org.apache.axiom.ts.om.container.OMElementFactory;
@@ -59,7 +59,7 @@ public class OMTestSuiteBuilder extends 
     }
     
     protected void addTests() {
-        String[] conformanceFiles = Conformance.getConformanceTestFiles();
+        ConformanceTestFile[] conformanceFiles = ConformanceTestFile.getConformanceTestFiles();
         addTest(new org.apache.axiom.ts.om.attribute.TestDigestWithNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestDigestWithoutNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.attribute.TestEqualsHashCode(metaFactory));
@@ -75,8 +75,16 @@ public class OMTestSuiteBuilder extends 
         addTest(new org.apache.axiom.ts.om.builder.TestCloseWithReader(metaFactory));
         addTest(new org.apache.axiom.ts.om.builder.TestCloseWithXMLStreamReader(metaFactory));
         for (int i=0; i<conformanceFiles.length; i++) {
-            addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource(metaFactory, conformanceFiles[i]));
-            addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromSAXSource(metaFactory, conformanceFiles[i]));
+            ConformanceTestFile file = conformanceFiles[i];
+            if (file.hasEntityReferences()) {
+                addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource(metaFactory, file, Boolean.TRUE));
+                addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource(metaFactory, file, Boolean.FALSE));
+                addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromSAXSource(metaFactory, file, Boolean.TRUE));
+                addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromSAXSource(metaFactory, file, Boolean.FALSE));
+            } else {
+                addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromDOMSource(metaFactory, file, null));
+                addTest(new org.apache.axiom.ts.om.builder.TestCreateOMBuilderFromSAXSource(metaFactory, file, null));
+            }
         }
         addTest(new org.apache.axiom.ts.om.builder.TestCreateStAXOMBuilderFromFragment(metaFactory));
         addTest(new org.apache.axiom.ts.om.builder.TestCreateStAXOMBuilderIncorrectState(metaFactory));
@@ -92,17 +100,30 @@ public class OMTestSuiteBuilder extends 
         addTest(new org.apache.axiom.ts.om.builder.TestRootPartStreaming(metaFactory));
         addTest(new org.apache.axiom.ts.om.builder.TestStandaloneConfiguration(metaFactory));
         for (int i=0; i<conformanceFiles.length; i++) {
+            ConformanceTestFile file = conformanceFiles[i];
             for (int j=0; j<containerFactories.length; j++) {
-                addTest(new org.apache.axiom.ts.om.container.TestGetSAXSource(metaFactory, conformanceFiles[i], containerFactories[j], true));
-                addTest(new org.apache.axiom.ts.om.container.TestGetSAXSource(metaFactory, conformanceFiles[i], containerFactories[j], false));
-                addTest(new org.apache.axiom.ts.om.container.TestGetXMLStreamReader(metaFactory, conformanceFiles[i], containerFactories[j], true));
-                addTest(new org.apache.axiom.ts.om.container.TestGetXMLStreamReader(metaFactory, conformanceFiles[i], containerFactories[j], false));
-                for (int k=0; k<serializationMethods.length; k++) {
-                    addTest(new org.apache.axiom.ts.om.container.TestSerialize(metaFactory, conformanceFiles[i], containerFactories[j], serializationMethods[k]));
+                OMContainerFactory cf = containerFactories[j];
+                addTest(new org.apache.axiom.ts.om.container.TestGetXMLStreamReader(metaFactory, file, cf, true));
+                addTest(new org.apache.axiom.ts.om.container.TestGetXMLStreamReader(metaFactory, file, cf, false));
+                // On a document containing entity references, serialization tests will only work correctly if
+                // the entire document is serialized (so that the DTD is available)
+                if (!file.hasEntityReferences() || cf == OMContainerFactory.DOCUMENT) {
+                    for (int k=0; k<serializationMethods.length; k++) {
+                        addTest(new org.apache.axiom.ts.om.container.TestSerialize(metaFactory, file, containerFactories[j], serializationMethods[k]));
+                    }
+                    // The SAXSource returned by getSAXSource is not able to reconstruct the internal subset.
+                    // Skip test documents that have a DTD with an internal subset.
+                    if (!file.hasInternalSubset()) {
+                        addTest(new org.apache.axiom.ts.om.container.TestGetSAXSource(metaFactory, file, cf, true));
+                        addTest(new org.apache.axiom.ts.om.container.TestGetSAXSource(metaFactory, file, cf, false));
+                    }
                 }
             }
         }
         addTest(new org.apache.axiom.ts.om.document.TestAddChildIncomplete(metaFactory));
+        for (int i=0; i<conformanceFiles.length; i++) {
+            addTest(new org.apache.axiom.ts.om.document.TestClone(metaFactory, conformanceFiles[i]));
+        }
         addTest(new org.apache.axiom.ts.om.document.TestDigest(metaFactory, "digest1.xml", "MD5", "3e5d68c6607bc56c9c171560e4f19db9"));
         addTest(new org.apache.axiom.ts.om.document.TestDigest(metaFactory, "digest2.xml", "SHA1", "3c47a807517d867d42ffacb2d3e9da81895d5aac"));
         addTest(new org.apache.axiom.ts.om.document.TestDigest(metaFactory, "digest3.xml", "SHA", "41466144c1cab4234fb127cfb8cf92f9"));
@@ -111,6 +132,10 @@ public class OMTestSuiteBuilder extends 
         addTest(new org.apache.axiom.ts.om.document.TestGetOMDocumentElementAfterDetach(metaFactory));
         addTest(new org.apache.axiom.ts.om.document.TestGetOMDocumentElementWithParser(metaFactory));
         addTest(new org.apache.axiom.ts.om.document.TestIsCompleteAfterAddingIncompleteChild(metaFactory));
+        addTest(new org.apache.axiom.ts.om.document.TestRemoveChildren(metaFactory, true, false));
+        addTest(new org.apache.axiom.ts.om.document.TestRemoveChildren(metaFactory, true, true));
+        addTest(new org.apache.axiom.ts.om.document.TestRemoveChildren(metaFactory, false, false));
+        addTest(new org.apache.axiom.ts.om.document.TestRemoveChildren(metaFactory, false, true));
         addTest(new org.apache.axiom.ts.om.document.TestSerializeAndConsume(metaFactory));
         addTest(new org.apache.axiom.ts.om.document.TestSerializeAndConsumeWithIncompleteDescendant(metaFactory));
         addTest(new org.apache.axiom.ts.om.document.TestSetOMDocumentElementNew(metaFactory));
@@ -138,7 +163,10 @@ public class OMTestSuiteBuilder extends 
         addTest(new org.apache.axiom.ts.om.element.TestChildReDeclaringParentsDefaultNSWithPrefix(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestCloneOMElement(metaFactory));
         for (int i=0; i<conformanceFiles.length; i++) {
-            addTest(new org.apache.axiom.ts.om.element.TestCloneOMElement2(metaFactory, conformanceFiles[i]));
+            ConformanceTestFile file = conformanceFiles[i];
+            if (!file.hasEntityReferences()) {
+                addTest(new org.apache.axiom.ts.om.element.TestCloneOMElement2(metaFactory, file));
+            }
         }
         addTest(new org.apache.axiom.ts.om.element.TestCloneOMElementNamespaceRepairing(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestDeclareDefaultNamespace1(metaFactory));
@@ -236,6 +264,8 @@ public class OMTestSuiteBuilder extends 
         addTest(new org.apache.axiom.ts.om.element.TestMultipleDefaultNS(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestRemoveAttribute(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestRemoveAttributeNotOwner(metaFactory));
+        addTest(new org.apache.axiom.ts.om.element.TestRemoveChildren(metaFactory, true));
+        addTest(new org.apache.axiom.ts.om.element.TestRemoveChildren(metaFactory, false));
         addTest(new org.apache.axiom.ts.om.element.TestResolveQNameWithDefaultNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestResolveQNameWithNonDefaultNamespace(metaFactory));
         addTest(new org.apache.axiom.ts.om.element.TestResolveQNameWithoutNamespace(metaFactory));
@@ -359,9 +389,9 @@ public class OMTestSuiteBuilder extends 
             }
             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.TestCloneOMElementNonDestructive(metaFactory, true));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloneOMElementNonDestructive(metaFactory, false));
-            addTest(new org.apache.axiom.ts.om.sourcedelement.TestCloneOMElementUnknownName(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.TestComplete(metaFactory));
             addTest(new org.apache.axiom.ts.om.sourcedelement.TestExpand(metaFactory));
             addTest(new org.apache.axiom.ts.om.sourcedelement.TestGetDocumentFromBuilder(metaFactory));
@@ -386,6 +416,7 @@ public class OMTestSuiteBuilder extends 
             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));
+            addTest(new org.apache.axiom.ts.om.sourcedelement.TestRemoveChildrenUnexpanded(metaFactory));
             addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeAndConsumeToStream(metaFactory));
             addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeAndConsumeToWriter(metaFactory));
             addTest(new org.apache.axiom.ts.om.sourcedelement.TestSerializeAndConsumeToXMLWriter(metaFactory));

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromDOMSource.java Thu Jul 26 22:04:05 2012
@@ -20,40 +20,50 @@ package org.apache.axiom.ts.om.builder;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
 import javax.xml.transform.dom.DOMSource;
 
-import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.testutils.XMLAssertEx;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 import org.apache.axiom.ts.ConformanceTestCase;
-import org.custommonkey.xmlunit.XMLAssert;
-import org.custommonkey.xmlunit.XMLUnit;
 
 public class TestCreateOMBuilderFromDOMSource extends ConformanceTestCase {
-    public TestCreateOMBuilderFromDOMSource(OMMetaFactory metaFactory, String file) {
+    private final Boolean expandEntityReferences;
+    
+    public TestCreateOMBuilderFromDOMSource(OMMetaFactory metaFactory, ConformanceTestFile file,
+            Boolean expandEntityReferences) {
         super(metaFactory, file);
+        this.expandEntityReferences = expandEntityReferences;
+        if (expandEntityReferences != null) {
+            addTestProperty("expandEntityReferences", expandEntityReferences.toString());
+        }
     }
 
     protected void runTest() throws Throwable {
         DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
         factory.setNamespaceAware(true);
+        // We never expand entity references during parsing, but we may do this later when
+        // converting DOM to OM.
+        factory.setExpandEntityReferences(false);
         DocumentBuilder documentBuilder = factory.newDocumentBuilder();
-        InputStream in = getFileAsStream();
-        try {
-            DOMSource source = new DOMSource(documentBuilder.parse(in));
-            OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), source);
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            builder.getDocument().serialize(baos);
-            XMLAssert.assertXMLIdentical(XMLUnit.compareXML(
-                    AbstractTestCase.toDocumentWithoutDTD(getFileAsStream()),
-                    AbstractTestCase.toDocumentWithoutDTD(new ByteArrayInputStream(baos.toByteArray()))), true);
-        } finally {
-            in.close();
+        DOMSource source = new DOMSource(documentBuilder.parse(file.getUrl().toString()));
+        OMXMLParserWrapper builder;
+        if (expandEntityReferences == null) {
+            builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), source);
+        } else {
+            builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), source,
+                    expandEntityReferences.booleanValue());
         }
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        builder.getDocument().serialize(baos);
+        XMLAssertEx.assertXMLIdentical(
+                file.getUrl(),
+                new ByteArrayInputStream(baos.toByteArray()),
+                expandEntityReferences == null ? false : expandEntityReferences.booleanValue());
     }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/builder/TestCreateOMBuilderFromSAXSource.java Thu Jul 26 22:04:05 2012
@@ -20,24 +20,31 @@ package org.apache.axiom.ts.om.builder;
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
 
 import javax.xml.parsers.SAXParser;
 import javax.xml.parsers.SAXParserFactory;
 import javax.xml.transform.sax.SAXSource;
 
-import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.testutils.XMLAssertEx;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 import org.apache.axiom.ts.ConformanceTestCase;
 import org.custommonkey.xmlunit.XMLAssert;
 import org.custommonkey.xmlunit.XMLUnit;
 import org.xml.sax.InputSource;
 
 public class TestCreateOMBuilderFromSAXSource extends ConformanceTestCase {
-    public TestCreateOMBuilderFromSAXSource(OMMetaFactory metaFactory, String file) {
+    private final Boolean expandEntityReferences;
+    
+    public TestCreateOMBuilderFromSAXSource(OMMetaFactory metaFactory, ConformanceTestFile file,
+            Boolean expandEntityReferences) {
         super(metaFactory, file);
+        this.expandEntityReferences = expandEntityReferences;
+        if (expandEntityReferences != null) {
+            addTestProperty("expandEntityReferences", expandEntityReferences.toString());
+        }
     }
 
     protected void runTest() throws Throwable {
@@ -45,17 +52,19 @@ public class TestCreateOMBuilderFromSAXS
         factory.setNamespaceAware(true);
         factory.setFeature("http://xml.org/sax/features/namespace-prefixes", true);
         SAXParser parser = factory.newSAXParser();
-        InputStream in = getFileAsStream();
-        try {
-            SAXSource source = new SAXSource(parser.getXMLReader(), new InputSource(in));
-            OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), source);
-            ByteArrayOutputStream baos = new ByteArrayOutputStream();
-            builder.getDocument().serialize(baos);
-            XMLAssert.assertXMLIdentical(XMLUnit.compareXML(
-                    AbstractTestCase.toDocumentWithoutDTD(getFileAsStream()),
-                    AbstractTestCase.toDocumentWithoutDTD(new ByteArrayInputStream(baos.toByteArray()))), true);
-        } finally {
-            in.close();
+        SAXSource source = new SAXSource(parser.getXMLReader(), new InputSource(file.getUrl().toString()));
+        OMXMLParserWrapper builder;
+        if (expandEntityReferences == null) {
+            builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), source);
+        } else {
+            builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), source,
+                    expandEntityReferences.booleanValue());
         }
+        ByteArrayOutputStream baos = new ByteArrayOutputStream();
+        builder.getDocument().serialize(baos);
+        XMLAssertEx.assertXMLIdentical(
+                file.getUrl(),
+                new ByteArrayInputStream(baos.toByteArray()),
+                expandEntityReferences == null ? false : expandEntityReferences.booleanValue());
     }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetSAXSource.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetSAXSource.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetSAXSource.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetSAXSource.java Thu Jul 26 22:04:05 2012
@@ -20,26 +20,24 @@ package org.apache.axiom.ts.om.container
 
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
+import java.net.URL;
 
+import javax.xml.transform.OutputKeys;
 import javax.xml.transform.sax.SAXSource;
-import javax.xml.transform.stream.StreamResult;
 
-import org.apache.axiom.om.AbstractTestCase;
 import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.util.StAXParserConfiguration;
+import org.apache.axiom.testutils.XMLAssertEx;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 import org.apache.axiom.ts.ConformanceTestCase;
-import org.apache.xalan.processor.TransformerFactoryImpl;
-import org.custommonkey.xmlunit.XMLAssert;
-import org.custommonkey.xmlunit.XMLUnit;
+import org.xml.sax.XMLReader;
+import org.xml.sax.InputSource;
 
 public class TestGetSAXSource extends ConformanceTestCase {
     private final OMContainerFactory containerFactory;
     private final boolean cache;
     
-    public TestGetSAXSource(OMMetaFactory metaFactory, String file, OMContainerFactory containerFactory, boolean cache) {
+    public TestGetSAXSource(OMMetaFactory metaFactory, ConformanceTestFile file, OMContainerFactory containerFactory, boolean cache) {
         super(metaFactory, file);
         this.containerFactory = containerFactory;
         this.cache = cache;
@@ -48,19 +46,25 @@ public class TestGetSAXSource extends Co
     }
 
     protected void runTest() throws Throwable {
+        OMXMLParserWrapper builder = metaFactory.createOMBuilder(metaFactory.getOMFactory(),
+                TEST_PARSER_CONFIGURATION, new InputSource(file.getUrl().toString()));
+        SAXSource source = containerFactory.getContainer(builder).getSAXSource(cache);
+        XMLReader xmlReader = source.getXMLReader();
         ByteArrayOutputStream out = new ByteArrayOutputStream();
-        InputStream in = getFileAsStream();
-        try {
-            OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(),
-                    StAXParserConfiguration.PRESERVE_CDATA_SECTIONS, in);
-            SAXSource source = containerFactory.getContainer(builder).getSAXSource(cache);
-            StreamResult result = new StreamResult(out);
-            new TransformerFactoryImpl().newTransformer().transform(source, result);
-        } finally {
-            in.close();
-        }
-        XMLAssert.assertXMLIdentical(XMLUnit.compareXML(
-                AbstractTestCase.toDocumentWithoutDTD(getFileAsStream()),
-                AbstractTestCase.toDocumentWithoutDTD(new ByteArrayInputStream(out.toByteArray()))), true);
+        SAXSerializer serializer = new SAXSerializer();
+        // A SAXSource has no way to tell its consumer about the encoding of the document.
+        // Just set it to UTF-8 to have a well defined encoding.
+        serializer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
+        serializer.setOutputStream(out);
+        xmlReader.setContentHandler(serializer);
+        xmlReader.setProperty("http://xml.org/sax/properties/lexical-handler", serializer);
+        xmlReader.parse(source.getInputSource());
+        InputSource control = containerFactory.getControl(file.getAsStream());
+        InputSource test = new InputSource(new ByteArrayInputStream(out.toByteArray()));
+        // Configure the InputSources such that external entities can be resolved
+        String systemId = new URL(file.getUrl(), "dummy.xml").toString();
+        control.setSystemId(systemId);
+        test.setSystemId(systemId);
+        XMLAssertEx.assertXMLIdentical(control, test, false);
     }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestGetXMLStreamReader.java Thu Jul 26 22:04:05 2012
@@ -24,11 +24,12 @@ import javax.xml.stream.XMLStreamReader;
 
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
 import org.apache.axiom.om.util.StAXUtils;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 import org.apache.axiom.testutils.stax.XMLStreamReaderComparator;
 import org.apache.axiom.ts.ConformanceTestCase;
+import org.xml.sax.InputSource;
 
 /**
  * Test comparing the output of {@link OMContainer#getXMLStreamReader(boolean)} with that of a
@@ -38,7 +39,7 @@ public class TestGetXMLStreamReader exte
     private final OMContainerFactory containerFactory;
     private final boolean cache;
     
-    public TestGetXMLStreamReader(OMMetaFactory metaFactory, String file, OMContainerFactory containerFactory, boolean cache) {
+    public TestGetXMLStreamReader(OMMetaFactory metaFactory, ConformanceTestFile file, OMContainerFactory containerFactory, boolean cache) {
         super(metaFactory, file);
         this.containerFactory = containerFactory;
         this.cache = cache;
@@ -47,12 +48,12 @@ public class TestGetXMLStreamReader exte
     }
     
     protected final void runTest() throws Throwable {
-        InputStream in1 = getFileAsStream();
-        InputStream in2 = getFileAsStream();
+        InputStream in = file.getAsStream();
         try {
-            XMLStreamReader expected = StAXUtils.createXMLStreamReader(in1);
+            XMLStreamReader expected = StAXUtils.createXMLStreamReader(TEST_PARSER_CONFIGURATION, file.getUrl().toString(), in);
             try {
-                OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(), in2);
+                OMXMLParserWrapper builder = metaFactory.createOMBuilder(metaFactory.getOMFactory(),
+                        TEST_PARSER_CONFIGURATION, new InputSource(file.getUrl().toString()));
                 try {
                     XMLStreamReader actual = containerFactory.getContainer(builder).getXMLStreamReader(cache);
                     new XMLStreamReaderComparator(containerFactory.filter(expected), containerFactory.filter(actual)).compare();
@@ -63,8 +64,7 @@ public class TestGetXMLStreamReader exte
                 expected.close();
             }
         } finally {
-            in1.close();
-            in2.close();
+            in.close();
         }
     }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/container/TestSerialize.java Thu Jul 26 22:04:05 2012
@@ -21,15 +21,12 @@ package org.apache.axiom.ts.om.container
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
-import java.io.InputStream;
-
-import junit.framework.AssertionFailedError;
+import java.net.URL;
 
 import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.OMMetaFactory;
-import org.apache.axiom.om.OMXMLBuilderFactory;
 import org.apache.axiom.om.OMXMLParserWrapper;
-import org.apache.axiom.om.util.StAXParserConfiguration;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 import org.apache.axiom.ts.ConformanceTestCase;
 import org.apache.commons.io.IOUtils;
 import org.custommonkey.xmlunit.XMLAssert;
@@ -40,7 +37,7 @@ public class TestSerialize extends Confo
     private final OMContainerFactory containerFactory;
     private final SerializationMethod serializationMethod;
     
-    public TestSerialize(OMMetaFactory metaFactory, String file,
+    public TestSerialize(OMMetaFactory metaFactory, ConformanceTestFile file,
             OMContainerFactory containerFactory, SerializationMethod serializationMethod) {
         super(metaFactory, file);
         this.containerFactory = containerFactory;
@@ -50,37 +47,36 @@ public class TestSerialize extends Confo
     }
 
     protected void runTest() throws Throwable {
-        InputStream in = getFileAsStream();
+        OMXMLParserWrapper builder = metaFactory.createOMBuilder(metaFactory.getOMFactory(),
+                TEST_PARSER_CONFIGURATION, new InputSource(file.getUrl().toString()));
         try {
-            OMXMLParserWrapper builder = OMXMLBuilderFactory.createOMBuilder(metaFactory.getOMFactory(),
-                    StAXParserConfiguration.PRESERVE_CDATA_SECTIONS, in);
+            OMContainer container = containerFactory.getContainer(builder);
+            // We need to clone the InputSource objects so that we can dump their contents
+            // if the test fails
+            InputSource control[] = duplicateInputSource(containerFactory.getControl(file.getAsStream()));
+            InputSource actual[] = duplicateInputSource(serializationMethod.serialize(container));
             try {
-                OMContainer container = containerFactory.getContainer(builder);
-                // We need to clone the InputSource objects so that we can dump their contents
-                // if the test fails
-                InputSource control[] = duplicateInputSource(containerFactory.getControl(getFileAsStream()));
-                InputSource actual[] = duplicateInputSource(serializationMethod.serialize(container));
-                try {
-                    XMLAssert.assertXMLIdentical(XMLUnit.compareXML(control[0], actual[0]), true);
-                } catch (AssertionFailedError ex) {
-                    System.out.println("Control:");
-                    dumpInputSource(control[1]);
-                    System.out.println("Actual:");
-                    dumpInputSource(actual[1]);
-                    throw ex;
-                }
-                if (serializationMethod.isCaching()) {
-                    assertTrue(container.isComplete());
-                } else {
-                    // TODO: need to investigate why assertConsumed is not working here
-                    assertFalse(container.isComplete());
-//                    assertConsumed(element);
-                }
-            } finally {
-                builder.close();
+                // Configure the InputSources such that external entities can be resolved
+                String systemId = new URL(file.getUrl(), "dummy.xml").toString();
+                control[0].setSystemId(systemId);
+                actual[0].setSystemId(systemId);
+                XMLAssert.assertXMLIdentical(XMLUnit.compareXML(control[0], actual[0]), true);
+            } catch (Throwable ex) {
+                System.out.println("Control:");
+                dumpInputSource(control[1]);
+                System.out.println("Actual:");
+                dumpInputSource(actual[1]);
+                throw ex;
+            }
+            if (serializationMethod.isCaching()) {
+                assertTrue(container.isComplete());
+            } else {
+                // TODO: need to investigate why assertConsumed is not working here
+                assertFalse(container.isComplete());
+//                assertConsumed(element);
             }
         } finally {
-            in.close();
+            builder.close();
         }
     }
 

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/element/TestCloneOMElement2.java Thu Jul 26 22:04:05 2012
@@ -24,18 +24,19 @@ import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMFactory;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMXMLBuilderFactory;
+import org.apache.axiom.testutils.conformance.ConformanceTestFile;
 import org.apache.axiom.ts.ConformanceTestCase;
 import org.custommonkey.xmlunit.XMLAssert;
 import org.custommonkey.xmlunit.XMLUnit;
 
 public class TestCloneOMElement2 extends ConformanceTestCase {
-    public TestCloneOMElement2(OMMetaFactory metaFactory, String file) {
+    public TestCloneOMElement2(OMMetaFactory metaFactory, ConformanceTestFile file) {
         super(metaFactory, file);
     }
 
     protected void runTest() throws Throwable {
         OMFactory factory = metaFactory.getOMFactory();
-        InputStream in = getFileAsStream();
+        InputStream in = file.getAsStream();
         try {
             OMElement original = OMXMLBuilderFactory.createOMBuilder(factory, in).getDocumentElement();
             OMElement clone = original.cloneOMElement();

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocTypeWithoutParent.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocTypeWithoutParent.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocTypeWithoutParent.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/om/factory/TestCreateOMDocTypeWithoutParent.java Thu Jul 26 22:04:05 2012
@@ -28,8 +28,11 @@ public class TestCreateOMDocTypeWithoutP
     }
 
     protected void runTest() throws Throwable {
-        OMDocType dtd = metaFactory.getOMFactory().createOMDocType(null, "content");
+        OMDocType dtd = metaFactory.getOMFactory().createOMDocType(null, "root", "publicId", "systemId", "internalSubset");
         assertNull(dtd.getParent());
-        assertEquals("content", dtd.getValue());
+        assertEquals("root", dtd.getRootName());
+        assertEquals("publicId", dtd.getPublicId());
+        assertEquals("systemId", dtd.getSystemId());
+        assertEquals("internalSubset", dtd.getInternalSubset());
     }
 }

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/omdom/OMDOMTestSuiteBuilder.java Thu Jul 26 22:04:05 2012
@@ -49,6 +49,7 @@ public class OMDOMTestSuiteBuilder exten
         addTest(new org.apache.axiom.ts.omdom.element.TestInsertBeforeIncomplete(metaFactory));
         addTest(new org.apache.axiom.ts.omdom.element.TestRemoveAttribute(metaFactory));
         addTest(new org.apache.axiom.ts.omdom.element.TestRemoveChildIncomplete(metaFactory));
+        addTest(new org.apache.axiom.ts.omdom.element.TestReplaceChildIncomplete(metaFactory));
         addTest(new org.apache.axiom.ts.omdom.factory.TestCreateOMAttribute(metaFactory));
         addTest(new org.apache.axiom.ts.omdom.factory.TestCreateOMTextCDATASection(metaFactory));
         addTest(new org.apache.axiom.ts.omdom.factory.TestCreateOMTextCDATASectionWithParent(metaFactory));

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=1366210&r1=1366209&r2=1366210&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 Thu Jul 26 22:04:05 2012
@@ -31,7 +31,8 @@ import org.apache.axiom.testutils.suite.
 public class SOAPTestSuiteBuilder extends TestSuiteBuilder {
     private static final String[] badSOAPFiles = { "wrongSoapNs.xml", "notnamespaceQualified.xml", "soap11/twoheaders.xml", "soap11/twoBodymessage.xml",
             "soap11/envelopeMissing.xml", "soap11/haederBodyWrongOrder.xml", "soap11/invalid-faultcode.xml", "soap11/invalid-faultstring.xml",
-            "soap11/invalid-faultactor.xml", "soap12/header-bad-case.xml", "soap12/header-no-namespace.xml" };
+            "soap11/invalid-faultactor.xml", "soap11/processing-instruction.xml", "soap11/entity-reference.xml",
+            "soap12/header-bad-case.xml", "soap12/header-no-namespace.xml", "soap12/processing-instruction.xml", "soap12/entity-reference.xml" };
     
     private static final String[] goodSOAPFiles = { TestConstants.WHITESPACE_MESSAGE,
         TestConstants.MINIMAL_MESSAGE, TestConstants.REALLY_BIG_MESSAGE,
@@ -101,14 +102,15 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap.body.TestHasFaultWithParser(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.builder.TestCommentInEpilog(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.builder.TestCommentInProlog(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.builder.TestDTD(metaFactory, spec));
         if (supportsBodyElementNameOptimization) {
             addTest(new org.apache.axiom.ts.soap.builder.TestRegisterCustomBuilderForPayloadAfterSOAPFaultCheck(metaFactory, spec));
         }
         addTest(new org.apache.axiom.ts.soap.envelope.TestAddHeaderToIncompleteEnvelope(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.envelope.TestBodyHeaderOrder(metaFactory, spec));
         if (supportsOMSourcedElement) {
-            addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElementWithSourcedElement1(metaFactory, spec));
-            addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElementWithSourcedElement2(metaFactory, spec));
+            addTest(new org.apache.axiom.ts.soap.envelope.TestCloneWithSourcedElement1(metaFactory, spec));
+            addTest(new org.apache.axiom.ts.soap.envelope.TestCloneWithSourcedElement2(metaFactory, spec));
         }
         addTest(new org.apache.axiom.ts.soap.envelope.TestDetach(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.envelope.TestGetBody(metaFactory, spec));
@@ -187,6 +189,10 @@ public class SOAPTestSuiteBuilder extend
         addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent1(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent2(metaFactory, spec));
         addTest(new org.apache.axiom.ts.soap.headerblock.TestWrongParent3(metaFactory, spec));
+        addTest(new org.apache.axiom.ts.soap.message.TestClone(metaFactory, spec, true));
+        addTest(new org.apache.axiom.ts.soap.message.TestClone(metaFactory, spec, false));
+        addTest(new org.apache.axiom.ts.soap.message.TestCloneIncomplete(metaFactory, spec, true));
+        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.xpath.TestXPathAppliedToSOAPEnvelope(metaFactory, spec, true));
@@ -202,14 +208,14 @@ public class SOAPTestSuiteBuilder extend
         for (int i=0; i<goodSOAPFiles.length; i++) {
             addTest(new org.apache.axiom.ts.soap.builder.MessageTest(metaFactory, goodSOAPFiles[i]));
         }
-        addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElement(metaFactory, SOAPSpec.SOAP11, "sample1.xml"));
-        addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElement(metaFactory, SOAPSpec.SOAP11, "soapmessage.xml"));
-        addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElement(metaFactory, SOAPSpec.SOAP11, "soapmessage1.xml"));
-        addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElement(metaFactory, SOAPSpec.SOAP11, "whitespacedMessage.xml"));
-        addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElement(metaFactory, SOAPSpec.SOAP11, "minimalMessage.xml"));
-        addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElement(metaFactory, SOAPSpec.SOAP11, "reallyReallyBigMessage.xml"));
-        addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElement(metaFactory, SOAPSpec.SOAP11, "emtyBodymessage.xml"));
-        addTest(new org.apache.axiom.ts.soap.envelope.TestCloneOMElement(metaFactory, SOAPSpec.SOAP11, "soap11fault.xml")); 
+        addTest(new org.apache.axiom.ts.soap.envelope.TestClone(metaFactory, SOAPSpec.SOAP11, "sample1.xml"));
+        addTest(new org.apache.axiom.ts.soap.envelope.TestClone(metaFactory, SOAPSpec.SOAP11, "soapmessage.xml"));
+        addTest(new org.apache.axiom.ts.soap.envelope.TestClone(metaFactory, SOAPSpec.SOAP11, "soapmessage1.xml"));
+        addTest(new org.apache.axiom.ts.soap.envelope.TestClone(metaFactory, SOAPSpec.SOAP11, "whitespacedMessage.xml"));
+        addTest(new org.apache.axiom.ts.soap.envelope.TestClone(metaFactory, SOAPSpec.SOAP11, "minimalMessage.xml"));
+        addTest(new org.apache.axiom.ts.soap.envelope.TestClone(metaFactory, SOAPSpec.SOAP11, "reallyReallyBigMessage.xml"));
+        addTest(new org.apache.axiom.ts.soap.envelope.TestClone(metaFactory, SOAPSpec.SOAP11, "emtyBodymessage.xml"));
+        addTest(new org.apache.axiom.ts.soap.envelope.TestClone(metaFactory, SOAPSpec.SOAP11, "soap11fault.xml")); 
         addTest(new org.apache.axiom.ts.soap11.builder.TestBuilder(metaFactory));
         addTest(new org.apache.axiom.ts.soap11.envelope.TestAddElementAfterBody(metaFactory));
         addTest(new org.apache.axiom.ts.soap11.fault.TestGetNode(metaFactory));

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetTextWithCDATA.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetTextWithCDATA.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetTextWithCDATA.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testsuite/src/main/java/org/apache/axiom/ts/soap11/faultreason/TestGetTextWithCDATA.java Thu Jul 26 22:04:05 2012
@@ -25,7 +25,6 @@ import javax.xml.stream.XMLStreamReader;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.OMMetaFactory;
 import org.apache.axiom.om.OMXMLBuilderFactory;
-import org.apache.axiom.om.util.StAXParserConfiguration;
 import org.apache.axiom.om.util.StAXUtils;
 import org.apache.axiom.soap.SOAPEnvelope;
 import org.apache.axiom.soap.SOAPFault;
@@ -54,7 +53,7 @@ public class TestGetTextWithCDATA extend
                     "</SOAP-ENV:Body>" +
                 "</SOAP-ENV:Envelope>";
         XMLStreamReader soap11Parser = StAXUtils.createXMLStreamReader(
-                StAXParserConfiguration.PRESERVE_CDATA_SECTIONS, new StringReader(soap11Fault));
+                TEST_PARSER_CONFIGURATION, new StringReader(soap11Fault));
         SOAPModelBuilder soap11Builder = OMXMLBuilderFactory.createStAXSOAPModelBuilder(metaFactory, soap11Parser);
         OMElement element = soap11Builder.getDocumentElement();
         element.build();

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/pom.xml Thu Jul 26 22:04:05 2012
@@ -53,10 +53,25 @@
             <version>1.4</version>
         </dependency>
         <dependency>
+            <groupId>${stax.impl.groupid}</groupId>
+            <artifactId>${stax.impl.artifact}</artifactId>
+        </dependency>
+        <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
         </dependency>
         <dependency>
+            <groupId>xmlunit</groupId>
+            <artifactId>xmlunit</artifactId>
+        </dependency>
+        <dependency>
+            <!-- This should not be necessary, but XMLAssertEx contains code that fails on some Java runtimes,
+                 presumably because of a bug in the DOM implementation. Therefore we use a well defined
+                 version of Xerces. -->
+            <groupId>xerces</groupId>
+            <artifactId>xercesImpl</artifactId>
+        </dependency>
+        <dependency>
             <!-- We use this only for LDAP like filters -->
             <groupId>org.osgi</groupId>
             <artifactId>org.osgi.core</artifactId>
@@ -91,7 +106,7 @@
                                     filelist.parentFile.mkdirs();
                                     filelist.delete();
                                     new File(project.basedir, "src/main/resources/org/apache/axiom/testutils/conformance").eachFile({
-                                        if (it.file) {
+                                        if (it.file && it.name.endsWith(".xml")) {
                                             filelist.append("$it.name\n");
                                         }
                                     })

Modified: webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java
URL: http://svn.apache.org/viewvc/webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java?rev=1366210&r1=1366209&r2=1366210&view=diff
==============================================================================
--- webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java (original)
+++ webservices/axiom/branches/AXIOM-201/modules/axiom-testutils/src/main/java/org/apache/axiom/testutils/stax/XMLStreamReaderComparator.java Thu Jul 26 22:04:05 2012
@@ -115,7 +115,7 @@ public class XMLStreamReaderComparator e
             if (actualException == null) {
                 fail("Expected " + methodName + " to throw " +
                         expectedException.getClass().getName() +
-                        ", but the method retuned normally (" + getLocation() + ")");
+                        ", but the method returned normally (" + getLocation() + ")");
             } else {
                 assertEquals(expectedException.getClass(), actualException.getClass());
             }