diff --git a/tests/org.eclipse.wst.common.tests/.classpath b/tests/org.eclipse.wst.common.tests/.classpath
new file mode 100644
index 0000000..40aaabb
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+    <classpathentry kind="src" path="commontests"/>
+    <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+    <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+    <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/org.eclipse.wst.common.tests/.cvsignore b/tests/org.eclipse.wst.common.tests/.cvsignore
new file mode 100644
index 0000000..ba077a4
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/.cvsignore
@@ -0,0 +1 @@
+bin
diff --git a/tests/org.eclipse.wst.common.tests/.project b/tests/org.eclipse.wst.common.tests/.project
new file mode 100644
index 0000000..683085f
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.wst.common.tests</name>
+	<comment></comment>
+	<projects>
+		<project>org.apache.xerces</project>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.ManifestBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+		<buildCommand>
+			<name>org.eclipse.pde.SchemaBuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+		<nature>org.eclipse.pde.PluginNature</nature>
+	</natures>
+</projectDescription>
diff --git a/tests/org.eclipse.wst.common.tests/build.properties b/tests/org.eclipse.wst.common.tests/build.properties
new file mode 100644
index 0000000..5427186
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/build.properties
@@ -0,0 +1,5 @@
+bin.includes = commontests.jar,\
+               plugin.xml,\
+               testData/
+source.commontests.jar = commontests/
+output.commontests.jar = bin/
diff --git a/tests/org.eclipse.wst.common.tests/build/buildcontrol.properties b/tests/org.eclipse.wst.common.tests/build/buildcontrol.properties
new file mode 100644
index 0000000..8db5dee
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/build/buildcontrol.properties
@@ -0,0 +1,7 @@
+CONTACT=danberg@us.ibm.com
+ComponentShortName=commontests
+ComponentFullName=Common Tests
+ComponentCompetency=Common Tests
+JavaCompile.1=srcjar
+BuildVerification.1=call webbvt.bat
+Export.jarFile=commontests.jar
diff --git a/tests/org.eclipse.wst.common.tests/build/package.xml b/tests/org.eclipse.wst.common.tests/build/package.xml
new file mode 100644
index 0000000..231e7d8
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/build/package.xml
@@ -0,0 +1,17 @@
+<project name="com.ibm.etools.commontests" default="packagingPlugin" basedir="./..">
+    <target name="init">
+        <property name="packageDir" value=""/>
+        <property name="plugin.directory"  value="${basedir}"/>
+        <property name="plugin.id" value="com.ibm.etools.commontests"/>
+        <property name="plugin.version"  value=""/>
+    </target>
+    <target name="packagingPlugin" depends="init">
+        <echo message="${plugin.id}"/>
+        <copy todir="${packageDir}/plugins/${plugin.id}_${plugin.version}">
+            <fileset dir="${plugin.directory}">
+                <include name="plugin.xml"/>
+                <include name="runtime/commontests.jar"/>
+            </fileset>
+        </copy>
+    </target>
+</project>
diff --git a/tests/org.eclipse.wst.common.tests/build/wsBuild.xml b/tests/org.eclipse.wst.common.tests/build/wsBuild.xml
new file mode 100644
index 0000000..77c0b82
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/build/wsBuild.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0"?>
+<!DOCTYPE project [
+	<!ENTITY baseBuild SYSTEM "file:../../wsBuildDef.xml">
+]>
+
+<project name="buildPlugin" default="build" basedir="./..">
+
+<!-- include the common xml build file -->
+&baseBuild;
+
+<target name="build" depends="prepare" if="plugin.id">
+	<antcall target="buildjar">
+		<param name="jarname" value="${defaultjarname}"/>
+		<param name="jarclasspath" value="${plugin.classpath}"/>
+	</antcall>
+</target>
+</project>
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitor.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitor.java
new file mode 100644
index 0000000..bfd512c
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitor.java
@@ -0,0 +1,282 @@
+/*
+ * Created on Mar 17, 2003
+ *
+ * To change this generated comment go to 
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.eclipse.etools.common.tests.xml;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+
+import org.w3c.dom.Attr;
+import org.w3c.dom.CharacterData;
+import org.w3c.dom.Document;
+import org.w3c.dom.DocumentFragment;
+import org.w3c.dom.DocumentType;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.ProcessingInstruction;
+import org.xml.sax.EntityResolver;
+import org.xml.sax.InputSource;
+
+/**
+ * THE MASTER COPY of this class is in com.ibm.etools.commontests
+ * Please update the copy in commontests and then copy this class to
+ * where you need it if you are looking at a different copy
+ * 
+ * @author jsholl
+ *
+ * To change this generated comment go to 
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class DomComparitor {
+    private static HashSet attributeList;
+
+    public static String compareDoms(InputSource source1, InputSource source2, HashSet ignorableAtts, EntityResolver entityResolver) throws Exception {
+//        attributeList = ignorableAtts;
+//        DOMParser parser = new DOMParser();
+//        if (entityResolver == null) {
+//            parser.setEntityResolver(new EntityResolver() {
+//                public InputSource resolveEntity(String arg0, String arg1) throws SAXException, IOException {
+//                    return null;
+//                }
+//            });
+//        } else {
+//            parser.setEntityResolver(entityResolver);
+//        }
+//        parser.parse(source1);
+//        Document doc1 = parser.getDocument();
+//        parser.parse(source2);
+//        Document doc2 = parser.getDocument();
+//        return compareNodes(doc1, doc2);
+    	return null;
+    }
+    public static String compareDoms(InputSource source1, InputSource source2, HashSet ignorableAtts) throws Exception {
+        return compareDoms(source1, source2, ignorableAtts, null);
+    }
+
+    public static String compareDoms(InputSource source1, InputSource source2) throws Exception {
+        return compareDoms(source1, source2, null);
+    }
+
+    public static String compareNodes(Node node1, Node node2) throws Exception {
+        //        System.out.println("checking A:" + node1);
+        //        System.out.println("checking B:" + node2);
+        //        System.out.println("nodeType=" + node1.getNodeType());
+        //        System.out.println("getNodeName=" + node1.getNodeName());
+        //        System.out.println("getNodeValue=" + node1.getNodeValue());
+
+        //Generic Node Testing 
+        //        if (node1 == null && node2 == null)
+        //            return null;
+        //        else 
+        if ((node1 != null && node2 == null) || node1 == null && node2 != null)
+            return nullNodeEncountered(node1, node2);
+        else if (node1.getNodeType() != node2.getNodeType()) {
+            return mismatch("Node.getNodeType() " + node1.getNodeType() + " " + node2.getNodeType(), node1, node2);
+        } else if (node1.getNodeName() != node2.getNodeName()) {
+            return mismatch("Node.getNodeName() <" + node1.getNodeName() + "> <" + node2.getNodeName() + ">", node1, node2);
+        } else if (!(node1.getNodeValue() == null && node2.getNodeValue() == null)) {
+            if (node1.getNodeValue() == null) {
+                return mismatch("Node.getNodeValue() node A is null", node1, node2);
+            } else if (node2.getNodeValue() == null) {
+                return mismatch("Node.getNodeValue() node B is null", node1, node2);
+            } else if (!node1.getNodeValue().trim().equals(node2.getNodeValue().trim())) {
+                return mismatch("Node.getNodeValue() <" + node1.getNodeValue() + "> <" + node2.getNodeValue() + ">", node1, node2);
+            }
+        }
+        //TODO strengthen node comparisons as necessary
+        //Specialized Node Testing
+        switch (node1.getNodeType()) {
+            case Node.TEXT_NODE :
+            case Node.CDATA_SECTION_NODE :
+                CharacterData cdata1 = (CharacterData) node1;
+                CharacterData cdata2 = (CharacterData) node2;
+                if (!cdata1.getData().trim().equals(cdata2.getData().trim())) {
+                    return mismatch("CharacterData.getData() " + cdata1.getData() + " " + cdata2.getData(), node1, node2);
+                }
+                break;
+            case Node.ATTRIBUTE_NODE :
+                Attr attr1 = (Attr) node1;
+                Attr attr2 = (Attr) node2;
+                if (!attr1.getName().equals(attr2.getName())) {
+                    return mismatch("Attr.getName() " + attr1.getName() + " " + attr2.getName(), node1, node2);
+                } else if (!attr1.getValue().equals(attr2.getValue())) {
+                    return mismatch("Attr.getValue() " + attr1.getValue() + " " + attr2.getValue(), node1, node2);
+                } else if (attr1.getSpecified() != attr2.getSpecified()) {
+                    return mismatch("Attr.getSpecified() " + attr1.getSpecified() + " " + attr2.getSpecified(), node1, node2);
+                }
+                break;
+            case Node.DOCUMENT_NODE :
+                Document doc1 = (Document) node1;
+                Document doc2 = (Document) node2;
+                String result = compareNodes(doc1.getDoctype(), doc2.getDoctype());
+                if (result != null) {
+                    return result;
+                }
+                break;
+            case Node.DOCUMENT_TYPE_NODE :
+                DocumentType docType1 = (DocumentType) node1;
+                DocumentType docType2 = (DocumentType) node2;
+                if (!docType1.getPublicId().equals(docType2.getPublicId())) {
+                    return mismatch("DocumentType.getPublicId() " + docType1.getPublicId() + " " + docType2.getPublicId(), node1, node2);
+                }
+                break;
+            case Node.PROCESSING_INSTRUCTION_NODE :
+                ProcessingInstruction pInst1 = (ProcessingInstruction) node1;
+                ProcessingInstruction pInst2 = (ProcessingInstruction) node2;
+                //System.out.println("ProcessingInstruction todo");
+                break;
+            case Node.DOCUMENT_FRAGMENT_NODE :
+                DocumentFragment frag1 = (DocumentFragment) node1;
+                DocumentFragment frag2 = (DocumentFragment) node2;
+                //System.out.println("DocumentFragment todo");
+                break;
+
+            case Node.ELEMENT_NODE :
+            case Node.COMMENT_NODE :
+            case Node.ENTITY_NODE :
+            case Node.NOTATION_NODE :
+                break;
+
+        }
+
+        //Recursion
+        NamedNodeMap attributes1 = node1.getAttributes();
+        NamedNodeMap attributes2 = node2.getAttributes();
+
+        if (attributes1 != null && attributes2 != null) {
+            ignoreAttributes(attributes1, attributes2);
+            if (attributes1.getLength() != attributes2.getLength()) {
+                return mismatch("getAttributes().getLength() " + attributes1.getLength() + " " + attributes2.getLength(), node1, node2);
+            }
+            for (int i = 0; i < attributes1.getLength(); i++) {
+                Attr attr1 = (Attr) attributes1.item(i);
+                Attr attr2 = (Attr) attributes2.item(i);
+                String results = compareNodes(attr1, attr2);
+				if (null != results) {
+					return results;
+				}
+            }
+
+        } else if (attributes1 != null || attributes2 != null) {
+            return mismatch("getAttributes() null", node1, node2);
+        }
+
+        ArrayList children1 = getAsArrayList(node1.getChildNodes());
+        ArrayList children2 = getAsArrayList(node2.getChildNodes());
+
+        ignoreComments(children1);
+        ignoreComments(children2);
+
+        ignoreEmptyTextNodes(children1);
+        ignoreEmptyTextNodes(children2);
+
+        if (children1.size() != children2.size()) {
+            return mismatch("Node.hasChildNodes() " + children1.size() + " " + children2.size(), node1, node2);
+        }
+
+        for (int i = 0; i < children1.size(); i++) {
+            Node child1 = (Node) children1.get(i);
+            Node child2 = (Node) children2.get(i);
+            String results = compareNodes(child1, child2);
+            if (null != results) {
+                return results;
+            }
+        }
+        return null;
+    }
+
+    private static ArrayList getAsArrayList(NodeList originalList) {
+        ArrayList newList = new ArrayList();
+        if (originalList != null) {
+            for (int i = 0; i < originalList.getLength(); i++) {
+                newList.add(originalList.item(i));
+            }
+        }
+        return newList;
+    }
+
+    private static void ignoreComments(ArrayList list) {
+        ArrayList toRemove = new ArrayList();
+        for (int i = 0; i < list.size(); i++) {
+            Node node = (Node) list.get(i);
+            if (node.getNodeType() == Node.COMMENT_NODE) {
+                toRemove.add(node);
+            }
+        }
+        for (int i = 0; i < toRemove.size(); i++) {
+            list.remove(toRemove.get(i));
+        }
+    }
+
+    private static void ignoreEmptyTextNodes(ArrayList list) {
+        ArrayList toRemove = new ArrayList();
+        for (int i = 0; i < list.size(); i++) {
+            Node node = (Node) list.get(i);
+            if (node.getNodeType() == Node.TEXT_NODE && (node.getNodeValue() == null || node.getNodeValue().trim().equals(""))) {
+                toRemove.add(node);
+            }
+        }
+        for (int i = 0; i < toRemove.size(); i++) {
+            list.remove(toRemove.get(i));
+        }
+    }
+
+    /**
+     * @param attributes1
+     */
+    private static void ignoreAttributes(NamedNodeMap attributes1, NamedNodeMap attributes2) {
+        if (attributeList != null) {
+            Iterator it = attributeList.iterator();
+            String ignore;
+            while (it.hasNext()) {
+                ignore = (String) it.next();
+                if (attributes1.getNamedItem(ignore) != null)
+                    attributes1.removeNamedItem(ignore);
+                if (attributes2.getNamedItem(ignore) != null)
+                    attributes2.removeNamedItem(ignore);
+            }
+        }
+    }
+
+    public static String nullNodeEncountered(Node node1, Node node2) {
+        String message = "Null node encountered";
+        Node nonNullNode = node1 == null ? node2 : node1;
+        char source = node1 == null ? 'B' : 'A';
+        while (nonNullNode != null) {
+            message += source + nonNullNode.getNodeName() + "\n";
+            nonNullNode = nonNullNode.getParentNode();
+        }
+        return message;
+    }
+
+    public static String nodeNotCompared(Node node) {
+        String message = "Node node compared:";
+        while (node != null) {
+            message += node.getNodeName() + "\n";
+            node = node.getParentNode();
+        }
+
+        return message;
+    }
+
+    public static String mismatch(String mismatchtype, Node node1, Node node2) throws Exception {
+        String message = "Nodes A and B do not match because of node." + mismatchtype + "\n";
+        while (node1 != null && node2 != null) {
+            message += "A:" + node1.getNodeName() + "\n";
+            message += "B:" + node2.getNodeName() + "\n";
+            node1 = node1.getParentNode();
+            node2 = node2.getParentNode();
+        }
+
+        return message;
+    }
+
+    public static void main(String[] args) {
+    }
+
+}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitorTest.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitorTest.java
new file mode 100644
index 0000000..f728081
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitorTest.java
@@ -0,0 +1,93 @@
+/*
+ * Created on Apr 3, 2003
+ *
+ * To change this generated comment go to 
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.eclipse.etools.common.tests.xml;
+
+import java.io.File;
+import java.io.FileReader;
+
+import junit.framework.Assert;
+import junit.framework.TestCase;
+
+import org.xml.sax.InputSource;
+
+/**
+ * @author jsholl
+ *
+ * To change this generated comment go to 
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class DomComparitorTest extends TestCase {
+
+    String baseDir = System.getProperty("user.dir") + java.io.File.separatorChar;
+    String testData = baseDir + "testData" + java.io.File.separatorChar;
+
+    public DomComparitorTest(String name) {
+        super(name);
+    }
+
+    public void testEqualDoms_01() {
+        checkEqual("baseData_01.xml", "baseData_01.xml");
+    }
+
+    public void testEqualDoms_01_01() {
+        checkEqual("baseData_01.xml", "equalTo_01_case_01.xml");
+    }
+
+	public void testEqualDoms_01_02() {
+		checkEqual("baseData_01.xml", "equalTo_01_case_02.xml");
+	}
+
+    public void testUnequalDom_01_01() {
+        checkUnequal("baseData_01.xml", "unequalTo_01_case_01.xml");
+    }
+
+    public void testUnequalDom_01_02() {
+        checkUnequal("baseData_01.xml", "unequalTo_01_case_02.xml");
+    }
+
+    public void testUnequalDom_01_03() {
+        checkUnequal("baseData_01.xml", "unequalTo_01_case_03.xml");
+    }
+
+    public void testUnequalDom_01_04() {
+        checkUnequal("baseData_01.xml", "unequalTo_01_case_04.xml");
+    }
+
+    //TODO figure out how to compare encodings
+    //	public void testUnequalDom_01_05() {
+    //		checkUnequal("baseData_01.xml", "unequalTo_01_case_05.xml");
+    //	}
+
+    private void checkEqual(String fileName1, String fileName2) {
+        try {
+            InputSource source1 = new InputSource(new FileReader(new File(testData + fileName1)));
+            InputSource source2 = new InputSource(new FileReader(new File(testData + fileName2)));
+//            String results = DomComparitor.compareDoms(source1, source2);
+//            if (results != null) {
+//                Assert.fail("Equal doms compared as unequal " + fileName1 + " " + fileName2 + "\ncompare results = " + results);
+//            }
+        } catch (Exception e) {
+            e.printStackTrace();
+            Assert.fail(e.getMessage());
+        }
+    }
+
+    private void checkUnequal(String fileName1, String fileName2) {
+        try {
+            InputSource source1 = new InputSource(new FileReader(new File(testData + fileName1)));
+            InputSource source2 = new InputSource(new FileReader(new File(testData + fileName2)));
+//            String results = DomComparitor.compareDoms(source1, source2);
+//            if (results == null) {
+//                Assert.fail("Unequal doms compared as equal " + fileName1 + " " + fileName2);
+//            }
+        } catch (Exception e) {
+        	e.printStackTrace();
+            Assert.fail(e.getMessage());
+        }
+    }
+
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/extras/MemoryUsageTestSuite.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/extras/MemoryUsageTestSuite.java
new file mode 100644
index 0000000..c1d7c96
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/extras/MemoryUsageTestSuite.java
@@ -0,0 +1,114 @@
+package org.eclipse.wst.common.extras;
+
+
+import junit.framework.TestResult;
+import junit.framework.TestSuite;
+/*
+ * Licensed Material - Property of IBM 
+ * (C) Copyright IBM Corp. 2002 - All Rights Reserved. 
+ * US Government Users Restricted Rights - Use, duplication or disclosure 
+ * restricted by GSA ADP Schedule Contract with IBM Corp. 
+ */
+public class MemoryUsageTestSuite extends TestSuite {
+	//protected String GLOBAL_OUTPUT_FILENAME = "d:/eclipse/common_archive/memoryUsage/CommonArchive_MOF5.out";
+	protected String GLOBAL_OUTPUT_FILENAME = "./EMF_Data.txt";
+	protected boolean TRACK_MEMORY = true;
+	protected String outputFileName;
+	/**
+	 * Constructor for MemoryUsageTestSuite.
+	 */
+	public MemoryUsageTestSuite() {
+		super();
+	}
+	/**
+	 * Constructor for MemoryUsageTestSuite.
+	 * @param theClass
+	 */
+	public MemoryUsageTestSuite(Class theClass) {
+		super(theClass);
+	}
+	/**
+	 * Constructor for MemoryUsageTestSuite.
+	 * @param name
+	 */
+	public MemoryUsageTestSuite(String name) {
+		super(name);
+	}
+		
+	public void run(TestResult result) {
+//		TimerStep step = null;
+//		if (TRACK_MEMORY) {
+//			step = TimerStep.instance();
+//			step.setLogFile(getOutputName());
+//			if (!step.isOn())
+//				step.setIsOn(true);
+//			step.write("", "Before " + getMemoryName() + " Test Run");
+//			step.totalMemory(0);
+//			step.usedMemory(0);
+//		}
+//		super.run(result);
+//		if (TRACK_MEMORY) {
+//			step.write("", "After " + getMemoryName() + " Test Run");
+//			step.totalMemory(0);
+//			step.usedMemory(0);
+//		}
+		
+		super.run(result);
+	}
+
+	/**
+	 * Method getOutputName.
+	 * @return String
+	 */
+	private String getOutputName() {
+		if (outputFileName != null && outputFileName.length() > 0)
+			return outputFileName;
+		return GLOBAL_OUTPUT_FILENAME;
+	}
+
+
+	/**
+	 * Method getMemoryName.
+	 * @return String
+	 */
+	private String getMemoryName() {
+		if (getName() != null && getName().length() > 0)
+			return getName();
+		if (getClass() != null)
+			return getClass().getName();
+		return "Unknown Test";
+	}
+
+	/**
+	 * Sets the outputFileName.
+	 * @param outputFileName The outputFileName to set
+	 */
+	public void setOutputFileName(String outputFileName) {
+		this.outputFileName = outputFileName;
+	}
+
+	/**
+	 * Returns the gLOBAL_OUTPUT_FILENAME.
+	 * @return String
+	 */
+	public String getGLOBAL_OUTPUT_FILENAME() {
+		return GLOBAL_OUTPUT_FILENAME;
+	}
+
+	/**
+	 * Sets the gLOBAL_OUTPUT_FILENAME.
+	 * @param gLOBAL_OUTPUT_FILENAME The fileName to set
+	 */
+	public void setGLOBAL_OUTPUT_FILENAME(String fileName) {
+		GLOBAL_OUTPUT_FILENAME = fileName;
+	}
+
+	/**
+	 * Sets the tRACK_MEMORY.
+	 * @param tRACK_MEMORY The aBoolean to set
+	 */
+	public void setTRACK_MEMORY(boolean aBoolean) {
+		TRACK_MEMORY = aBoolean;
+	}
+
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/BaseTestCase.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/BaseTestCase.java
new file mode 100644
index 0000000..35748e8
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/BaseTestCase.java
@@ -0,0 +1,48 @@
+/*
+ * Created on Nov 24, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.eclipse.wst.common.tests;
+import junit.framework.TestCase;
+
+public class BaseTestCase extends TestCase {
+
+	/**
+	 * 
+	 */ 
+	public BaseTestCase() {
+		super(); 
+	}
+
+	/**
+	 * @param name
+	 */
+	public BaseTestCase(String name) {
+		super(name); 
+	}
+	
+		
+	/* (non-Javadoc)
+	 * @see junit.framework.TestCase#setUp()
+	 */
+	public void setUpTest() throws Exception { 
+		setUp();
+	}
+	
+	/* (non-Javadoc)
+	 * @see junit.framework.TestCase#tearDown()
+	 */
+	public final void tearDownTest() throws Exception { 
+		tearDown();
+	}
+	
+	/* (non-Javadoc)
+	 * @see junit.framework.TestCase#runBare()
+	 */
+	public final void runCoreTest() throws Throwable { 
+		runTest();
+	}
+
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/CommonTestsPlugin.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/CommonTestsPlugin.java
new file mode 100644
index 0000000..c41276b
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/CommonTestsPlugin.java
@@ -0,0 +1,34 @@
+/*
+ * Created on Nov 3, 2003
+ *
+ * To change the template for this generated file go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+package org.eclipse.wst.common.tests;
+
+import org.eclipse.core.runtime.IExtensionPoint;
+import org.eclipse.core.runtime.IPluginDescriptor;
+import org.eclipse.core.runtime.Plugin;
+
+/**
+ * @author jsholl
+ *
+ * To change the template for this generated type comment go to
+ * Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and Comments
+ */
+public class CommonTestsPlugin extends Plugin {
+	public static String PLUGIN_ID = "org.eclipse.wst.common.tests";
+	public static CommonTestsPlugin instance = null;
+	public IExtensionPoint dataModelVerifierExt = null;
+	
+	/**
+	 * @param descriptor
+	 */
+	public CommonTestsPlugin(IPluginDescriptor descriptor) {
+		super(descriptor);
+		instance = this;
+		dataModelVerifierExt = descriptor.getExtensionPoint("DataModelVerifier");
+		// TODO Auto-generated constructor stub
+	}
+
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifier.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifier.java
new file mode 100644
index 0000000..f0d2836
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifier.java
@@ -0,0 +1,23 @@
+/*
+ * Created on Jan 5, 2004
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+package org.eclipse.wst.common.tests;
+
+import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
+
+/**
+ * @author Administrator
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class DataModelVerifier {
+	
+	public void verify(WTPOperationDataModel model) throws Exception {
+		
+	}
+
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierFactory.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierFactory.java
new file mode 100644
index 0000000..b7f3aea
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierFactory.java
@@ -0,0 +1,119 @@
+/*
+ * Created on Jan 5, 2004
+ * 
+ * To change the template for this generated file go to Window - Preferences - Java - Code
+ * Generation - Code and Comments
+ */
+package org.eclipse.wst.common.tests;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IConfigurationElement;
+import org.eclipse.core.runtime.IExtension;
+import org.eclipse.wst.common.frameworks.internal.operations.OperationExtension;
+import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
+import org.eclispe.wst.common.frameworks.internal.plugin.WTPCommonPlugin;
+
+import com.ibm.wtp.common.RegistryReader;
+
+/**
+ * @author Administrator
+ * 
+ * To change the template for this generated type comment go to Window -
+ * Preferences - Java - Code Generation - Code and Comments
+ */
+public class DataModelVerifierFactory extends RegistryReader{
+	static final String DATA_MODEL_VERIFIER_LIST_EXT = "dataModelVerifierList";
+	static final String LIST_CLASS = "listClass";
+	private Map dataModelVerifiersMap = null;
+	private static DataModelVerifierFactory instance = null;
+	
+	public DataModelVerifierFactory() {
+		super(CommonTestsPlugin.PLUGIN_ID, "DataModelVerifier"); //$NON-NLS-1$
+	}
+	
+	public static DataModelVerifierFactory getInstance() {
+		if (instance == null){
+			instance = new DataModelVerifierFactory();
+			instance.readRegistry();
+		}
+		return instance;
+	}
+	/* (non-Javadoc)
+	 * @see com.ibm.wtp.common.RegistryReader#readElement(org.eclipse.core.runtime.IConfigurationElement)
+	 */
+	public boolean readElement(IConfigurationElement element) {
+		if (!element.getName().equals(DATA_MODEL_VERIFIER_LIST_EXT))
+			return false;
+		try {
+			DataModelVerifierList list = (DataModelVerifierList)element.createExecutableExtension(LIST_CLASS);
+			addToDataModelVerifiersMap(list.getDataModelVerifiers());
+		}
+		catch(CoreException e){
+			e.printStackTrace();
+		}
+		return true;
+
+	}
+
+	public DataModelVerifier createVerifier(WTPOperationDataModel model) {
+		DataModelVerifier verifier = null;
+		//String verifierClassName = null;
+		if (model != null) {
+			verifier = (DataModelVerifier) getDataModelVerifiersMap().get(model.getClass().getName());
+			/*if (verifierClassName != null) {
+				try {
+					//Class verifierClass = Class.forName(verifierClassName);
+					//verifier = (DataModelVerifier) verifierClass.newInstance();
+				} catch (Exception e) {
+				}
+			}*/
+			if (verifier == null) {
+				Assert.fail("No Verifier for model:" + model.getClass().getName());
+			}
+		}
+		return verifier;
+	}
+	
+	protected void addToDataModelVerifiersMap(Map dataModelVerifiers){
+		if (dataModelVerifiersMap == null)
+			dataModelVerifiersMap = new HashMap();
+		dataModelVerifiersMap.putAll(dataModelVerifiers);
+	}
+	
+	/**
+	 * @return Returns the dataModelVerifiersMap.
+	 */
+	protected Map getDataModelVerifiersMap() {
+		if (dataModelVerifiersMap == null) {
+			dataModelVerifiersMap = new HashMap();
+		}
+		return dataModelVerifiersMap;
+	}
+	
+	  /*private void loadConfiguration() {
+        //TestCollectorPlugin plugin = TestCollectorPlugin.instance;
+	  	CommonTestsPlugin plugin = CommonTestsPlugin.instance;
+        IExtension[] dataModelVerifierExts = plugin.dataModelVerifierExt.getExtensions();
+
+        for (int i = 0; i < dataModelVerifierExts.length; i++) {
+            IExtension extension = dataModelVerifierExts[i];
+            IConfigurationElement[] factories = extension.getConfigurationElements();
+            for (int j = 0; j < factories.length; j++) {
+                try {
+                    IConfigurationElement element = factories[j];
+                    DataModelVerifierList list = (DataModelVerifierList)element.createExecutableExtension("listClass");
+                    //ClassLoader classLoader = (ClassLoader) extension.getDeclaringPluginDescriptor().getPluginClassLoader();
+                    //DataModelVerifierList list = (DataModelVerifierList) classLoader.loadClass(factoryClass).newInstance();
+                    addToDataModelVerifiersMap(list.getDataModelVerifiers());
+                } catch (Exception e) {
+                    e.printStackTrace();
+                }
+            }
+        }
+    }*/
+
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierList.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierList.java
new file mode 100644
index 0000000..dc822e0
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierList.java
@@ -0,0 +1,21 @@
+/*
+ * Created on Dec 6, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.eclipse.wst.common.tests;
+
+import java.util.Map;
+
+/**
+ * @author eteration
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public abstract class DataModelVerifierList {
+	
+	public abstract Map getDataModelVerifiers();
+
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/LogUtility.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/LogUtility.java
new file mode 100644
index 0000000..f3d028e
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/LogUtility.java
@@ -0,0 +1,96 @@
+/*
+ * Created on Jun 30, 2003
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.eclipse.wst.common.tests;
+
+import java.util.ArrayList;
+
+import org.eclipse.core.runtime.ILogListener;
+import org.eclipse.core.runtime.IStatus;
+
+/**
+ * @author jsholl
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class LogUtility implements ILogListener {
+
+    private static LogUtility instance = new LogUtility();
+    private ArrayList loggedMessages = new ArrayList();
+    private boolean logging = false;
+
+    private LogUtility() {
+        registerPlugins();
+    }
+
+    private void registerPlugins() {
+//      TODO DCB Disable for now due to other plugins failing.
+//        IPluginRegistry registry = Platform.getPluginRegistry();
+//        IPluginDescriptor[] descriptors = registry.getPluginDescriptors();
+//        for (int i = 0; i < descriptors.length; i++) {
+//            try {
+//                Plugin plugin = descriptors[i].getPlugin();
+//                ILog log = plugin.getLog();
+//                log.addLogListener(this);
+//            } catch (Exception e) {
+//            }
+//        }
+    }
+
+    public static LogUtility getInstance() {
+        return instance;
+    }
+
+    public void clearLogs() {
+        loggedMessages.clear();
+    }
+
+    public void resetLogging() {
+        stopLogging();
+        clearLogs();
+        startLogging();
+    }
+
+    public void startLogging() {
+        logging = true;
+    }
+
+    public void stopLogging() {
+        logging = false;
+    }
+
+    public void verifyNoWarnings() {
+    	//TODO DCB Disable for now due to other plugins failing.
+//        String warnings = "";
+//        for (int i = 0; i < loggedMessages.size(); i++) {
+//            IStatus status = (IStatus) loggedMessages.get(i);
+//            if (status.getSeverity() == IStatus.WARNING || status.getSeverity() == IStatus.ERROR) {
+//                warnings += "\nLogUtility: " + ((status.getSeverity() == IStatus.WARNING) ? "WARNING " : "ERROR ");
+//                warnings += "\nFrom plugin: " + ((null != status.getPlugin()) ? status.getPlugin() : "null");
+//                warnings += "\nMessage: " + ((null != status.getMessage()) ? status.getMessage() : "null");
+//                warnings += "\nStack:\n";
+//                try {
+//                    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
+//                    status.getException().printStackTrace(new PrintStream(outputStream));
+//                    warnings += outputStream.toString();
+//                } catch (Exception e) {
+//                    warnings += " Stack not available";
+//                }
+//
+//            }
+//        }
+//        if (!warnings.equals("")) {
+//            Assert.fail(warnings);
+//        }
+    }
+
+    public void logging(IStatus status, String plugin) {
+        if (logging) {
+            loggedMessages.add(status);
+        }
+    }
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/OperationTestCase.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/OperationTestCase.java
new file mode 100644
index 0000000..68080db
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/OperationTestCase.java
@@ -0,0 +1,139 @@
+/*
+ * Created on Nov 6, 2003
+ * 
+ * To change the template for this generated file go to Window&gt;Preferences&gt;Java&gt;Code Generation&gt;Code and
+ * Comments
+ */
+package org.eclipse.wst.common.tests;
+
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IWorkspaceDescription;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
+
+
+/**
+ * @author jsholl
+ * 
+ * To change the template for this generated type comment go to Window&gt;Preferences&gt;Java&gt;Code
+ * Generation&gt;Code and Comments
+ */
+public abstract class OperationTestCase extends BaseTestCase {
+
+	public static String fileSep = System.getProperty("file.separator"); //$NON-NLS-1$
+
+    public static IStatus OK_STATUS = new Status(IStatus.OK, "com.ibm.wtp.common", 0, "OK", null); //$NON-NLS-1$ //$NON-NLS-2$
+
+    //public abstract void testBVT() throws Exception;
+    
+    protected void setUp() throws Exception {
+        super.setUp();
+        ProjectUtility.deleteAllProjects();
+        //LogUtility.getInstance().resetLogging();
+    }
+
+    public OperationTestCase() {
+        super("OperationsTestCase"); //$NON-NLS-1$
+    }
+
+    public OperationTestCase(String name) {
+        super(name);
+    }
+
+    public static void runAndVerify(WTPOperationDataModel dataModel) throws Exception {
+        OperationTestCase.runAndVerify(dataModel, true, true);
+    }
+
+    public static void runAndVerify(WTPOperationDataModel dataModel, boolean checkTasks, boolean checkLog) throws Exception {
+        runAndVerify(dataModel,checkTasks,checkLog,null,true,false);
+    }
+    
+    public static void runAndVerify(WTPOperationDataModel dataModel, boolean checkTasks, boolean checkLog, boolean waitForBuildToComplete) throws Exception {
+        runAndVerify(dataModel,checkTasks,checkLog,null,true,waitForBuildToComplete);
+    }
+    
+    public static void runAndVerify(WTPOperationDataModel dataModel, boolean checkTasks, boolean checkLog,List errorOKList, boolean reportIfExpectedErrorNotFound) throws Exception {
+        runAndVerify(dataModel,checkTasks,checkLog,errorOKList,reportIfExpectedErrorNotFound,false);
+    }
+    
+    public static void runAndVerify(WTPOperationDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound, boolean waitForBuildToComplete) throws Exception {
+        runAndVerify(dataModel,checkTasks,checkLog,errorOKList,reportIfExpectedErrorNotFound,false,false);
+    }
+    
+    /**
+     * Guaranteed to close the dataModel
+     * 
+     * @param dataModel
+     * @throws Exception
+     */
+    public static void runAndVerify(WTPOperationDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound, boolean waitForBuildToComplete, boolean removeAllSameTypesOfErrors) throws Exception {
+        PostBuildListener listener = null;
+        IWorkspaceDescription desc = null;
+        try {
+            if (waitForBuildToComplete){
+                listener = new PostBuildListener();
+                desc = ResourcesPlugin.getWorkspace().getDescription();
+                desc.setAutoBuilding(false);
+                ResourcesPlugin.getWorkspace().addResourceChangeListener(listener,IResourceChangeEvent.POST_BUILD);
+            }
+        	if (checkLog)
+        		LogUtility.getInstance().resetLogging();
+            verifyValidDataModel(dataModel);
+            dataModel.getDefaultOperation().run(null);
+            verifyDataModel(dataModel);
+            if (waitForBuildToComplete){
+            	desc.setAutoBuilding(true);
+	            while (!listener.isBuildComplete()){
+	              Thread.sleep(3000);//do nothing till all the jobs are completeled  
+	            }
+            }
+            if (checkTasks && (errorOKList == null || errorOKList.isEmpty())) {
+                checkTasksList();
+            }
+            else if (checkTasks && errorOKList != null && !errorOKList.isEmpty()){
+                TaskViewUtility.verifyErrors(errorOKList,reportIfExpectedErrorNotFound,removeAllSameTypesOfErrors);
+            }
+            if (checkLog) {
+                checkLogUtility();
+            }
+        } finally {
+            if (listener != null)
+                ResourcesPlugin.getWorkspace().removeResourceChangeListener(listener);
+            dataModel.dispose();
+        }
+    }
+
+    public static void verifyDataModel(WTPOperationDataModel dataModel) throws Exception{
+        DataModelVerifier verifier = DataModelVerifierFactory.getInstance().createVerifier(dataModel);
+        verifier.verify(dataModel);
+    }
+
+    protected static void checkLogUtility() {
+       LogUtility.getInstance().verifyNoWarnings();
+    }
+
+    protected static void checkTasksList() {
+        TaskViewUtility.verifyNoErrors();
+    }
+
+    public static void verifyValidDataModel(WTPOperationDataModel dataModel) {
+        IStatus status = dataModel.validateDataModel();
+        
+        if (!status.isOK() && status.getSeverity() == IStatus.ERROR) {
+            Assert.assertTrue("DataModel is invalid operation will not run:" + status.toString(), false); //$NON-NLS-1$
+        }
+    }
+
+    public static void verifyInvalidDataModel(WTPOperationDataModel dataModel) {
+        IStatus status = dataModel.validateDataModel();
+        if (status.isOK()) {
+            Assert.assertTrue("DataModel should be invalid:" + status.getMessage(), false); //$NON-NLS-1$
+        }
+    }
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PostBuildListener.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PostBuildListener.java
new file mode 100644
index 0000000..3db4657
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PostBuildListener.java
@@ -0,0 +1,36 @@
+/*
+ * Created on Oct 20, 2004
+ *
+ * TODO To change the template for this generated file go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+package org.eclipse.wst.common.tests;
+
+import org.eclipse.core.resources.IResourceChangeEvent;
+import org.eclipse.core.resources.IResourceChangeListener;
+
+/**
+ * @author nirav
+ *
+ * TODO To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Style - Code Templates
+ */
+public class PostBuildListener implements IResourceChangeListener {
+    private boolean buildComplete = false;
+    /* (non-Javadoc)
+     * @see org.eclipse.core.resources.IResourceChangeListener#resourceChanged(org.eclipse.core.resources.IResourceChangeEvent)
+     */
+    public void resourceChanged(IResourceChangeEvent event) {
+        if (event.getType() == IResourceChangeEvent.POST_BUILD){
+          buildComplete = true;  
+        }
+    }
+
+    public boolean isBuildComplete() {
+        return buildComplete;
+    }
+    
+    public void testComplete() {
+        buildComplete = false;
+    }
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/ProjectUtility.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/ProjectUtility.java
new file mode 100644
index 0000000..c7b535f
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/ProjectUtility.java
@@ -0,0 +1,182 @@
+package org.eclipse.wst.common.tests;
+import java.io.File;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collections;
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.Path;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Plugin;
+/**
+ * @author jsholl
+ * 
+ * To change this generated comment edit the template variable "typecomment": Window>Preferences>Java>Templates. To
+ * enable and disable the creation of type comments go to Window>Preferences>Java>Code Generation.
+ */
+public class ProjectUtility {
+    public static IProject[] getAllProjects() {
+        return ResourcesPlugin.getWorkspace().getRoot().getProjects();
+    }
+    public static boolean projectExists(String projectName) {
+        return getProject(projectName) != null;
+    }
+    public static IProject verifyAndReturnProject(String projectName, boolean exists) {
+        IProject project = getProject(projectName);
+        if (exists) {
+            Assert.assertTrue("Project Does Not Exist:" + projectName, project.exists());
+        } else {
+            Assert.assertTrue("Project Exists:" + projectName, !project.exists());
+        }
+        return project;
+    }
+    public static void verifyProject(String projectName, boolean exists) {
+        IProject project = getProject(projectName);
+        if (exists) {
+            Assert.assertTrue("Project Does Not Exist:" + projectName, project.exists());
+        } else {
+            Assert.assertTrue("Project Exists:" + projectName, !project.exists());
+        }
+    }
+    public static IProject getProject(String projectName) {
+        IWorkspace workspace = ResourcesPlugin.getWorkspace();
+        String pathString = projectName;
+        if (!(workspace.getRoot().getProject(pathString) == null))
+            return workspace.getRoot().getProject(pathString);
+        else
+            return null;
+    }
+    public static void verifyNoProjects() {
+        IProject[] projects = getAllProjects();
+        String projectNames = "";
+        for (int i = 0; i < projects.length; i++) {
+            projectNames += " " + projects[i].getName();
+        }
+        Assert.assertTrue("All projects not deleted" + projectNames, projects.length == 0);
+    }
+    public static void deleteProjectIfExists(String projectName) {
+        if (projectName == null)
+            return;
+        IProject project = getProject(projectName);
+        if (project != null && project.isAccessible()) {
+            try {
+                project.close(null);
+                project.delete(true, true, null);
+                ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
+            } catch (Exception e) {
+                Assert.fail(e.getMessage());
+            }
+        }
+    }
+    public static void deleteAllProjects() throws Exception {
+        //closing projects and tread work in here is a hack because of a BeanInfo bug holding
+        //onto jars loaded in another VM
+        IProject[] projects = getAllProjects();
+        for (int i = 0; i < projects.length; i++) {
+            if (projects[i].exists()) {
+                projects[i].close(null); // This should signal the extra VM to kill itself
+            }
+        }
+        Thread.yield(); // give the VM a chance to die
+        for (int i = 0; i < projects.length; i++) {
+            IProject project = projects[i];
+            boolean success = false;
+            Exception lastException = null;
+            //Don't make 2^12 is about 4 seconds which is the max we will wait for the VM to die
+            for (int j = 0; j < 13 && !success; j++) {
+                try {
+                    if (project.exists()) {
+                        project.delete(true, true, null);
+                        ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
+                    }
+                    success = true;
+                } catch (Exception e) {
+                    lastException = e;
+                    if (project.exists()) {
+                    	try{
+	                        project.open(null);
+	                        project.close(null);
+                    	} catch(Exception e2){
+                    	}
+                    }
+                    Thread.sleep((int) Math.pow(2, j)); // if the VM isn't dead, try sleeping
+                }
+            }
+            if (!success && lastException != null) {
+                lastException.printStackTrace();
+                Assert.fail("Caught Exception=" + lastException.getMessage() + " when deleting project=" + project.getName());
+            }
+        }
+        verifyNoProjects();
+    }
+    /**
+     * Return the absolute path Strings to the files based on the fileSuffix and path within the plugin.
+     * 
+     * @param path
+     * @param fileSuffix
+     *            the file ending with the "." if required (the suffix will be used as is)
+     * @return
+     */
+    public static List getSpecificFilesInDirectory(Plugin plugin, String path, final String fileSuffix) {
+        URL entry = null; 
+            entry = plugin.getBundle().getEntry(path); 
+        List result = null;
+        File folder = null;
+        if (entry != null) {
+            try {
+                entry = Platform.asLocalURL(entry);
+                folder = new File(new URI(entry.toString()));
+            } catch (Exception e1) {
+                e1.printStackTrace();
+                return Collections.EMPTY_LIST;
+            }
+            List files = Arrays.asList(folder.list());
+            if (!files.isEmpty()) {
+                String folderPath = folder.getAbsolutePath() + "\\";
+                result = new ArrayList();
+                for (int i = 0; i < files.size(); i++) {
+                    String fileName = (String) files.get(i);
+                    if (!fileName.endsWith(fileSuffix))
+                        continue;
+                    result.add(folderPath + fileName);
+                }
+            }
+        }
+        if (result == null)
+            result = Collections.EMPTY_LIST;
+        return result;
+    }
+    public static List getJarsInDirectory(Plugin plugin, String path) {
+        return getSpecificFilesInDirectory(plugin, path, ".jar");
+    }
+    public static List getRarsInDirectory(Plugin plugin, String path) {
+        return getSpecificFilesInDirectory(plugin, path, ".rar");
+    }
+    public static List getEarsInDirectory(Plugin plugin, String path) {
+        return getSpecificFilesInDirectory(plugin, path, ".ear");
+    }
+    public static List getWarsInDirectory(Plugin plugin, String path) {
+        return getSpecificFilesInDirectory(plugin, path, ".war");
+    }
+    public static String getFullFileName(Plugin plugin, String pluginRelativeFileName) throws IOException {
+        IPath path = new Path(pluginRelativeFileName);
+        if (path.getDevice() != null)
+            return pluginRelativeFileName;
+        URL url = plugin.getBundle().getEntry(pluginRelativeFileName);
+        if (url != null) {
+            url = Platform.asLocalURL(url);
+            return url.getPath().substring(1);
+        }
+        return null;
+    }
+}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/SimpleTestSuite.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/SimpleTestSuite.java
new file mode 100644
index 0000000..5fe16e6
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/SimpleTestSuite.java
@@ -0,0 +1,31 @@
+/*
+ * Created on Feb 2, 2004
+ *
+ * To change the template for this generated file go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+package org.eclipse.wst.common.tests;
+
+import junit.framework.TestSuite;
+
+/**
+ * @author jsholl
+ *
+ * To change the template for this generated type comment go to
+ * Window - Preferences - Java - Code Generation - Code and Comments
+ */
+public class SimpleTestSuite extends TestSuite {
+
+    public SimpleTestSuite(Class theClass) {
+        super(theClass, getShortName(theClass));
+    }
+
+    public static String getShortName(Class c){
+        String name = c.getName();
+        if(name.lastIndexOf('.') > 0){
+            name = name.substring(name.lastIndexOf('.')+1);
+        }
+        return name;
+    }
+    
+}
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/TaskViewUtility.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/TaskViewUtility.java
new file mode 100644
index 0000000..1bcf5e3
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/TaskViewUtility.java
@@ -0,0 +1,194 @@
+package org.eclipse.wst.common.tests;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+
+import junit.framework.Assert;
+
+import org.eclipse.core.resources.IMarker;
+import org.eclipse.core.resources.IResource;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.CoreException;
+
+/**
+ * @author jsholl
+ *
+ * To change this generated comment edit the template variable "typecomment":
+ * Window>Preferences>Java>Templates.
+ * To enable and disable the creation of type comments go to
+ * Window>Preferences>Java>Code Generation.
+ */
+public class TaskViewUtility {
+
+    public static IResource getWorkspaceRoot() {
+        return ResourcesPlugin.getWorkspace().getRoot();
+    }
+
+    public static void verifyNoNewTasks(HashSet hashSet) {
+        verifyNoNewTasks(null, hashSet);
+    }
+
+    public static void verifyNoNewTasks(IResource resource, HashSet hashSet) {
+        verifyNoNewTasksImpl(resource, hashSet, true);
+    }
+
+    private static void verifyNoNewTasksImpl(IResource resource, HashSet hashSet, boolean failOnFailure) {
+        IResource markerSource = resource == null ? getWorkspaceRoot() : resource;
+        IMarker[] markers = null;
+        try {
+            markers = markerSource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
+        } catch (CoreException e1) {
+            e1.printStackTrace();
+            Assert.fail();
+        }
+        for (int j = 0; markers != null && j < markers.length; j++) {
+            String message = markers[j].toString();
+            try {
+                message = (String) markers[j].getAttribute(IMarker.MESSAGE);
+            } catch (Exception e) {
+            }
+
+            if (null == hashSet) {
+                String failMsg = "Task in Tasks List: " + message;
+                if (failOnFailure) {
+                    Assert.fail(failMsg);
+                } else {
+                    System.out.println(failMsg);
+                }
+            } else if (!hashSet.contains(markers[j])) {
+                String failMsg = "New Task in Tasks List: " + message;
+                if (failOnFailure) {
+                    Assert.fail(failMsg);
+                } else {
+                    System.out.println(failMsg);
+                }
+
+            }
+        }
+    }
+
+    public static void verifyNoErrors() {
+        verifyNoErrors(null);
+    }
+
+    public static void verifyNoErrors(IResource resource) {
+        List markers = getErrors(resource);
+        if (null != markers && markers.size() > 0) {
+            int size = markers.size();
+            String message = "" + size + " errors in tasks view:";
+            IMarker marker;
+            for (int i = 0; i < size; i++) {
+                marker = (IMarker) markers.get(i);
+                try {
+                    message += "\n" + i + " " + (String) marker.getAttribute(IMarker.MESSAGE);
+                } catch (Exception e) {
+                }
+            }
+            Assert.fail(message);
+        }
+    }
+
+    /**
+	 * @param resource
+	 * @return
+	 */
+	public static List getErrors(IResource resource) {
+		IResource markerSource = resource == null ? getWorkspaceRoot() : resource;
+        List markers = null;
+        try {
+            markers = findSeverityMarkers(markerSource, IMarker.SEVERITY_ERROR);
+        } catch (CoreException e1) {
+            e1.printStackTrace();
+        }
+		return markers;
+	}
+
+	private static List findSeverityMarkers(IResource markerSource, int severityLevel) throws CoreException {
+        IMarker[] markers = markerSource.findMarkers(IMarker.PROBLEM, true, IResource.DEPTH_INFINITE);
+        List results = null;
+        Integer severity;
+        for (int i = 0; i < markers.length; i++) {
+            severity = (Integer) markers[i].getAttribute(IMarker.SEVERITY);
+            if (severity.intValue() == severityLevel) {
+                if (results == null)
+                    results = new ArrayList();
+                results.add(markers[i]);
+            }
+        }
+        if (results == null)
+            results = Collections.EMPTY_LIST;
+        return results;
+    }
+
+    public static void verifyNoWarnings() {
+
+    }
+
+    public static void verifyNoTasks() {
+        verifyNoTasks(null);
+    }
+
+    public static void verifyNoTasks(IResource resource) {
+        verifyNoNewTasksImpl(resource, null, true);
+    }
+
+    public static void verifyNoTasks(boolean failOnFailure) {
+        verifyNoTasks(null, failOnFailure);
+    }
+
+    public static void verifyNoTasks(IResource resource, boolean failOnFailure) {
+        verifyNoNewTasksImpl(resource, null, failOnFailure);
+    }
+    public static void verifyErrors(List markerDescriptionsExpected) {
+        verifyErrors(markerDescriptionsExpected,true,false);
+    }
+
+    
+    public static void verifyErrors(List markerDescriptionsExpected, boolean reportIfExpectedErrorNotFound, boolean removeAllSameTypesOfError) {
+        List markerDescriptionsFound = null;
+        try {
+            List markersFound = findSeverityMarkers(getWorkspaceRoot(), IMarker.SEVERITY_ERROR);
+            markerDescriptionsFound = new ArrayList(markersFound.size());
+            for (int i = 0; i < markersFound.size(); i++) {
+                markerDescriptionsFound.add(((IMarker) markersFound.get(i)).getAttribute("message"));
+            }
+        } catch (CoreException e1) {
+            e1.printStackTrace();
+            Assert.fail();
+        }
+
+        ArrayList markerDescriptionsNotFound = new ArrayList();
+        List markersDescriptionsToRemove = new ArrayList();
+        for (int i = 0; i < markerDescriptionsExpected.size(); i++) {
+        	String messageToFind = (String)markerDescriptionsExpected.get(i);
+        	boolean found = false;
+        	for(int j=0;j<markerDescriptionsFound.size() &&(!found || removeAllSameTypesOfError);j++){
+        		if(messageToFind.equals(markerDescriptionsFound.get(j))){
+        			found = true;
+        			markersDescriptionsToRemove.add(markerDescriptionsFound.get(j));
+        		}
+            }
+        	if (!found) {
+                markerDescriptionsNotFound.add(messageToFind);
+            } 
+        }
+        markerDescriptionsFound.removeAll(markersDescriptionsToRemove);
+        if (markerDescriptionsNotFound.size() > 0 || markerDescriptionsFound.size() > 0) {
+            String messages = "";
+            if (reportIfExpectedErrorNotFound){
+	            for (int i = 0; i < markerDescriptionsNotFound.size(); i++) {
+	                messages += "\nError not found:\"" + markerDescriptionsNotFound.get(i)+"\"";
+	            }
+            }
+            for (int i = 0; i < markerDescriptionsFound.size(); i++) {
+                messages += "\nUnexpected error found:\"" + markerDescriptionsFound.get(i)+"\"";
+            }
+            if (!messages.equals(""))
+                Assert.fail(messages);
+        }
+
+    }
+}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/WindowUtility.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/WindowUtility.java
new file mode 100644
index 0000000..9edc779
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/WindowUtility.java
@@ -0,0 +1,43 @@
+/*
+ * Created on Jun 5, 2003
+ *
+ * To change the template for this generated file go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+package org.eclipse.wst.common.tests;
+
+
+/**
+ * @author jsholl
+ *
+ * To change the template for this generated type comment go to
+ * Window>Preferences>Java>Code Generation>Code and Comments
+ */
+public class WindowUtility {
+
+//    public static void closeAllOpenWindows() {
+//        IWorkbench workbench = WorkbenchPlugin.getDefault().getWorkbench();
+//        IWorkbenchWindow[] windows = workbench.getWorkbenchWindows();
+//
+//        for (int i = 0; i < windows.length; i++) {
+//            final IWorkbenchWindow window = windows[i];
+//            final Shell shell = window.getShell();
+//            shell.getDisplay().syncExec(new Runnable() {
+//                public void run() {
+//                    Shell[] otherShells = shell.getDisplay().getShells();
+//                    //this can be imporoved, but basically this is to work out shell dependencies.
+//                    for (int j = 0; j < otherShells.length; j++) {
+//                        //step through shells backwards in case one shell opens another -- this is how they are usually odered
+//                        for (int i = otherShells.length - 1; i > 0; i--) {
+//                        	int index = (i+j) % otherShells.length; // mix things up a little to work out shell dependencies
+//                            if (otherShells[index] != shell && otherShells[index].isVisible() && !otherShells[index].isDisposed()) {
+//                                otherShells[index].close();
+//                            }
+//                        }
+//                    }
+//                }
+//            });
+//        }
+//    }
+
+}
diff --git a/tests/org.eclipse.wst.common.tests/plugin.xml b/tests/org.eclipse.wst.common.tests/plugin.xml
new file mode 100644
index 0000000..eb116ee
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/plugin.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.0"?>
+<plugin
+   id="org.eclipse.wst.common.tests"
+   name="org.eclipse.wst.common.tests"
+   version="1.0.0"
+   provider-name="IBM"
+   class="org.eclipse.wst.common.tests.CommonTestsPlugin">
+
+   <runtime>
+      <library name="commontests.jar">
+         <export name="*"/>
+      </library>
+   </runtime>
+   <requires>
+      <import plugin="org.junit" export="true"/>
+      <import plugin="org.apache.ant" export="true"/>
+      <import plugin="org.eclipse.core.resources" export="true"/>
+      <import plugin="org.eclipse.core.boot" export="true"/>
+      <import plugin="org.eclipse.core.runtime.compatibility"/>
+      <import plugin="org.eclipse.wst.common.frameworks"/>
+   </requires>
+   <extension-point id="DataModelVerifier" name="Data Model Verifier Factory Extension" schema="schema/dataModelVerifier.exsd"/>
+
+
+</plugin>
diff --git a/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd b/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd
new file mode 100644
index 0000000..96228a5
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd
@@ -0,0 +1,98 @@
+<?xml version='1.0' encoding='UTF-8'?>
+<!-- Schema file written by PDE -->
+<schema targetNamespace="org.eclipse.wst.common.tests">
+<annotation>
+      <appInfo>
+         <meta.schema plugin="org.eclipse.wst.common.tests" id="dataModelVerifier" name="Data Model Verifier Factory Extension"/>
+      </appInfo>
+      <documentation>
+         [Enter description of this extension point.]
+      </documentation>
+   </annotation>
+
+   <element name="extension">
+      <complexType>
+         <sequence>
+         </sequence>
+         <attribute name="point" type="string" use="required">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="id" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+         <attribute name="name" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <element name="dataModelVeriferList">
+      <complexType>
+         <attribute name="listClass" type="string">
+            <annotation>
+               <documentation>
+                  
+               </documentation>
+            </annotation>
+         </attribute>
+      </complexType>
+   </element>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="since"/>
+      </appInfo>
+      <documentation>
+         [Enter the first release in which this extension point appears.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="examples"/>
+      </appInfo>
+      <documentation>
+         [Enter extension point usage example here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="apiInfo"/>
+      </appInfo>
+      <documentation>
+         [Enter API information here.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="implementation"/>
+      </appInfo>
+      <documentation>
+         [Enter information about supplied implementation of this extension point.]
+      </documentation>
+   </annotation>
+
+   <annotation>
+      <appInfo>
+         <meta.section type="copyright"/>
+      </appInfo>
+      <documentation>
+         
+      </documentation>
+   </annotation>
+
+</schema>
diff --git a/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml b/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml
new file mode 100644
index 0000000..7d83766
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application id="Application_ID">
+	<display-name>test</display-name>
+	<module id="JavaClientModule_1049139849772">
+		<java>testClient.jar</java>
+	</module>
+	<module id="EjbModule_1049139849782">
+		<ejb>testEJB.jar</ejb>
+	</module>
+	<module id="WebModule_1049139849812">
+		<web>
+			<web-uri>testWeb.war</web-uri>
+			<context-root>testWeb</context-root>
+		</web>
+	</module>
+</application>
+
diff --git a/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_01.xml b/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_01.xml
new file mode 100644
index 0000000..179c62e
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_01.xml
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application id="Application_ID">
+	<display-name>test</display-name><module id="JavaClientModule_1049139849772"><java>testClient.jar</java></module>
+	<module id="EjbModule_1049139849782"><ejb>testEJB.jar</ejb></module><module id="WebModule_1049139849812"><web><web-uri>testWeb.war</web-uri><context-root>testWeb</context-root></web></module></application>
+
diff --git a/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_02.xml b/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_02.xml
new file mode 100644
index 0000000..8bff745
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_02.xml
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application id="Application_ID
+">  <!-- a comment to ignore
+
+
+
+    -->
+	<display-name>
+    test</display-name><module id="
+    JavaClientModule_1049139849772
+    "><java>testClient.jar</java></module><!-- a comment to ignore -->
+	<module id="EjbModule_1049139849782"><ejb>testEJB.jar</ejb></module><module id="WebModule_1049139849812
+    "><web><web-uri>testWeb.war</web-uri><context-root>testWeb</context-root></web></module></application>
+       <!-- a comment to ignore -->
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_01.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_01.xml
new file mode 100644
index 0000000..7d1040c
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_01.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application id="Application_ID">
+	<display-name>test</display-name>
+	<module id="JavaClientModule_104913984977">
+		<java>testClient.jar</java>
+	</module>
+	<module id="EjbModule_1049139849782">
+		<ejb>testEJB.jar</ejb>
+	</module>
+	<module id="WebModule_1049139849812">
+		<web>
+			<web-uri>testWeb.war</web-uri>
+			<context-root>testWeb</context-root>
+		</web>
+	</module>
+</application>
+
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_02.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_02.xml
new file mode 100644
index 0000000..c6ea028
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_02.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application id="Application_ID">
+	<display-name>test</display-name>
+	<module id="JavaClientModule_1049139849772">
+		<java>testClient.jar</java>
+	</module>
+	<module id="EjbModule_1049139849782">
+		<ejb>testEJB.jar</ejb>
+	</module>
+	<module id="WebModule_1049139849812">
+		<web>
+			<context-root>testWeb</context-root>
+		</web>
+	</module>
+</application>
+
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_03.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_03.xml
new file mode 100644
index 0000000..1f29c2e
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_03.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application id="Application_ID">
+	<display-name>test</display-name>
+	<module id="JavaClientModule_1049139849772">
+		<java>testClient.jar</java>
+	</module>
+	<module id="EjbModule_1049139849782">
+		<ejb>testEJB</ejb>
+	</module>
+	<module id="WebModule_1049139849812">
+		<web>
+			<web-uri>testWeb.war</web-uri>
+			<context-root>testWeb</context-root>
+		</web>
+	</module>
+</application>
+
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_04.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_04.xml
new file mode 100644
index 0000000..840bd03
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_04.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application id="Application_ID">
+	<display-name>test</display-name>
+	<module id="JavaClientModule_1049139849772">
+		<java>testClient.jar</java>
+	</module>
+	<module id="EjbModule_1049139849782">
+		<ejb>testEJB.jar</ejb>
+	</module>
+	<module id="WebModule_1049139849812">
+		<web>
+			<web-uri>testWeb.war</web-uri>
+			<context-root>testWeb</context-root>
+		</web>
+	</module>
+</application>
+
diff --git a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_05.xml b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_05.xml
new file mode 100644
index 0000000..ac6b8bf
--- /dev/null
+++ b/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_05.xml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-"?>
+<!DOCTYPE application PUBLIC "-//Sun Microsystems, Inc.//DTD J2EE Application 1.3//EN" "http://java.sun.com/dtd/application_1_3.dtd">
+<application id="Application_ID">
+	<display-name>test</display-name>
+	<module id="JavaClientModule_1049139849772">
+		<java>testClient.jar</java>
+	</module>
+	<module id="EjbModule_1049139849782">
+		<ejb>testEJB.jar</ejb>
+	</module>
+	<module id="WebModule_1049139849812">
+		<web>
+			<web-uri>testWeb.war</web-uri>
+			<context-root>testWeb</context-root>
+		</web>
+	</module>
+</application>
