adding common tests
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>Preferences>Java>Code Generation>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>Preferences>Java>Code Generation>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>Preferences>Java>Code Generation>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>Preferences>Java>Code
+ * Generation>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>