Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestable.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestable.java	(revision 6733)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestable.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestCase.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestCase.java	(revision 6733)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestCase.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
@@ -44,10 +44,6 @@
  */
 package org.exolab.castor.tests.framework;
 
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
 import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
@@ -52,22 +48,24 @@
 import java.io.IOException;
 import java.io.InputStream;
 import java.io.InputStreamReader;
-import java.util.jar.JarFile;
-
+import java.net.MalformedURLException;
+import java.net.URL;
 import java.net.URLClassLoader;
-import java.net.URL;
-import java.net.MalformedURLException;
+import java.util.jar.JarFile;
 
-import org.exolab.castor.xml.MarshalException;
-import org.exolab.castor.xml.ValidationException;
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
 
-import org.exolab.castor.tests.framework.testDescriptor.OnlySourceGenerationTest;
-import org.exolab.castor.tests.framework.testDescriptor.TestDescriptor;
 import org.exolab.castor.tests.framework.testDescriptor.MarshallingTest;
+import org.exolab.castor.tests.framework.testDescriptor.OnlySourceGenerationTest;
+import org.exolab.castor.tests.framework.testDescriptor.SchemaTest;
 import org.exolab.castor.tests.framework.testDescriptor.SourceGeneratorTest;
-import org.exolab.castor.tests.framework.testDescriptor.SchemaTest;
+import org.exolab.castor.tests.framework.testDescriptor.TestDescriptor;
 import org.exolab.castor.tests.framework.testDescriptor.TestDescriptorChoice;
 import org.exolab.castor.tests.framework.testDescriptor.UnitTestCase;
+import org.exolab.castor.xml.MarshalException;
+import org.exolab.castor.xml.ValidationException;
 
 /**
  * Abstracts a test case in the CTF (Castor Test Framework). A CTF test case can
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestSuiteRunner.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestSuiteRunner.java	(revision 6733)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CastorTestSuiteRunner.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CompareHelper.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CompareHelper.java	(revision 6733)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CompareHelper.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
@@ -47,7 +47,8 @@
 import java.lang.reflect.Array;
 
 /**
- * Assists in the comparison of objects.
+ * Assists in the comparison of objects.  This method is used by generated
+ * code but is not used within the CTF directly.
  *
  * @author <a href="mailto:gignoux@intalio.com">Sebastien Gignoux</a>
  * @version $Revision$ $Date: 2003-10-15 09:17:49 -0600 (Wed, 15 Oct 2003) $
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CTFUtils.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CTFUtils.java	(revision 6733)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/CTFUtils.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
@@ -45,6 +45,11 @@
  */
 package org.exolab.castor.tests.framework;
 
+import java.io.StringReader;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.exolab.castor.tests.framework.xmldiff.XMLDiff;
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.Unmarshaller;
 import org.exolab.castor.xml.ValidationException;
@@ -49,15 +54,6 @@
 import org.exolab.castor.xml.Unmarshaller;
 import org.exolab.castor.xml.ValidationException;
 
-import org.exolab.adaptx.xslt.dom.XPNReader;
-import org.exolab.adaptx.xpath.XPathNode;
-import org.exolab.adaptx.xml.XMLDiff;
-
-//-- Java imports
-import java.io.StringReader;
-import java.util.HashMap;
-import java.util.Map;
-
 /**
  * This class contains utility methods needed by the CTF.
  *
@@ -91,19 +87,6 @@
         nameMap.put(SHORT,     Short.TYPE);
     }
 
-   /**
-    * Loads the given XML file as an XPathNode.
-    *
-    * @param url the filename or URL of the XML file to load
-    * @return the XML file as an XPathNode
-    * @throws java.io.IOException if an error occurs reading the XML
-    */
-    public static XPathNode loadXPN(String url) throws java.io.IOException {
-        XPNReader reader = new XPNReader(url);
-        reader.setSaveLocation(true);
-        return reader.read();
-    } //-- loadXPN
-
     /**
      * Compares two XML documents located at 2 given URLs, returning the number
      * of differences or 0 if both documents are 'XML equivalent'.
@@ -116,11 +99,8 @@
      *             document
      */
     public static int compare(String document1, String document2) throws java.io.IOException {
-        XPathNode node1 = loadXPN(document1);
-        XPNReader reader = new XPNReader(document2);
-        XPathNode node2 = reader.read();
-        XMLDiff diff = new XMLDiff();
-        return diff.compare(node1, document1, node2, "In-Memory-Result");
+        XMLDiff diff = new XMLDiff(document1, document2);
+        return diff.compare();
     }
 
     /**
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/FileServices.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/FileServices.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/FileServices.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
@@ -44,10 +44,6 @@
  */
 package org.exolab.castor.tests.framework;
 
-import java.io.InputStream;
-import java.io.IOException;
-import java.io.OutputStream;
-
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
@@ -52,10 +48,12 @@
 import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
-
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.Enumeration;
+import java.util.jar.JarFile;
 import java.util.zip.ZipEntry;
-import java.util.jar.JarFile;
 
 /**
  * This class is a set of tools for manipulating files needed by the CTF.
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/MarshallingFrameworkTestCase.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/MarshallingFrameworkTestCase.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/MarshallingFrameworkTestCase.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
@@ -44,9 +44,15 @@
  */
 package org.exolab.castor.tests.framework;
 
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.net.URL;
+import java.net.URLClassLoader;
+
 import junit.framework.Test;
 import junit.framework.TestSuite;
 
+import org.exolab.castor.mapping.Mapping;
 import org.exolab.castor.tests.framework.testDescriptor.ListenerType;
 import org.exolab.castor.tests.framework.testDescriptor.MarshallingTest;
 import org.exolab.castor.tests.framework.testDescriptor.RootType;
@@ -51,15 +57,8 @@
 import org.exolab.castor.tests.framework.testDescriptor.MarshallingTest;
 import org.exolab.castor.tests.framework.testDescriptor.RootType;
 import org.exolab.castor.tests.framework.testDescriptor.UnitTestCase;
-import org.exolab.castor.mapping.Mapping;
-
 import org.xml.sax.InputSource;
 
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.net.URL;
-import java.net.URLClassLoader;
-
 /**
  * This class encapsulates all the logic to run the test patterns for the Castor
  * marshalling framework. This include introspection and mapping.
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/ObjectModelBuilder.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/ObjectModelBuilder.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/ObjectModelBuilder.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/OnlySourceGenerationTestCase.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/OnlySourceGenerationTestCase.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/OnlySourceGenerationTestCase.java	(working copy)
@@ -1,46 +1,19 @@
-/**
- * Redistribution and use of this software and associated documentation
- * ("Software"), with or without modification, are permitted provided
- * that the following conditions are met:
+/*
+ * Copyright 2006 Edward Kuns
  *
- * 1. Redistributions of source code must retain copyright
- *    statements and notices.  Redistributions must also contain a
- *    copy of this document.
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
  *
- * 2. Redistributions in binary form must reproduce the
- *    above copyright notice, this list of conditions and the
- *    following disclaimer in the documentation and/or other
- *    materials provided with the distribution.
+ * http://www.apache.org/licenses/LICENSE-2.0
  *
- * 3. The name "Exolab" must not be used to endorse or promote
- *    products derived from this Software without prior written
- *    permission of Intalio, Inc.  For written permission,
- *    please contact info@exolab.org.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
  *
- * 4. Products derived from this Software may not be called "Exolab"
- *    nor may "Exolab" appear in their names without prior written
- *    permission of Intalio, Inc. Exolab is a registered
- *    trademark of Intalio, Inc.
- *
- * 5. Due credit should be given to the Exolab Project
- *    (http://www.exolab.org/).
- *
- * THIS SOFTWARE IS PROVIDED BY INTALIO, INC. AND CONTRIBUTORS
- * ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
- * NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
- * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
- * INTALIO, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
- * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
- * OF THE POSSIBILITY OF SUCH DAMAGE.
- *
- * Copyright 2001-2003 (C) Intalio, Inc. All Rights Reserved.
- *
- * $Id: $
+ * $Id: OnlySourceGenerationTestCase.java 0000 2006-10-05 22:00:00Z ekuns $
  */
 package org.exolab.castor.tests.framework;
 
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/SchemaTestCase.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/SchemaTestCase.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/SchemaTestCase.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
@@ -53,14 +53,17 @@
  */
 package org.exolab.castor.tests.framework;
 
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.PrintWriter;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
 import org.exolab.castor.tests.framework.testDescriptor.SchemaDifferences;
 import org.exolab.castor.tests.framework.testDescriptor.UnitTestCase;
 import org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType;
-//-- JUnit imports
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-//-- Castor imports (to test SOM)
 import org.exolab.castor.xml.schema.Schema;
 import org.exolab.castor.xml.schema.reader.SchemaReader;
 import org.exolab.castor.xml.schema.writer.SchemaWriter;
@@ -65,17 +68,6 @@
 import org.exolab.castor.xml.schema.reader.SchemaReader;
 import org.exolab.castor.xml.schema.writer.SchemaWriter;
 
-//-- Adaptx imports (for using XMLDiff)
-import org.exolab.adaptx.xslt.dom.XPNBuilder;
-import org.exolab.adaptx.xpath.XPathNode;
-import org.exolab.adaptx.xml.XMLDiff;
-
-//-- Java imports
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.PrintWriter;
-
 /**
  * A JUnit test case for testing the Castor Schema Object Model.
  *
@@ -87,8 +79,6 @@
 
     /** The name of the schema to test. */
     private String         _schemaName;
-    /** The count of differences expected for the in-memory comparison. */
-    private final int      _differenceCountSchema;
     /** The count of differences expected for the file-reference comparison. */
     private final int      _differenceCountReference;
     /** Gold file to compare a schema against.  Optional.  Only needed if
@@ -112,7 +102,6 @@
      */
     public SchemaTestCase(final CastorTestCase castorTc, final UnitTestCase tc) {
         super(castorTc, tc);
-        _differenceCountSchema    = getSchemaDifferenceCount(tc, FailureStepType.COMPARE_SCHEMA);
         _differenceCountReference = getSchemaDifferenceCount(tc, FailureStepType.COMPARE_TO_REFERENCE);
         _goldFileName             = tc.getGoldFile();
     } //-- SchemaTest
@@ -181,22 +170,12 @@
 
         File schemaFile = new File(_test.getTestFile() + "/" + _schemaName);
         String schemaURL = schemaFile.toURL().toString();
-        XPathNode node1 = null;
-        try {
-            node1 = CTFUtils.loadXPN(schemaURL);
-        } catch (java.io.IOException iox) {
-            if (_printStack) {
-                iox.printStackTrace(System.out);
-            }
-            fail("Exception reading the schema '" + schemaURL + "': " + iox.toString());
-            return;
-        }
 
-        // node2 == null if read/write fails (which may be expected and is not an error)
-        XPathNode node2 = readAndWriteSchema(schemaURL);
-        if (node2 == null) {
+        Schema schema = testReadingSchema(schemaURL);
+        if (schema == null) {
             return;
         }
+        testWritingSchema(schemaURL, schema);
 
         // Compare marshaled schema to gold file if provided, otherwise to input file
         compareSchemaFiles(schemaFile);
@@ -201,24 +180,6 @@
         // Compare marshaled schema to gold file if provided, otherwise to input file
         compareSchemaFiles(schemaFile);
 
-        final FailureStepType step = _failure != null ? _failure.getFailureStep() : null;
-
-        XMLDiff diff = new XMLDiff();
-        final int result = diff.compare(node1, schemaURL, node2, "In-Memory-Result");
-
-        final boolean expectedToFail = _failure != null && _failure.getContent()
-                                       && (step == null || step.equals(FailureStepType.COMPARE_SCHEMA));
-
-        if (_failure == null || !_failure.getContent()) {
-            assertEquals("The schema comparison failed because the two are not equal", _differenceCountSchema, result);
-        } else if (expectedToFail) {
-            assertTrue("The schema comparison was expected to fail, but succeeded", result != _differenceCountSchema);
-        }
-
-        if (expectedToFail ^ (result == 0)) {
-            return;
-        }
-
         if (_failure != null && _failure.getContent()) {
             fail("The schema test was expected to fail, but passed");
         }
@@ -247,22 +208,6 @@
     }
 
     /**
-     * Reads the XML Schema located at the given URL into the Castor SOM. The
-     * Schema is then written from the SOM into an XPathNode.
-     *
-     * @param url the URL of the Schema to read.
-     * @return the XPathNode representation of the XML Schema
-     */
-    private XPathNode readAndWriteSchema(final String url) {
-        Schema schema = testReadingSchema(url);
-        if (schema == null) {
-            return null;
-        }
-        XPNBuilder builder = testWritingSchema(url, schema);
-        return (builder != null) ? builder.getRoot() : null;
-    } //-- readAndWriteSchema
-
-    /**
      * Reads and returns the provided XML schema.
      *
      * @param url the schema URL
@@ -288,19 +233,13 @@
     }
 
     /**
-     * Creates a new XPNBuilder, uses it to make a new SchemaWriter, and writes
-     * the provided schema to that SchemaWriter.
+     * Writes the provided schema to disk.
      *
      * @param url schema url, used only in diagnostic output
      * @param schema the schema to write
-     * @return a new XPNBuilder
      */
-    private XPNBuilder testWritingSchema(final String url, final Schema schema) {
-        //-- create XPNBuilder
-        XPNBuilder builder = new XPNBuilder();
-        builder.setSaveLocation(true);
-
-        //-- write schema to XPNBuilder
+    private void testWritingSchema(final String url, final Schema schema) {
+        // First write the schema to disk
         try {
             String fileName = _schemaName.substring(0,_schemaName.lastIndexOf('.'))
                               + "-output" + FileServices.XSD;
@@ -308,8 +247,7 @@
 
             File         output = new File(_outputRootFile, fileName);
             FileWriter   writer = new FileWriter(output);
-            PrintWriter  pw     = new PrintWriter(writer, true);
-            SchemaWriter sw     = new SchemaWriter(pw);
+            SchemaWriter sw     = new SchemaWriter(new PrintWriter(writer, true));
             sw.write(schema);
             writer.close();
         } catch (Exception e) {
@@ -316,18 +254,7 @@
             if (!checkExceptionWasExpected(e, FailureStepType.WRITE_SCHEMA)) {
                 fail("Failed to write Schema '" + url + "' to disk: " + e.toString());
             }
-            return null;
-        }
-
-        try {
-            // Now write the schema to an internal SchemaWriter
-            SchemaWriter sw = new SchemaWriter(builder);
-            sw.write(schema);
-        } catch (Exception e) {
-            if (!checkExceptionWasExpected(e, FailureStepType.WRITE_SCHEMA)) {
-                fail("Unable to write Schema '" + url + "' to XPNBuilder: " + e.toString());
-            }
-            return null;
+            return;
         }
 
         if (_failure != null && _failure.getContent() && _failure.getFailureStep() != null &&
@@ -334,8 +261,6 @@
             _failure.getFailureStep().equals(FailureStepType.WRITE_SCHEMA)) {
             fail("Writing the schema was expected to fail, but succeeded");
         }
-
-        return builder;
     }
 
 } //-- SchemaTest
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/SourceGeneratorTestCase.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/SourceGeneratorTestCase.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/SourceGeneratorTestCase.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestCaseAggregator.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestCaseAggregator.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestCaseAggregator.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
@@ -44,6 +44,8 @@
  */
 package org.exolab.castor.tests.framework;
 
+import java.io.File;
+
 import junit.framework.Test;
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
@@ -48,8 +50,6 @@
 import junit.framework.TestCase;
 import junit.framework.TestSuite;
 
-import java.io.File;
-
 /**
  * This class is used to inspect recursively a hierarchy of directories that
  * contain CTF tests (jars or directories). A JUnit TestSuite is created for
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestDescriptor.xsd
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestDescriptor.xsd	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestDescriptor.xsd	(working copy)
@@ -391,7 +391,7 @@
         </xsd:simpleContent>
     </xsd:complexType>
 
-    <!-- The failure type -->
+    <!-- The expected count of schema differences (if not zero) -->
     <xsd:complexType name="SchemaDifferencesType">
         <xsd:annotation>
             <xsd:documentation>
@@ -411,7 +411,6 @@
        <xsd:restriction base="xsd:string">
            <xsd:enumeration value="parse-schema"/>
            <xsd:enumeration value="write-schema"/>
-           <xsd:enumeration value="compare-schema"/>
            <xsd:enumeration value="source-generation"/>
            <xsd:enumeration value="source-compilation"/>
            <xsd:enumeration value="load-generated-classes"/>
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithCustomTest.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithCustomTest.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithCustomTest.java	(working copy)
@@ -20,6 +20,8 @@
 import java.util.Iterator;
 import java.util.List;
 
+import junit.framework.TestCase;
+
 import org.exolab.castor.tests.framework.testDescriptor.ConfigurationType;
 import org.exolab.castor.tests.framework.testDescriptor.CustomTest;
 import org.exolab.castor.tests.framework.testDescriptor.FailureType;
@@ -25,8 +27,6 @@
 import org.exolab.castor.tests.framework.testDescriptor.FailureType;
 import org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType;
 
-import junit.framework.TestCase;
-
 /**
  * Implements a test case that tests code written by the XML source generator.
  * This class uses a user-provided test class to test the generated source.
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithRandomObject.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithRandomObject.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithRandomObject.java	(working copy)
@@ -20,11 +20,11 @@
 import java.io.File;
 import java.io.FileWriter;
 
+import junit.framework.TestCase;
+
 import org.exolab.castor.tests.framework.testDescriptor.FailureType;
 import org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType;
 
-import junit.framework.TestCase;
-
 /**
  * Implements a test case that tests code written by the XML source generator.
  * This class uses the generated source to write a randomly generated XML
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithReferenceDocument.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithReferenceDocument.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/TestWithReferenceDocument.java	(working copy)
@@ -22,11 +22,11 @@
 import java.io.IOException;
 import java.io.InputStream;
 
+import junit.framework.TestCase;
+
 import org.exolab.castor.tests.framework.testDescriptor.FailureType;
 import org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType;
 
-import junit.framework.TestCase;
-
 /**
  * Implements a test case that tests code written by the XML source generator.
  * This class uses the generated source to read and write an XML document,
@@ -62,7 +62,9 @@
     protected final String         _builderClassName;
     /** Header of the name of all our output files ... marshaled and dumped. */
     protected final String         _outputName;
+    /** Input file for test XML. (May be null if the builder class is provided.) */
     protected final String         _inputName;
+    /** Gold file filename, really only useful if a class builder and no input file is given. */
     protected final String         _goldFileName;
 
     /**
@@ -90,12 +92,14 @@
         _builderClassName = tc._unitTest.getObjectBuilder();
         _inputName        = tc._unitTest.getInput();
 
-        // FIXME: TEMPORARILY suppress GOLDFILE for sourcegen tests as a few tests are broken
-        if (_delegate instanceof MarshallingFrameworkTestCase) {
-            _goldFileName     = tc._unitTest.getGoldFile();
-        } else {
-            _goldFileName = null;
-        }
+        // Gold File should be set to input file if no gold file is specified
+        // but some tests fail (genuine failures) so for now this is disabled.
+
+//      if (tc._unitTest.getGoldFile() != null) {
+            _goldFileName = tc._unitTest.getGoldFile();
+//      } else {
+//          _goldFileName = _inputName;
+//      }
     }
 
     /**
@@ -201,7 +205,7 @@
                     && _failure.getFailureStep().equals(FailureStepType.COMPARE_TO_REFERENCE);
 
             if (_failure == null ||!_failure.getContent()) {
-                assertEquals("The Marshaled object differs from the gold file", result, 0);
+                assertEquals("The Marshaled object differs from the gold file", 0, result);
             } else if (expectedToFail) {
                 assertTrue("The Marshaled object was expected to differ from the" +
                            " gold file, but did not", result != 0);
Index: /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/XMLTestCase.java
===================================================================
--- /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/XMLTestCase.java	(revision 6731)
+++ /home/ekuns/workspace/castor-4/src/tests/main/org/exolab/castor/tests/framework/XMLTestCase.java	(working copy)
@@ -1,4 +1,4 @@
-/**
+/*
  * Redistribution and use of this software and associated documentation
  * ("Software"), with or without modification, are permitted provided
  * that the following conditions are met:
@@ -44,12 +44,21 @@
  */
 package org.exolab.castor.tests.framework;
 
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileWriter;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.lang.reflect.Method;
+import java.util.Enumeration;
+import java.util.LinkedList;
+import java.util.List;
+
 import junit.framework.TestCase;
 
+import org.exolab.castor.mapping.Mapping;
 import org.exolab.castor.tests.framework.testDescriptor.CallMethod;
-import org.exolab.castor.tests.framework.testDescriptor.UnitTestCase;
-import org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType;
-import org.exolab.castor.tests.framework.testDescriptor.types.TypeType;
 import org.exolab.castor.tests.framework.testDescriptor.Configuration;
 import org.exolab.castor.tests.framework.testDescriptor.ConfigurationType;
 import org.exolab.castor.tests.framework.testDescriptor.FailureType;
@@ -54,31 +63,18 @@
 import org.exolab.castor.tests.framework.testDescriptor.ConfigurationType;
 import org.exolab.castor.tests.framework.testDescriptor.FailureType;
 import org.exolab.castor.tests.framework.testDescriptor.ListenerType;
-
+import org.exolab.castor.tests.framework.testDescriptor.UnitTestCase;
 import org.exolab.castor.tests.framework.testDescriptor.Value;
+import org.exolab.castor.tests.framework.testDescriptor.types.FailureStepType;
+import org.exolab.castor.tests.framework.testDescriptor.types.TypeType;
 import org.exolab.castor.util.NestedIOException;
-
-import org.exolab.castor.mapping.Mapping;
-import org.exolab.castor.xml.Unmarshaller;
-import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.MarshalException;
 import org.exolab.castor.xml.MarshalListener;
+import org.exolab.castor.xml.Marshaller;
 import org.exolab.castor.xml.UnmarshalListener;
-
+import org.exolab.castor.xml.Unmarshaller;
 import org.xml.sax.InputSource;
 
-import java.io.InputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileWriter;
-import java.io.PrintWriter;
-import java.io.StringWriter;
-import java.util.Enumeration;
-import java.util.LinkedList;
-import java.util.List;
-
-import java.lang.reflect.Method;
-
 /**
  * This class encapsulates all the common logic to run the test patterns for
  * Castor XML. Basically it handle the marshalling/marshalling/comparing. This
