This commit was manufactured by cvs2svn to create tag 'v20050613_1730'.
diff --git a/tests/org.eclipse.wst.common.tests.collector/.classpath b/tests/org.eclipse.wst.common.tests.collector/.classpath
deleted file mode 100644
index 74cb0c8..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="collector"/>
- <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.collector/.cvsignore b/tests/org.eclipse.wst.common.tests.collector/.cvsignore
deleted file mode 100644
index c5e82d7..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests.collector/.project b/tests/org.eclipse.wst.common.tests.collector/.project
deleted file mode 100644
index 5b816ca..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/.project
+++ /dev/null
@@ -1,29 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.tests.collector</name>
- <comment></comment>
- <projects>
- <project>org.junit</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.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.common.tests.collector/build.properties b/tests/org.eclipse.wst.common.tests.collector/build.properties
deleted file mode 100644
index b0d96d8..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/build.properties
+++ /dev/null
@@ -1,5 +0,0 @@
-bin.includes = plugin.xml,\
- runtime/collector.jar
-source.runtime/collector.jar = collector/
-src.includes = plugin.xml
-output.runtime/collector.jar = bin/
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteHelper.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteHelper.java
deleted file mode 100644
index 718d7b4..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteHelper.java
+++ /dev/null
@@ -1,140 +0,0 @@
-package org.eclipse.wst.common.tests.collector;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * @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 SuiteHelper {
-
- private Hashtable allTests = new Hashtable();
-
- public SuiteHelper(TestSuite suite) {
- addTest(suite);
- }
-
- private void addTest(Test test) {
- if (test instanceof TestSuite) {
- Enumeration tests = ((TestSuite) test).tests();
- while (tests.hasMoreElements()) {
- Test t = (Test) tests.nextElement();
- allTests.put(t.toString(), t);
- }
- return;
- }
- allTests.put(test.toString(), test);
- }
-
- public String[] getAllTests() {
- ArrayList testList = new ArrayList();
- Enumeration enumeration = allTests.keys();
- while (enumeration.hasMoreElements()) {
- testList.add(enumeration.nextElement());
- }
- Collections.sort(testList, new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((String) o1).compareTo(((String) o2));
- }
- });
-
- String[] strArray = new String[testList.size()];
- for (int i = 0; i < strArray.length; i++) {
- strArray[i] = (String) testList.get(i);
- }
-
- return strArray;
- }
-
- public TestSuite buildSuite(String[] completeTests, String[] partialTests) {
- TestSuite suite = new TestSuite();
- for (int i = 0; i < completeTests.length; i++) {
- suite.addTest((Test) allTests.get(completeTests[i]));
- }
- for (int i = 0; i < partialTests.length; i++) {
- suite.addTest(getTest(partialTests[i]));
- }
- return suite;
- }
-
- public String[] getTestMethods(String testName) {
- ArrayList methodList = new ArrayList();
- Test test = (Test) allTests.get(testName);
- if (test instanceof TestSuite) {
- Enumeration testsEnum = ((TestSuite) test).tests();
- while (testsEnum.hasMoreElements()) {
- Test t = (Test) testsEnum.nextElement();
- methodList.add(t.toString());
- }
- }
-
- Collections.sort(methodList, new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((String) o1).compareTo(((String) o2));
- }
- });
-
- String[] strArray = new String[methodList.size()];
- for (int i = 0; i < strArray.length; i++) {
- strArray[i] = (String) methodList.get(i);
- }
-
- return strArray;
- }
-
- private Test getSubTest(TestSuite suite, String testName) {
- if (null != suite) {
- Enumeration tests = suite.tests();
- while (tests.hasMoreElements()) {
- Test t = (Test) tests.nextElement();
- if (t.toString().equals(testName)) {
- return t;
- }
- }
- }
- return null;
- }
-
- /**
- * Returns a TestSuite to run
- */
- private Test getTest(String testName) {
- int firstIndex = testName.indexOf(".");
- String suiteName = testName.substring(0, firstIndex);
- String subTestName = testName.substring(firstIndex + 1);
-
- //check the obvious suite first
- TestSuite suite = (TestSuite) allTests.get(suiteName);
- Test test = getSubTest(suite, subTestName);
- if (test != null) {
- return test;
- }
- //otherwise check all suites
- Enumeration keys = allTests.keys();
- while (keys.hasMoreElements()) {
- String key = (String) keys.nextElement();
- if (testName.startsWith(key)) {
- suite = (TestSuite) allTests.get(key);
- subTestName = testName.substring(key.length() + 1);
- test = getSubTest(suite, subTestName);
- if (test != null) {
- return test;
- }
- }
- }
-
- return null;
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteTestRunner.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteTestRunner.java
deleted file mode 100644
index 4f7b7c7..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/SuiteTestRunner.java
+++ /dev/null
@@ -1,56 +0,0 @@
-package org.eclipse.wst.common.tests.collector;
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.swingui.TestRunner;
-
-/**
- * @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 SuiteTestRunner extends TestRunner {
-
- private TestSuite suite;
-
- /**
- * PluginTestRunner constructor comment.
- */
- public SuiteTestRunner(TestSuite suiteToRun) {
- super();
- suite = suiteToRun;
- }
-
- /**
- * Only return the specified suite
- */
- public Test getTest(String suiteClassName) {
- return suite;
- }
-
- /**
- * called by the gui
- */
- public void launch() {
- start();
- }
-
- public void start() {
- String name = "dynamic test";
- fFrame = createUI(name);
- fFrame.pack();
- fFrame.setVisible(true);
- setSuite(name);
- runSuite();
- }
-
- /*
- * @see TestRunner#terminate()
- */
- public void terminate() {
- fFrame.dispose();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorActionDelegate.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorActionDelegate.java
deleted file mode 100644
index cffd76a..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorActionDelegate.java
+++ /dev/null
@@ -1,57 +0,0 @@
-package org.eclipse.wst.common.tests.collector;
-import org.eclipse.jface.action.IAction;
-import org.eclipse.jface.viewers.ISelection;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Shell;
-import org.eclipse.ui.IWorkbenchWindow;
-import org.eclipse.ui.IWorkbenchWindowActionDelegate;
-
-/**
- * @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 TestCollectorActionDelegate implements IWorkbenchWindowActionDelegate {
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#dispose()
- */
- public void dispose() {
- }
-
- /**
- * @see org.eclipse.ui.IWorkbenchWindowActionDelegate#init(IWorkbenchWindow)
- */
- public void init(IWorkbenchWindow window) {
- }
-
- /**
- * @see org.eclipse.ui.IActionDelegate#run(IAction)
- */
- public void run(IAction action) {
- Shell shell = new Shell();
- GridLayout gridLayout = new GridLayout();
- shell.setLayout(gridLayout);
- shell.setText("Test Collector");
- TestCollectorGUI testCollectorGUI = new TestCollectorGUI(shell, SWT.NULL);
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 1;
- testCollectorGUI.setLayoutData(gridData);
-
- shell.setSize(500, 500);
- shell.open();
- }
-
-
- /**
- * @see org.eclipse.ui.IActionDelegate#selectionChanged(IAction, ISelection)
- */
- public void selectionChanged(IAction action, ISelection selection) {
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorGUI.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorGUI.java
deleted file mode 100644
index 7f335e2..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorGUI.java
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * Created on Mar 6, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.tests.collector;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.Comparator;
-import java.util.Enumeration;
-import java.util.Hashtable;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.core.runtime.IExtension;
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.events.ModifyEvent;
-import org.eclipse.swt.events.ModifyListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Combo;
-import org.eclipse.swt.widgets.Composite;
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class TestCollectorGUI extends Composite implements ModifyListener {
-
- private TestCollectorInnerPanes innerPanes = null;
- private Combo combo = null;
-
- private Hashtable testSuites = new Hashtable();
- private Hashtable classLoaders = new Hashtable();
-
- /**
- * @param parent
- * @param style
- */
- public TestCollectorGUI(Composite parent, int style) {
- super(parent, style);
-
- loadConfiguration();
-
- createPartControl();
- }
-
- private void loadConfiguration() {
- TestCollectorPlugin plugin = TestCollectorPlugin.instance;
- IExtension[] suitesExtensions = plugin.suitesExtensionPoint.getExtensions();
-
- for (int i = 0; i < suitesExtensions.length; i++) {
- IExtension extension = suitesExtensions[i];
- IConfigurationElement[] tests = extension.getConfigurationElements();
- for (int j = 0; j < tests.length; j++) {
- try {
- IConfigurationElement element = tests[j];
- String suiteName = element.getAttribute("name");
- String suiteClass = element.getAttribute("class");
- testSuites.put(suiteName, suiteClass);
- classLoaders.put(suiteName, extension.getDeclaringPluginDescriptor().getPluginClassLoader());
- } catch (Exception e) {
- e.printStackTrace();
- }
- }
- }
- }
-
- public void createPartControl() {
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- setLayout(gridLayout);
-
- GridData gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalSpan = 1;
-
- combo = new Combo(this, SWT.READ_ONLY);
- Enumeration keys = testSuites.keys();
- ArrayList arrayList = new ArrayList();
- while (keys.hasMoreElements()) {
- arrayList.add(keys.nextElement());
- }
-
- Collections.sort(arrayList, new Comparator() {
- public int compare(Object o1, Object o2) {
- return ((String) o1).compareTo(((String) o2));
- }
- });
-
- for (int i = 0; i < arrayList.size(); i++) {
- combo.add((String) arrayList.get(i));
- }
- combo.setLayoutData(gridData);
- combo.addModifyListener(this);
- if (combo.getItemCount() > 0) {
- combo.select(0);
- }
- }
-
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.swt.events.ModifyListener#modifyText(org.eclipse.swt.events.ModifyEvent)
- */
- public void modifyText(ModifyEvent e) {
- if (e.getSource() == combo) {
- updateCombo(e);
- }
- }
-
- private void updateCombo(ModifyEvent e) {
- if (null != innerPanes) {
- innerPanes.dispose();
- }
- try {
- String className = (String) testSuites.get(combo.getText());
- ClassLoader classLoader = (ClassLoader) classLoaders.get(combo.getText());
- TestSuite suite = (TestSuite) classLoader.loadClass(className).newInstance();
-
- innerPanes = new TestCollectorInnerPanes(this, SWT.NULL, new SuiteHelper(suite));
-
- GridData gridData = new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 1;
- innerPanes.setLayoutData(gridData);
- layout();
- } catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorInnerPanes.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorInnerPanes.java
deleted file mode 100644
index a51bae5..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorInnerPanes.java
+++ /dev/null
@@ -1,212 +0,0 @@
-package org.eclipse.wst.common.tests.collector;
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Hashtable;
-import java.util.Iterator;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.swt.SWT;
-import org.eclipse.swt.custom.SashForm;
-import org.eclipse.swt.events.SelectionAdapter;
-import org.eclipse.swt.events.SelectionEvent;
-import org.eclipse.swt.events.SelectionListener;
-import org.eclipse.swt.layout.GridData;
-import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
-import org.eclipse.swt.widgets.Composite;
-import org.eclipse.swt.widgets.Group;
-import org.eclipse.swt.widgets.Label;
-import org.eclipse.swt.widgets.Table;
-import org.eclipse.swt.widgets.TableItem;
-
-/**
- * @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 TestCollectorInnerPanes extends Composite {
-
- private Table testClassTable;
- private Table testMethodTable;
-
- private Button launchTestButton;
-
- private SuiteHelper pluginTestLoader;
-
- private HashSet partialSetHash = new HashSet();
- private Hashtable shortToFullHashtable = new Hashtable();
- private Hashtable fullToShortHashtable = new Hashtable();
-
- public TestCollectorInnerPanes(Composite parent, int style, SuiteHelper loader) {
- super(parent, style);
- pluginTestLoader = loader;
- createPartControl();
- }
-
- public void createPartControl() {
- GridLayout gridLayout = new GridLayout();
- gridLayout.numColumns = 1;
- gridLayout.marginWidth = 0;
- gridLayout.marginHeight = 0;
- setLayout(gridLayout);
- GridData gridData = null;
-
- Group tableGroup = new Group(this, SWT.NULL);
- GridLayout tableGroupLayout = new GridLayout();
- tableGroupLayout.makeColumnsEqualWidth = true;
- tableGroupLayout.numColumns = 1;
- tableGroupLayout.marginWidth = 0;
- tableGroupLayout.marginHeight = 0;
- tableGroup.setLayout(tableGroupLayout);
- tableGroup.setLayoutData(new GridData(GridData.FILL_BOTH));
-
- SashForm splitView = new SashForm(tableGroup, SWT.HORIZONTAL);
- splitView.setBackground(getDisplay().getSystemColor(SWT.COLOR_DARK_GRAY));
-
- gridData = new GridData(GridData.FILL_BOTH);
- gridData.horizontalSpan = 2;
- splitView.setLayoutData(gridData);
-
- Composite leftComposite = new Composite(splitView, SWT.NONE);
- GridLayout leftLayout = new GridLayout();
- leftLayout.numColumns = 1;
- leftComposite.setLayout(leftLayout);
- Label label2 = new Label(leftComposite, SWT.NULL);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.CENTER;
- label2.setLayoutData(gridData);
- label2.setText("Test Suites");
-
- Composite rightComposite = new Composite(splitView, SWT.NONE);
- GridLayout rightLayout = new GridLayout();
- rightLayout.numColumns = 1;
- rightComposite.setLayout(rightLayout);
- Label label3 = new Label(rightComposite, SWT.NULL);
- gridData = new GridData();
- gridData.horizontalAlignment = GridData.CENTER;
- label3.setLayoutData(gridData);
- label3.setText("Tests");
-
- testClassTable = new Table(leftComposite, SWT.CHECK);
- testClassTable.setBackground(getBackground());
- gridData = new GridData(GridData.FILL_BOTH);
- testClassTable.setLayoutData(gridData);
- String[] allTests = pluginTestLoader.getAllTests();
- for (int i = 0; i < allTests.length; i++) {
- TableItem tableItem = new TableItem(testClassTable, SWT.NULL);
- tableItem.setText(allTests[i]);
- }
- testClassTable.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- TableItem item = (TableItem) e.item;
- String testName = item.getText();
- updateMethodTable(testName, pluginTestLoader.getTestMethods(testName));
- testClassTable.setSelection(new TableItem[] { item });
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- }
-
- });
-
- Label label = new Label(leftComposite, SWT.SEPARATOR | SWT.HORIZONTAL);
- label.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
-
- final Button selectAllCheckbox = new Button(leftComposite, SWT.CHECK);
- selectAllCheckbox.setLayoutData(new GridData(GridData.FILL_HORIZONTAL));
- selectAllCheckbox.setText("Select All");
- selectAllCheckbox.addSelectionListener(new SelectionAdapter(){
- public void widgetSelected(SelectionEvent e) {
- boolean checked = selectAllCheckbox.getSelection();
- TableItem [] items = testClassTable.getItems();
- for(int i=0;i<items.length; i++){
- items[i].setChecked(checked);
- }
- }
- });
-
- testMethodTable = new Table(rightComposite, SWT.CHECK);
- testMethodTable.setBackground(getBackground());
- gridData = new GridData(GridData.FILL_BOTH);
- testMethodTable.setLayoutData(gridData);
-
- launchTestButton = new Button(this, SWT.PUSH);
- gridData = new GridData(GridData.FILL_HORIZONTAL);
- gridData.horizontalAlignment = GridData.CENTER;
- gridData.horizontalSpan = 2;
- launchTestButton.setLayoutData(gridData);
- launchTestButton.setText("Run Tests");
- launchTestButton.addSelectionListener(new SelectionListener() {
- public void widgetSelected(SelectionEvent e) {
- SuiteTestRunner runner = new SuiteTestRunner(buildSuite());
- runner.launch();
- }
- public void widgetDefaultSelected(SelectionEvent e) {
- }
- });
- }
-
- private void storeMethodsTable() {
- TableItem[] items = testMethodTable.getItems();
- for (int i = 0; null != items && i < items.length; i++) {
- String partialTestName = (String)shortToFullHashtable.get(items[i].getText());
- if (items[i].getChecked() && !partialSetHash.contains(partialTestName)) {
- partialSetHash.add(partialTestName);
- } else if (!items[i].getChecked() && partialSetHash.contains(partialTestName)) {
- partialSetHash.remove(partialTestName);
- }
- }
- }
-
- private void updateMethodTable(String testName, String[] methodArray) {
- storeMethodsTable();
- testMethodTable.removeAll();
- shortToFullHashtable.clear();
- fullToShortHashtable.clear();
-
- for (int i = 0; null != methodArray && i < methodArray.length; i++) {
- String partialTestName = testName + "." + methodArray[i];
- int endIndex = methodArray[i].indexOf('(');
- String methodName = endIndex > 0 ? methodArray[i].substring(0, endIndex) : methodArray[i];
- shortToFullHashtable.put(methodName, partialTestName);
- fullToShortHashtable.put(partialTestName, methodName);
- TableItem tableItem = new TableItem(testMethodTable, SWT.NULL);
- tableItem.setText(methodName);
- tableItem.setChecked(partialSetHash.contains(partialTestName));
- }
-
- }
-
- private TestSuite buildSuite() {
- ArrayList completeTests = new ArrayList();
- TableItem[] items = testClassTable.getItems();
- for (int i = 0; i < items.length; i++) {
- if (items[i].getChecked()) {
- completeTests.add(items[i].getText());
- }
- }
-
- String[] completeArray = new String[completeTests.size()];
- for (int i = 0; i < completeArray.length; i++) {
- completeArray[i] = (String) completeTests.get(i);
- }
-
- ArrayList partialTests = new ArrayList();
- storeMethodsTable();
- Iterator iterator = partialSetHash.iterator();
- while (iterator.hasNext()) {
- partialTests.add(iterator.next());
- }
-
- String[] partialArray = new String[partialTests.size()];
- for (int i = 0; i < partialArray.length; i++) {
- partialArray[i] = (String) partialTests.get(i);
- }
-
- return pluginTestLoader.buildSuite(completeArray, partialArray);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorPlugin.java b/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorPlugin.java
deleted file mode 100644
index ed3e6ad..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/collector/org/eclipse/wst/common/tests/collector/TestCollectorPlugin.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Created on Mar 6, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.tests.collector;
-
-import org.eclipse.core.runtime.IExtensionPoint;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Plugin;
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class TestCollectorPlugin extends Plugin {
-
-
- public static TestCollectorPlugin instance = null;
- public IExtensionPoint suitesExtensionPoint = null;
-
-
- public TestCollectorPlugin getInstance(){
- return instance;
- }
-
- /**
- * @param descriptor
- */
- public TestCollectorPlugin(IPluginDescriptor descriptor) {
- super(descriptor);
- instance = this;
- suitesExtensionPoint = descriptor.getExtensionPoint("suites");
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.collector/plugin.xml b/tests/org.eclipse.wst.common.tests.collector/plugin.xml
deleted file mode 100644
index 8bc423a..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/plugin.xml
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.common.tests.collector"
- name="org.eclipse.wst.common.tests.collector"
- version="1.0.0"
- class="org.eclipse.wst.common.tests.collector.TestCollectorPlugin">
-
- <runtime>
- <library name="runtime/collector.jar"/>
- </runtime>
- <requires>
- <import plugin="org.junit"/>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- </requires>
- <extension-point id="suites" name="suites" schema="schema/suites.exsd"/>
-
-
-
- <extension
- point="org.eclipse.ui.actionSets">
- <actionSet
- label="Test Collector"
- visible="true"
- id="testCollector">
- <menu
- label="WTP Tests"
- path="additions"
- id="org.eclipse.wst.common.tests.collector.testsMenu">
- <separator
- name="group1">
- </separator>
- </menu>
- <action
- label="Open"
- tooltip="Test Collector"
- class="org.eclipse.wst.common.tests.collector.TestCollectorActionDelegate"
- menubarPath="org.eclipse.wst.common.tests.collector.testsMenu/group1"
- id="org.eclipse.wst.common.tests.collector.testsAction">
- </action>
- </actionSet>
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.wst.common.tests.collector/schema/suites.exsd b/tests/org.eclipse.wst.common.tests.collector/schema/suites.exsd
deleted file mode 100644
index dfec3c5..0000000
--- a/tests/org.eclipse.wst.common.tests.collector/schema/suites.exsd
+++ /dev/null
@@ -1,109 +0,0 @@
-<?xml version='1.0' encoding='UTF-8'?>
-<!-- Schema file written by PDE -->
-<schema targetNamespace="org.eclipse.wst.common.tests.collector">
-<annotation>
- <appInfo>
- <meta.schema plugin="org.eclipse.wst.common.tests.collector" id="suites" name="suites"/>
- </appInfo>
- <documentation>
- [Enter description of this extension point.]
- </documentation>
- </annotation>
-
- <element name="extension">
- <complexType>
- <sequence>
- <element ref="suite"/>
- </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>
- <appInfo>
- <meta.attribute translatable="true"/>
- </appInfo>
- </annotation>
- </attribute>
- </complexType>
- </element>
-
- <element name="suite">
- <complexType>
- <attribute name="class" type="string" use="required">
- <annotation>
- <documentation>
-
- </documentation>
- </annotation>
- </attribute>
- <attribute name="name" type="string" use="required">
- <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.ui/.classpath b/tests/org.eclipse.wst.common.tests.ui/.classpath
deleted file mode 100644
index 065ac06..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/.classpath
+++ /dev/null
@@ -1,7 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="src"/>
- <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.ui/.cvsignore b/tests/org.eclipse.wst.common.tests.ui/.cvsignore
deleted file mode 100644
index 2521e52..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/.cvsignore
+++ /dev/null
@@ -1,4 +0,0 @@
-bin
-temp.folder
-build.xml
-ui.jar
diff --git a/tests/org.eclipse.wst.common.tests.ui/.project b/tests/org.eclipse.wst.common.tests.ui/.project
deleted file mode 100644
index 8efe78d..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/.project
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
- <name>org.eclipse.wst.common.tests.ui</name>
- <comment></comment>
- <projects>
- </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.pde.PluginNature</nature>
- <nature>org.eclipse.jdt.core.javanature</nature>
- </natures>
-</projectDescription>
diff --git a/tests/org.eclipse.wst.common.tests.ui/build.properties b/tests/org.eclipse.wst.common.tests.ui/build.properties
deleted file mode 100644
index 1c52d49..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/build.properties
+++ /dev/null
@@ -1,4 +0,0 @@
-source.ui.jar = src/
-output.ui.jar = bin/
-bin.includes = plugin.xml,\
- ui.jar
diff --git a/tests/org.eclipse.wst.common.tests.ui/plugin.xml b/tests/org.eclipse.wst.common.tests.ui/plugin.xml
deleted file mode 100644
index 0ca05f2..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/plugin.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<?eclipse version="3.0"?>
-<plugin
- id="org.eclipse.wst.common.tests.ui"
- name="Ui Plug-in"
- version="1.0.0"
- provider-name=""
- class="org.eclipse.wst.common.tests.ui.UiPlugin">
-
- <runtime>
- <library name="ui.jar">
- <export name="*"/>
- </library>
- </runtime>
-
- <requires>
- <import plugin="org.eclipse.ui"/>
- <import plugin="org.eclipse.core.runtime"/>
- <import plugin="org.eclipse.wst.common.frameworks.ui"/>
- <import plugin="org.eclipse.wst.common.tests"/>
- </requires>
-
- <extension
- point="org.eclipse.wst.common.tests.collector.suites">
- <suite
- class="org.eclipse.wst.common.tests.ui.DataModelUIAPITests"
- name="DataModel UI API Tests">
- </suite>
- </extension>
- <extension
- point="org.eclipse.wst.common.frameworks.ui.DataModelWizardExtension">
- <DataModelWizard
- class="org.eclipse.wst.common.tests.ui.TestDataModelWizard"
- id="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- </extension>
-
-
-</plugin>
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIAPITests.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIAPITests.java
deleted file mode 100644
index caf613e..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIAPITests.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.tests.ui;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class DataModelUIAPITests extends TestSuite {
-
- public static Test suite() {
- return new DataModelUIAPITests();
- }
-
- public DataModelUIAPITests() {
- super();
- addTest(new SimpleTestSuite(DataModelUIFactoryTest.class));
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIFactoryTest.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIFactoryTest.java
deleted file mode 100644
index a724d9a..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/DataModelUIFactoryTest.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.tests.ui;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizardFactory;
-
-public class DataModelUIFactoryTest extends TestCase {
-
- public void testValidExtensionID() {
- IDataModel dataModel = DataModelFactory.createDataModel("org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel");
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- DataModelWizard wizard = DataModelWizardFactory.createWizard("org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel");
- assertNotNull(wizard);
- assertNotNull(wizard.getDataModel());
- }
-
-
- public void testValidExtensionClass() {
- IDataModel dataModel = DataModelFactory.createDataModel(ITestDataModel.class);
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- DataModelWizard wizard = DataModelWizardFactory.createWizard(ITestDataModel.class);
- assertNotNull(wizard);
- assertNotNull(wizard.getDataModel());
- }
-
- public void testValidExtensionInstance() {
- int startInstanceCount = TestDataModelProvider.getInstanceCount();
- IDataModel dataModel = DataModelFactory.createDataModel(new TestDataModelProvider());
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- DataModelWizard wizard = DataModelWizardFactory.createWizard(dataModel);
- assertNotNull(wizard);
- assertTrue(dataModel == wizard.getDataModel());
- int endInstanceCount = TestDataModelProvider.getInstanceCount();
- assertEquals(1, endInstanceCount-startInstanceCount);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/TestDataModelWizard.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/TestDataModelWizard.java
deleted file mode 100644
index b6044c4..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/TestDataModelWizard.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.tests.ui;
-
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider;
-import org.eclipse.wst.common.frameworks.internal.datamodel.ui.DataModelWizard;
-
-public class TestDataModelWizard extends DataModelWizard {
-
- public TestDataModelWizard() {
- super();
- }
-
- public TestDataModelWizard(IDataModel dataModel) {
- super(dataModel);
- }
-
- protected IDataModelProvider getDefaultProvider() {
- return new TestDataModelProvider();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/UiPlugin.java b/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/UiPlugin.java
deleted file mode 100644
index 6724e83..0000000
--- a/tests/org.eclipse.wst.common.tests.ui/src/org/eclipse/wst/common/tests/ui/UiPlugin.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package org.eclipse.wst.common.tests.ui;
-
-import java.util.MissingResourceException;
-import java.util.ResourceBundle;
-
-import org.eclipse.jface.resource.ImageDescriptor;
-import org.eclipse.ui.plugin.AbstractUIPlugin;
-import org.osgi.framework.BundleContext;
-
-/**
- * The main plugin class to be used in the desktop.
- */
-public class UiPlugin extends AbstractUIPlugin {
- //The shared instance.
- private static UiPlugin plugin;
- //Resource bundle.
- private ResourceBundle resourceBundle;
-
- /**
- * The constructor.
- */
- public UiPlugin() {
- super();
- plugin = this;
- }
-
- /**
- * This method is called upon plug-in activation
- */
- public void start(BundleContext context) throws Exception {
- super.start(context);
- }
-
- /**
- * This method is called when the plug-in is stopped
- */
- public void stop(BundleContext context) throws Exception {
- super.stop(context);
- plugin = null;
- resourceBundle = null;
- }
-
- /**
- * Returns the shared instance.
- */
- public static UiPlugin getDefault() {
- return plugin;
- }
-
- /**
- * Returns the string from the plugin's resource bundle,
- * or 'key' if not found.
- */
- public static String getResourceString(String key) {
- ResourceBundle bundle = UiPlugin.getDefault().getResourceBundle();
- try {
- return (bundle != null) ? bundle.getString(key) : key;
- } catch (MissingResourceException e) {
- return key;
- }
- }
-
- /**
- * Returns the plugin's resource bundle,
- */
- public ResourceBundle getResourceBundle() {
- try {
- if (resourceBundle == null)
- resourceBundle = ResourceBundle.getBundle("org.eclipse.wst.common.tests.ui.UiPluginResources");
- } catch (MissingResourceException x) {
- resourceBundle = null;
- }
- return resourceBundle;
- }
-
- /**
- * Returns an image descriptor for the image file at the given
- * plug-in relative path.
- *
- * @param path the path
- * @return the image descriptor
- */
- public static ImageDescriptor getImageDescriptor(String path) {
- return AbstractUIPlugin.imageDescriptorFromPlugin("org.eclipse.wst.common.tests.ui", path);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/.classpath b/tests/org.eclipse.wst.common.tests/.classpath
deleted file mode 100644
index 81f3c85..0000000
--- a/tests/org.eclipse.wst.common.tests/.classpath
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="src" path="commontests/"/>
- <classpathentry kind="src" path="frameworktests/"/>
- <classpathentry kind="src" path="apitools/"/>
- <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
deleted file mode 100644
index ba077a4..0000000
--- a/tests/org.eclipse.wst.common.tests/.cvsignore
+++ /dev/null
@@ -1 +0,0 @@
-bin
diff --git a/tests/org.eclipse.wst.common.tests/.project b/tests/org.eclipse.wst.common.tests/.project
deleted file mode 100644
index 683085f..0000000
--- a/tests/org.eclipse.wst.common.tests/.project
+++ /dev/null
@@ -1,29 +0,0 @@
-<?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/apitools/org/eclipse/etools/common/test/apitools/ProjectUnzipUtil.java b/tests/org.eclipse.wst.common.tests/apitools/org/eclipse/etools/common/test/apitools/ProjectUnzipUtil.java
deleted file mode 100644
index 5767d21..0000000
--- a/tests/org.eclipse.wst.common.tests/apitools/org/eclipse/etools/common/test/apitools/ProjectUnzipUtil.java
+++ /dev/null
@@ -1,139 +0,0 @@
-package org.eclipse.etools.common.test.apitools;
-
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.Enumeration;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.eclipse.core.internal.resources.ProjectDescription;
-import org.eclipse.core.internal.resources.ProjectDescriptionReader;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-
-public class ProjectUnzipUtil {
-
- private IPath zipLocation;
- private String[] projectNames;
- private IPath rootLocation = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- private static final String META_PROJECT_NAME = ".project";
-
-
-
- public ProjectUnzipUtil(IPath aZipLocation, String[] aProjectNames) {
- zipLocation = aZipLocation;
- projectNames = aProjectNames;
-
- }
-
- public boolean createProjects() {
- try {
- expandZip();
- ResourcesPlugin.getWorkspace().getRoot().refreshLocal(IResource.DEPTH_INFINITE, null);
- buildProjects();
- } catch (CoreException e) {
- e.printStackTrace();
- return false;
- } catch (IOException e) {
- e.printStackTrace();
- return false;
- }
-
- return true;
-
- }
-
- private IProgressMonitor getProgessMonitor() {
- return new NullProgressMonitor();
- }
-
- private void expandZip() throws CoreException, IOException {
- IProgressMonitor monitor = getProgessMonitor();
- ZipFile zipFile = null;
- try {
- zipFile = new ZipFile(zipLocation.toFile());
- } catch (IOException e1) {
- throw e1;
- }
- Enumeration entries = zipFile.entries();
- while (entries.hasMoreElements()) {
- ZipEntry entry = (ZipEntry) entries.nextElement();
- monitor.subTask(entry.getName());
- File aFile = computeLocation(entry.getName()).toFile();
- File parentFile = null;
- try {
- if (entry.isDirectory()) {
- aFile.mkdirs();
- } else {
- parentFile = aFile.getParentFile();
- if (!parentFile.exists())
- parentFile.mkdirs();
- if (!aFile.exists())
- aFile.createNewFile();
- copy(zipFile.getInputStream(entry), new FileOutputStream(aFile));
- if (entry.getTime() > 0)
- aFile.setLastModified(entry.getTime());
- }
- } catch (IOException e) {
- throw e;
- }
- monitor.worked(1);
- }
- }
-
- private IPath computeLocation(String name) {
- return rootLocation.append(name);
- }
-
-
- public static void copy(InputStream in, OutputStream out) throws IOException {
- byte[] buffer = new byte[1024];
- try {
- int n = in.read(buffer);
- while (n > 0) {
- out.write(buffer, 0, n);
- n = in.read(buffer);
- }
- } finally {
- in.close();
- out.close();
- }
- }
-
- public void setRootLocation(IPath rootLocation) {
- this.rootLocation = rootLocation;
- }
-
- private void buildProjects() throws IOException, CoreException {
- for (int i = 0; i < projectNames.length; i++) {
- ProjectDescriptionReader pd = new ProjectDescriptionReader();
- IPath projectPath = new Path("/" + projectNames[i] + "/" + META_PROJECT_NAME);
- IPath path = rootLocation.append(projectPath);
- IProject project = ResourcesPlugin.getWorkspace().getRoot().getProject(projectNames[i]);
- ProjectDescription description;
- try {
- description = pd.read(path);
- project.create(description, (getProgessMonitor()));
- project.open(getProgessMonitor());
-
- } catch (IOException e) {
- throw e;
- } catch (CoreException e) {
- throw e;
- }
- }
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/build.properties b/tests/org.eclipse.wst.common.tests/build.properties
deleted file mode 100644
index 1dbb4f1..0000000
--- a/tests/org.eclipse.wst.common.tests/build.properties
+++ /dev/null
@@ -1,8 +0,0 @@
-bin.includes = commontests.jar,\
- plugin.xml,\
- testData/,\
- test.xml
-source.commontests.jar = commontests/,\
- frameworktests/,\
- apitools/
-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
deleted file mode 100644
index 8db5dee..0000000
--- a/tests/org.eclipse.wst.common.tests/build/buildcontrol.properties
+++ /dev/null
@@ -1,7 +0,0 @@
-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
deleted file mode 100644
index d5988c4..0000000
--- a/tests/org.eclipse.wst.common.tests/build/package.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<project name="org.eclipse.wst.common.tests" default="packagingPlugin" basedir="./..">
- <target name="init">
- <property name="packageDir" value=""/>
- <property name="plugin.directory" value="${basedir}"/>
- <property name="plugin.id" value="org.eclipse.wst.common.tests"/>
- <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
deleted file mode 100644
index 77c0b82..0000000
--- a/tests/org.eclipse.wst.common.tests/build/wsBuild.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?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
deleted file mode 100644
index bfd512c..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitor.java
+++ /dev/null
@@ -1,282 +0,0 @@
-/*
- * 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
deleted file mode 100644
index f728081..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/etools/common/tests/xml/DomComparitorTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * 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
deleted file mode 100644
index c1d7c96..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/extras/MemoryUsageTestSuite.java
+++ /dev/null
@@ -1,114 +0,0 @@
-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
deleted file mode 100644
index 35748e8..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/BaseTestCase.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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
deleted file mode 100644
index c41276b..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/CommonTestsPlugin.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 02768d0..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifier.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.datamodel.IDataModel;
-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 {
- /**
- * @author Administrator
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- * @deprecated use verify(IDataModel model)
- */
-
- public void verify(WTPOperationDataModel model) throws Exception {
- }
-
- public void verify(IDataModel 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
deleted file mode 100644
index 20fa183..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierFactory.java
+++ /dev/null
@@ -1,123 +0,0 @@
-/*
- * 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 org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IConfigurationElement;
-import org.eclipse.jem.util.RegistryReader;
-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 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;
- private DataModelVerifier defaultDataModelVerifier = new DataModelVerifier();
-
- 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 org.eclipse.jem.util.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 = getDefaultDataModelVerifier();
- String verifierClassName = null;
- if (model != null) {
- verifierClassName = (String) getDataModelVerifiersMap().get(model.getClass().getName());
- if (verifierClassName != null) {
- try {
- Class verifierClass = Class.forName(verifierClassName);
- verifier = (DataModelVerifier) verifierClass.newInstance();
- } catch (Exception e) {
- verifier = getDefaultDataModelVerifier();
- }
- }
- }
- return verifier;
- }
-
- protected void addToDataModelVerifiersMap(Map dataModelVerifiers){
- if (dataModelVerifiersMap == null)
- dataModelVerifiersMap = initDataModelVerifiersMap();
- dataModelVerifiersMap.putAll(dataModelVerifiers);
- }
-
- /**
- * @return Returns the dataModelVerifiersMap.
- */
- public Map getDataModelVerifiersMap() {
- if (dataModelVerifiersMap == null) {
- dataModelVerifiersMap = initDataModelVerifiersMap();
- }
- return dataModelVerifiersMap;
- }
-
- protected Map initDataModelVerifiersMap() {
- return new HashMap();
- }
-
- /**
- * @return Returns the defaultDataModelVerifier.
- */
- protected DataModelVerifier getDefaultDataModelVerifier() {
- return defaultDataModelVerifier;
- }
-
- /*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
deleted file mode 100644
index dc822e0..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/DataModelVerifierList.java
+++ /dev/null
@@ -1,21 +0,0 @@
-/*
- * 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
deleted file mode 100644
index f3d028e..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/LogUtility.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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
deleted file mode 100644
index a19a8b4..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/OperationTestCase.java
+++ /dev/null
@@ -1,246 +0,0 @@
-/*
- * 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.NullProgressMonitor;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-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, "org.eclipse.jem.util", 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);
- }
-
- /**
- * @deprecated
- */
- public static void runAndVerify(WTPOperationDataModel dataModel) throws Exception {
- OperationTestCase.runAndVerify(dataModel, true, true);
- }
-
- public static void runAndVerify(IDataModel dataModel) throws Exception {
- OperationTestCase.runAndVerify(dataModel, true, true);
- }
-
- /**
- * @deprecated
- */
- public static void runAndVerify(WTPOperationDataModel dataModel, boolean checkTasks, boolean checkLog) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, null, true, false);
- }
-
- public static void runAndVerify(IDataModel dataModel, boolean checkTasks, boolean checkLog) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, null, true, false);
- }
-
- /**
- * @deprecated
- */
- 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(IDataModel dataModel, boolean checkTasks, boolean checkLog, boolean waitForBuildToComplete) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, null, true, waitForBuildToComplete);
- }
-
- /**
- * @deprecated
- */
- 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(IDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, errorOKList, reportIfExpectedErrorNotFound, false);
- }
-
- /**
- * @deprecated
- */
- 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);
- }
-
- public static void runAndVerify(IDataModel dataModel, boolean checkTasks, boolean checkLog, List errorOKList, boolean reportIfExpectedErrorNotFound, boolean waitForBuildToComplete) throws Exception {
- runAndVerify(dataModel, checkTasks, checkLog, errorOKList, reportIfExpectedErrorNotFound, false, false);
- }
-
- /**
- * @deprecated
- *
- * 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();
- }
- }
-
- /**
- * Guaranteed to close the dataModel
- *
- * @param dataModel
- * @throws Exception
- */
- public static void runAndVerify(IDataModel 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();
- // TODO Verification to be fixed to use IDataModel
- // verifyValidDataModel(dataModel);
- dataModel.getDefaultOperation().execute(new NullProgressMonitor(), null);
- // TODO Verification to be fixed to use IDataModel
- // 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();
- }
- }
-
-
- /**
- * @deprecated
- */
- 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();
- }
-
- /**
- * @deprecated
- */
- 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 verifyValidDataModel(IDataModel dataModel) {
- IStatus status = dataModel.validate();
-
- if (!status.isOK() && status.getSeverity() == IStatus.ERROR) {
- Assert.assertTrue("DataModel is invalid operation will not run:" + status.toString(), false); //$NON-NLS-1$
- }
- }
-
- /**
- * @deprecated
- */
- 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$
- }
- }
-
- public static void verifyInvalidDataModel(IDataModel dataModel) {
- IStatus status = dataModel.validate();
- 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/PlatformModuleURLTest.java b/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PlatformModuleURLTest.java
deleted file mode 100644
index bfbbdb3..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PlatformModuleURLTest.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * Created on Jan 21, 2005
- *
- * 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.net.URL;
-import java.net.URLConnection;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.common.componentcore.internal.impl.PlatformURLModuleConnection;
-
-public class PlatformModuleURLTest extends TestCase {
-
- public PlatformModuleURLTest(String name) {
- super(name);
- }
-
-
- public static Test suite() {
- return new TestSuite(PlatformModuleURLTest.class);
- }
-
- /* (non-Javadoc)
- * @see junit.framework.TestCase#setUp()
- */
- protected void setUp() throws Exception {
- super.setUp();
- PlatformURLModuleConnection.startup();
- }
-
- /**
- *
- */
- public void testURLResolve() throws Exception {
- URL url = new URL("platform:/module:/MyModule/META-INF/ejb-jar.xml");
- URLConnection conx = url.openConnection();
- System.out.println(conx.getURL());
-
- }
-}
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
deleted file mode 100644
index 3db4657..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/PostBuildListener.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * 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
deleted file mode 100644
index c7b535f..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/ProjectUtility.java
+++ /dev/null
@@ -1,182 +0,0 @@
-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
deleted file mode 100644
index 5fe16e6..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/SimpleTestSuite.java
+++ /dev/null
@@ -1,31 +0,0 @@
-/*
- * 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
deleted file mode 100644
index 821355c..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/TaskViewUtility.java
+++ /dev/null
@@ -1,193 +0,0 @@
-package org.eclipse.wst.common.tests;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.HashSet;
-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
deleted file mode 100644
index 9edc779..0000000
--- a/tests/org.eclipse.wst.common.tests/commontests/org/eclipse/wst/common/tests/WindowUtility.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditAPITests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditAPITests.java
deleted file mode 100644
index 1d2d420..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditAPITests.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * Created on Mar 31, 2005
- *
- * TODO To change the template for this generated file go to
- * Window - Preferences - Java - Code Style - Code Templates
- */
-package org.eclipse.wst.common.frameworks.artifactedit.tests;
-
-
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-public class ArtifactEditAPITests extends TestSuite {
-
-
-
- public static Test suite() {
- return new ArtifactEditAPITests();
- }
-
- public ArtifactEditAPITests() {
- super();
- //addTest(new SimpleTestSuite(ArtifactEditTest.class));
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditTest.java
deleted file mode 100644
index b57c57b..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/artifactedit/tests/ArtifactEditTest.java
+++ /dev/null
@@ -1,543 +0,0 @@
-package org.eclipse.wst.common.frameworks.artifactedit.tests;
-
-
-
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.componentcore.ArtifactEdit;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.resources.ComponentHandle;
-import org.eclipse.wst.common.frameworks.internal.operations.IOperationHandler;
-import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelEvent;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModelListener;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-
-
-public class ArtifactEditTest extends TestCase {
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- private ArtifactEditModel artifactEditModelForRead;
- private ArtifactEditModel artifactEditModelForWrite;
- private ArtifactEdit artifactEditForRead;
- private ArtifactEdit artifactEditForWrite;
- private EditModelListener emListener;
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
-
-
-
- private IOperationHandler handler = new IOperationHandler() {
-
-
- public boolean canContinue(String message) {
- return false;
- }
-
-
- public boolean canContinue(String message, String[] items) {
-
- return false;
- }
-
- public int canContinueWithAllCheck(String message) {
-
- return 0;
- }
-
- public int canContinueWithAllCheckAllowCancel(String message) {
-
- return 0;
- }
-
- public void error(String message) {
-
-
- }
-
- public void inform(String message) {
-
-
- }
-
-
- public Object getContext() {
-
- return null;
- }
- };
-
- public ArtifactEditTest() {
- super();
-
- }
-
- protected void setUp() throws Exception {
- if (!getTargetProject().exists())
- if (!createProject())
- fail();
- project = getTargetProject();
- }
-
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
-
-
- private IPath getLocalPath() {
-
- IPluginDescriptor pluginDescriptor = Platform.getPluginRegistry().getPluginDescriptor("org.eclipse.wst.common.tests");
- URL url = pluginDescriptor.getInstallURL();
-
- try {
- url = new URL(url.toString() + zipFilePath);
-
- } catch (MalformedURLException e1) {
- // TODO Auto-generated catch block
- e1.printStackTrace();
- }
-
- try {
- url = Platform.asLocalURL(url);
- printLocalPath(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-
-
- private void printLocalPath(URL url) {
- IPath path = ResourcesPlugin.getWorkspace().getRoot().getLocation();
- File file = new File(path.append("PlatformInfo.txt").toOSString());
- BufferedWriter bw;
- String osName = System.getProperty("os.name");
- String fileSeperator = System.getProperty("path.separator");
- URL urlFindUsingPlugin = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- urlFindUsingPlugin = Platform.asLocalURL(urlFindUsingPlugin);
- } catch (IOException e1) {
- e1.printStackTrace();
- }
- String javaFileSeperator = new Character(File.pathSeparatorChar).toString();
-
-
- try {
- bw = new BufferedWriter(new FileWriter(file));
- bw.write("pluginDescriptor URL " + url.toString());
- bw.write("\n");
- bw.write("Operating System: " + osName);
- bw.write("\n");
- bw.write("System file seperator: " + fileSeperator);
- bw.write("\n");
- bw.write("Using Pluign.find URL:" + urlFindUsingPlugin.toString());
- bw.write("\n");
- bw.write("Java file seperator: " + javaFileSeperator);
- bw.write("\n");
- bw.close();
- } catch (IOException e) {
- e.printStackTrace();
- }
-
-
- }
-
-
-
- public void testGetArtifactEditForReadWorkbenchComponent() {
- ArtifactEdit edit = null;
- try {
- ComponentHandle handle = ComponentHandle.create(project,WEB_MODULE_NAME);
- edit = ArtifactEdit.getArtifactEditForRead(handle);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- }
-
- public void testGetArtifactEditForWriteWorkbenchComponent() {
- ArtifactEdit edit = null;
- try {
- ComponentHandle handle = ComponentHandle.create(project,WEB_MODULE_NAME);
- edit = ArtifactEdit.getArtifactEditForWrite(handle);
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- }
-
-
- public void testGetArtifactEditForReadComponentHandle() {
- StructureEdit moduleCore = null;
- ArtifactEdit edit = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- ComponentHandle handle = ComponentHandle.create(project, wbComponent.getName());
- edit = ArtifactEdit.getArtifactEditForRead(handle);
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- }
-
-
- public void testGetArtifactEditForWriteComponentHandle() {
- ArtifactEdit edit = null;
- try {
- ComponentHandle handle = ComponentHandle.create(project, WEB_MODULE_NAME);
- edit = ArtifactEdit.getArtifactEditForWrite(handle);
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- }
-
- public void testIsValidEditableModule() {
- assertTrue(ArtifactEdit.isValidEditableModule(ComponentCore.createComponent(project,WEB_MODULE_NAME)));
- }
-
- public void testArtifactEditArtifactEditModel() {
- ArtifactEdit edit = new ArtifactEdit(getArtifactEditModelforRead());
- assertNotNull(edit);
- edit.dispose();
- }
-
-
- public void testArtifactEditModuleCoreNatureWorkbenchComponentboolean() {
- try {
- StructureEdit.getModuleCoreNature(moduleURI);
- } catch (UnresolveableURIException e) {
- fail();
- }
- ArtifactEdit edit = null;
- ComponentHandle handle = ComponentHandle.create(project, WEB_MODULE_NAME);
- try {
- edit = new ArtifactEdit(handle, true);
- assertNotNull(edit);
- } finally {
- if (edit != null)
- edit.dispose();
- }
- }
-
- public void testArtifactEditComponentHandleboolean() {
- StructureEdit moduleCore = null;
- WorkbenchComponent wbComponent = null;
- ComponentHandle handle = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- handle = ComponentHandle.create(project, wbComponent.getName());
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
- }
- }
-
- ArtifactEdit edit = new ArtifactEdit(handle, true);
- assertNotNull(edit);
- edit.dispose();
-
- }
-
- public void testSave() {
- ArtifactEdit edit = null;
- try {
- ComponentHandle handle = ComponentHandle.create(project,WEB_MODULE_NAME);
- edit = ArtifactEdit.getArtifactEditForWrite(handle);
- try {
- edit.save(new NullProgressMonitor());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- assertTrue(edit != null);
- }
- assertTrue(true);
- }
-
- public void testSaveIfNecessary() {
- ArtifactEdit edit = null;
- try {
- ComponentHandle handle = ComponentHandle.create(project,WEB_MODULE_NAME);
- edit = ArtifactEdit.getArtifactEditForWrite(handle);
- try {
- edit.saveIfNecessary(new NullProgressMonitor());
- } catch (Exception e) {
- fail(e.getMessage());
- }
-
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- pass();
- }
-
- public void testSaveIfNecessaryWithPrompt() {
- ArtifactEdit edit = null;
- try {
- ComponentHandle handle = ComponentHandle.create(project,WEB_MODULE_NAME);
- edit = ArtifactEdit.getArtifactEditForWrite(handle);
- try {
- edit.saveIfNecessaryWithPrompt(new NullProgressMonitor(), handler, true);
- } catch (Exception e) {
- fail(e.getMessage());
- }
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- pass();
- }
- }
-
- public void testDispose() {
- ArtifactEdit edit;
- try {
- edit = new ArtifactEdit(getArtifactEditModelforRead());
- edit.dispose();
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
- }
-
- public void testGetContentModelRoot() {
- ArtifactEdit edit = null;
- try {
- ComponentHandle handle = ComponentHandle.create(project,WEB_MODULE_NAME);
- edit = ArtifactEdit.getArtifactEditForRead(handle);
- Object object = edit.getContentModelRoot();
- // assertNotNull(object);
- } catch (Exception e) {
- // TODO fail(e.getMessage());
- } finally {
- if (edit != null) {
- edit.dispose();
- }
- }
- }
-
- public void testAddListener() {
- ArtifactEdit edit = getArtifactEditForRead();
- try {
- edit.addListener(getEmListener());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
- edit.dispose();
- }
-
- public void testRemoveListener() {
- ArtifactEdit edit = getArtifactEditForRead();
- try {
- edit.removeListener(getEmListener());
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
- }
-
- public void testHasEditModel() {
-
- ArtifactEdit edit = getArtifactEditForRead();
- assertTrue(edit.hasEditModel(artifactEditModelForRead));
- edit.dispose();
- }
- public void testGetComponentHandle() {
-
- ArtifactEdit edit = getArtifactEditForRead();
- assertTrue(edit.getComponentHandle() != null);
- edit.dispose();
- }
-
- public void testGetArtifactEditModel() {
- ArtifactEdit edit = getArtifactEditForRead();
- assertTrue(edit.hasEditModel(artifactEditModelForRead));
- edit.dispose();
- }
-
- public void testObject() {
- pass();
- }
-
- public void testGetClass() {
- ArtifactEdit edit = getArtifactEditForRead();
- assertNotNull(edit.getClass());
- edit.dispose();
- }
-
- public void testHashCode() {
- ArtifactEdit edit = getArtifactEditForRead();
- int y = -999999999;
- int x = edit.hashCode();
- assertTrue(x != y);
- edit.dispose();
- }
-
- public void testEquals() {
- assertTrue(getArtifactEditForRead().equals(artifactEditForRead));
- }
-
- public void testClone() {
- pass();
- }
-
- public void testToString() {
- assertTrue(getArtifactEditForRead().toString() != null);
- }
-
- public void testNotify() {
- try {
- synchronized (getArtifactEditForRead()) {
- artifactEditForRead.notify();
- }
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
-
- }
-
- public void testNotifyAll() {
- try {
- synchronized (getArtifactEditForRead()) {
- artifactEditForRead.notifyAll();
- }
- } catch (Exception e) {
- fail(e.getMessage());
- }
- pass();
- }
-
- public void testWaitlong() {
- long x = 2;
- try {
- synchronized (getArtifactEditForRead()) {
- getArtifactEditForRead().wait(x);
- }
- } catch (Exception e) {
- // fail(e.getMessage());
- }
- pass();
- }
-
- /*
- * Class under test for void wait(long, int)
- */
- public void testWaitlongint() {
- int x = 2;
- try {
- synchronized (getArtifactEditForRead()) {
- getArtifactEditForRead().wait(x);
- }
- } catch (Exception e) {
- // fail(e.getMessage());
- }
- pass();
- }
-
- public void testWait() {
- try {
- synchronized (getArtifactEditForRead()) {
- getArtifactEditForRead().wait();
- }
- } catch (Exception e) {
- // fail(e.getMessage());
- }
- pass();
- }
-
- public void testFinalize() {
- pass();
- }
-
-
- public ArtifactEditModel getArtifactEditModelforRead() {
- EMFWorkbenchContext context = new EMFWorkbenchContext(project);
- artifactEditModelForRead = new ArtifactEditModel(EDIT_MODEL_ID, context, true, moduleURI);
- return artifactEditModelForRead;
- }
-
-
-
- public ArtifactEdit getArtifactEditForRead() {
- artifactEditForRead = new ArtifactEdit(getArtifactEditModelforRead());
- return artifactEditForRead;
- }
-
- public void pass() {
- assertTrue(true);
- }
-
- public EditModelListener getEmListener() {
- if (emListener == null)
- emListener = new EditModelListener() {
- public void editModelChanged(EditModelEvent anEvent) {
- }
- };
- return emListener;
- }
-
- public ArtifactEditModel getArtifactEditModelForWrite() {
- EMFWorkbenchContext context = new EMFWorkbenchContext(project);
- return new ArtifactEditModel(EDIT_MODEL_ID, context, false, moduleURI);
-
- }
-
- public ArtifactEdit getArtifactEditForWrite() {
- return new ArtifactEdit(getArtifactEditModelForWrite());
-
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/AllTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/AllTests.java
deleted file mode 100644
index c037985..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/AllTests.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-public class AllTests extends TestCase {
-
-
- public static TestSuite suite() {
-
- TestSuite suite = new TestSuite();
-
- suite.addTestSuite(IVirtualFolderAPITest.class);
- suite.addTestSuite(ModuleCoreAPIFVTTest.class);
- suite.addTestSuite(ModuleCoreURIConverterUnitTest.class);
-
- return suite;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/BaseVirtualTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/BaseVirtualTest.java
deleted file mode 100644
index 186f8a3..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/BaseVirtualTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-import org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests.TestWorkspace;
-
-public class BaseVirtualTest extends TestCase {
-
- public static final IProject TEST_PROJECT = ResourcesPlugin.getWorkspace().getRoot().getProject(TestWorkspace.PROJECT_NAME);
-
- public static final String TEST_FOLDER_NAME = "WEB-INF"; //$NON-NLS-1$
-
- public static final Path WEBINF_FOLDER_REAL_PATH = new Path("/WebModule1/WebContent/"+TEST_FOLDER_NAME); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path WEBINF_FOLDER_RUNTIME_PATH = new Path("/"+TEST_FOLDER_NAME); //$NON-NLS-1$
-
- public static final Path TESTDATA_FOLDER_REAL_PATH = new Path("WebModule1/testdata"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path TESTDATA_FOLDER_RUNTIME_PATH = new Path("/"); //$NON-NLS-1$
-
- protected static final IPath DELETEME_PATH = new Path("/deleteme"); //$NON-NLS-1$
-
- protected IVirtualComponent component;
-
- protected IVirtualFolder webInfFolder;
- protected IFolder realWebInfFolder;
-
- protected IVirtualFolder deletemeVirtualFolder;
- protected IFolder deletemeFolder;
-
- protected IVirtualFolder testdataFolder;
- protected IFolder realTestdataFolder;
-
-
-
- public BaseVirtualTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- TestWorkspace.init();
-
- realWebInfFolder = TEST_PROJECT.getFolder(WEBINF_FOLDER_REAL_PATH);
-
- component = ComponentCore.createComponent(TEST_PROJECT, TestWorkspace.WEB_MODULE_1_NAME);
- webInfFolder = component.getFolder(WEBINF_FOLDER_RUNTIME_PATH);
-
- testdataFolder = component.getFolder(TESTDATA_FOLDER_RUNTIME_PATH);
- realTestdataFolder = TEST_PROJECT.getFolder(TESTDATA_FOLDER_REAL_PATH);
-
- deletemeVirtualFolder = component.getFolder(DELETEME_PATH);
- deletemeVirtualFolder.create(IVirtualResource.FORCE, null);
-
- deletemeFolder = deletemeVirtualFolder.getUnderlyingFolder();
-
- }
-
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- if(deletemeFolder.exists())
- deletemeFolder.delete(IVirtualResource.FORCE, null);
-
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ComponentCoreTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ComponentCoreTest.java
deleted file mode 100644
index 6ff34d2..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ComponentCoreTest.java
+++ /dev/null
@@ -1,116 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-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.emf.common.util.URI;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class ComponentCoreTest extends TestCase {
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
-
-
- // /This should be extracted out, dont have time, just trying to get coverage
- // for m4 integration....
-
- protected void setUp() throws Exception {
- if (!getTargetProject().exists())
- if (!createProject())
- fail();
- project = getTargetProject();
- }
-
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
- public void testCreateFlexibleProject() {
- try {
- ComponentCore.createFlexibleProject(project);
- } catch (Exception e) {
- fail(e.toString());
- };
-
- }
-
- public void testCreateComponent() {
- try {
- new ComponentCore();
- ComponentCore.createComponent(project, "test");
-
- } catch (Exception e) {
- fail(e.toString());
- };
- }
-
- public void testCreateFolder() {
- try {
- ComponentCore.createFolder(project, "test", new Path("test/runtimePath"));
- } catch (Exception e) {
- fail(e.toString());
- };
- }
-
- public void testCreateFile() {
- try {
- ComponentCore.createFile(project, "test", new Path("test/runtimePath/file"));
- } catch (Exception e) {
- fail(e.toString());
- };
- }
-
- public void testCreateReference() {
- IVirtualComponent container = new VirtualComponent(project, "test", new Path("test/runtimePath/file"));
-
- try {
- ComponentCore.createReference(container,container);
- } catch (Exception e) {
- fail(e.toString());
- };
- }
- public void testCreateResources() {
- IResource res = project.getFile(new Path("WebModule1/WebContent/WEB-INF/web.xml"));
-
- try {
- ComponentCore.createResources(res);
- } catch (Exception e) {
- fail(e.toString());
- };
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IEditModelHandlerTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IEditModelHandlerTest.java
deleted file mode 100644
index 1b53254..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IEditModelHandlerTest.java
+++ /dev/null
@@ -1,39 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.componentcore.IEditModelHandler;
-
-public class IEditModelHandlerTest extends TestCase {
- public class EditModelHandlerTest implements IEditModelHandler {
- public EditModelHandlerTest() {
- }
-
- public void save(IProgressMonitor aMonitor) {
- }
-
- public void saveIfNecessary(IProgressMonitor aMonitor) {
- }
-
- public void dispose() {
- }
- }
-
- public void testSave() {
- IEditModelHandler handler = new EditModelHandlerTest();
- handler.save(null);
- }
-
- public void testSaveIfNecessary() {
- IEditModelHandler handler = new EditModelHandlerTest();
- handler.saveIfNecessary(null);
-
- }
-
- public void testDispose() {
- IEditModelHandler handler = new EditModelHandlerTest();
- handler.dispose();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IFlexibleProjectTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IFlexibleProjectTest.java
deleted file mode 100644
index d05bdf2..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IFlexibleProjectTest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.componentcore.resources.IFlexibleProject;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-
-
-
-public class IFlexibleProjectTest extends TestCase {
- public class FlexProjectTest implements IFlexibleProject {
- public FlexProjectTest() {
- }
-
- public IVirtualComponent[] getComponents() {
- return null;
- }
-
- public IVirtualComponent getComponent(String aComponentName) {
- return null;
- }
-
- public IProject getProject() {
- return null;
- }
-
- public boolean isFlexible() {
- // TODO Auto-generated method stub
- return false;
- }
-
- public void create(int theFlags, IProgressMonitor aMonitor) {
- // TODO Auto-generated method stub
-
- }
- }
-
- public void testGetComponents() {
- IFlexibleProject flex = new FlexProjectTest();
- flex.getComponents();
- }
-
- public void testGetComponent() {
- IFlexibleProject flex = new FlexProjectTest();
- flex.getComponent(null);
- }
-
- public void testGetProject() {
- IFlexibleProject flex = new FlexProjectTest();
- flex.getProject();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualComponentAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualComponentAPITest.java
deleted file mode 100644
index 6317026..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualComponentAPITest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import java.util.Properties;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualComponentAPITest extends BaseVirtualTest {
-
- public IVirtualComponentAPITest(String name) {
- super(name);
- // TODO Auto-generated constructor stub
- }
-
- public void testGetName() {
-
- String name = component.getName();
- }
-
- public void testGetComponentTypeId() {
- String id = component.getComponentTypeId() ;
- }
-
- public void testSetComponentTypeId() {
- String id = "jst.ejb";
- component.setComponentTypeId(id) ;
- }
-
- public void testGetMetaProperties() {
- Properties properties = component.getMetaProperties() ;
- }
-
- public void testGetMetaResources() {
- IPath[] metaresources = component.getMetaResources() ;
-
- }
-
- public void testSetMetaResources() {
-
- IPath[] metaresources = new IPath[1];
- metaresources[0] = new Path("/test");
- component.setMetaResources(metaresources) ;
-
- }
-
- public void testGetResources() {
- String resource = "/test";
- IVirtualResource[] virtualResource = component.getResources(resource) ;
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualContainerTestAPI.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualContainerTestAPI.java
deleted file mode 100644
index 3c8894a..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualContainerTestAPI.java
+++ /dev/null
@@ -1,101 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualContainerTestAPI extends BaseVirtualTest {
-
- protected IVirtualContainer deletemeVirtualFolder2;
- protected static final IPath DELETEME_PATH2 = new Path("/deleteme2"); //$NON-NLS-1$
-
- public IVirtualContainerTestAPI(String name) {
- super(name);
- }
-
-
- public void test_create()
- throws CoreException {
- deletemeVirtualFolder2 = component.getFolder(DELETEME_PATH2);
- deletemeVirtualFolder2.create(IVirtualResource.FORCE, null);
- deletemeVirtualFolder2.delete(IVirtualResource.FORCE, null);
- }
-
- public void test_exists() {
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IPath path = new Path("/deleteme");
- boolean bRetValue = container.exists(path);
- }
-
- public void test_findMember() {
- String name = "lib";
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource resource= container.findMember(name);
-
- }
-
- public void test_findMember2() {
- String name = "lib";
- int searchFlags = 0;
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource resource= container.findMember(name,searchFlags);
- }
-
- public void test_findMember3() {
- IPath path = new Path("/lib");
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource resource= container.findMember(path);
-
- }
-
- public void test_findMember4() {
- IPath path = new Path("/lib");
- int searchFlags = 0;
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource resource= container.findMember(path,searchFlags);
- }
-
-
-
- public void test_getFile() {
- IPath path = new Path("/deleteme");
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource resource= container.getFile(path);
- }
-
- public void test_getFolder() {
- IPath path = new Path("/deleteme");
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource resource= container.getFolder(path);
- }
-
- public void test_getFile2() {
- String name = "/deleteme";
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource resource= container.getFile(name);
- }
-
- public void test_getFolder2() {
- String name = "/deleteme";
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource resource= container.getFolder(name);
- }
-
- public void test_members() throws CoreException {
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- IVirtualResource[] resource= container.members();
- }
-
- public void members() throws CoreException {
- IVirtualContainer container = (IVirtualContainer)webInfFolder;
- int memberFlags = 0;
- IVirtualResource[] resource= container.members(memberFlags);
-
-
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFileAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFileAPITest.java
deleted file mode 100644
index ac6dfed..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFileAPITest.java
+++ /dev/null
@@ -1,54 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-
-public class IVirtualFileAPITest extends BaseVirtualTest {
-
- protected IVirtualFile testFile1;
- protected IFile realTestFile1;
- public static final Path TEST_FILE_REAL_PATH = new Path("WebModule1/testdata/TestFile1.txt"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path TEST_FILE_RUNTIME_PATH = new Path("/"); //$NON-NLS-1$
-
-
- public IVirtualFileAPITest(String name) {
- super(name);
-
- }
- protected void setUp() throws Exception {
- // TODO Auto-generated method stub
- super.setUp();
- testFile1 = component.getFile(TESTDATA_FOLDER_RUNTIME_PATH);
- realTestFile1 = TEST_PROJECT.getFile(TESTDATA_FOLDER_REAL_PATH);
-
- }
-
- public void testGetUnderlyingFile() {
- IFile file = testFile1.getUnderlyingFile();
- }
-
- public void testGetUnderlyingFiles() {
- IFile[] file = testFile1.getUnderlyingFiles();
- }
-
- public void testIsAccessible() throws CoreException {
- assertEquals(((IVirtualResource)deletemeVirtualFolder).isAccessible(),true);
- ((IVirtualResource)deletemeVirtualFolder).delete(IVirtualResource.FORCE, null);
- //assertEquals(deletemeVirtualFolder.isAccessible(),false);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFolderAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFolderAPITest.java
deleted file mode 100644
index c8425fd..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualFolderAPITest.java
+++ /dev/null
@@ -1,230 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualFolderAPITest extends TestCase {
-
- public static final IProject TEST_PROJECT = ResourcesPlugin.getWorkspace().getRoot().getProject(TestWorkspace.PROJECT_NAME);
-
- public static final String TEST_FOLDER_NAME = "WEB-INF"; //$NON-NLS-1$
-
- public static final Path WEBINF_FOLDER_REAL_PATH = new Path("/WebModule1/WebContent/"+TEST_FOLDER_NAME); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path WEBINF_FOLDER_RUNTIME_PATH = new Path("/"+TEST_FOLDER_NAME); //$NON-NLS-1$
-
- public static final Path TESTDATA_FOLDER_REAL_PATH = new Path("WebModule1/testdata"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final Path TESTDATA_FOLDER_RUNTIME_PATH = new Path("/"); //$NON-NLS-1$
-
- private static final IPath DELETEME_PATH = new Path("/deleteme"); //$NON-NLS-1$
-
- private IVirtualComponent component;
-
- private IVirtualFolder webInfFolder;
- private IFolder realWebInfFolder;
-
- private IVirtualFolder deletemeVirtualFolder;
- private IFolder deletemeFolder;
-
- private IVirtualFolder testdataFolder;
- private IFolder realTestdataFolder;
-
- public IVirtualFolderAPITest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- TestWorkspace.init();
-
- realWebInfFolder = TEST_PROJECT.getFolder(WEBINF_FOLDER_REAL_PATH);
-
- component = ComponentCore.createComponent(TEST_PROJECT, TestWorkspace.WEB_MODULE_1_NAME);
- webInfFolder = component.getFolder(WEBINF_FOLDER_RUNTIME_PATH);
-
- testdataFolder = component.getFolder(TESTDATA_FOLDER_RUNTIME_PATH);
- realTestdataFolder = TEST_PROJECT.getFolder(TESTDATA_FOLDER_REAL_PATH);
-
- deletemeVirtualFolder = component.getFolder(DELETEME_PATH);
- deletemeVirtualFolder.create(IVirtualResource.FORCE, null);
-
- deletemeFolder = deletemeVirtualFolder.getUnderlyingFolder();
-
- }
-
- public void testDelete() throws CoreException {
- assertEquals(((IVirtualResource)deletemeVirtualFolder).exists(),true);
- ((IVirtualResource)deletemeVirtualFolder).delete(IVirtualResource.FORCE, null);
- // assertEquals(deletemeFolder.exists(),false);
-
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- if(deletemeFolder.exists())
- deletemeFolder.delete(IVirtualResource.FORCE, null);
-
- }
-
- public void testGetFileExtension() {
- assertTrue("The /WEB-INF folder should have no file extension.", ((IVirtualResource)webInfFolder).getFileExtension() == null); //$NON-NLS-1$
- }
-
- public void testGetUnderlyingFolders() {
- IFolder[] deletemeFolder = deletemeVirtualFolder.getUnderlyingFolders();
- assertEquals(deletemeFolder.length==1,true);
- }
-
- public void testGetUnderlyingResources() {
- IResource[] deletemeFolder = ((IVirtualResource)deletemeVirtualFolder).getUnderlyingResources();
- assertEquals(deletemeFolder.length==1,true);
- }
-
-
- public void testGetUnderlyingFolder() {
- IFolder deletemeFolder = deletemeVirtualFolder.getUnderlyingFolder();
- assertNotNull(deletemeFolder);
- }
-
- public void testGetUnderlyingResource() {
- IResource deletemeFolder = ((IVirtualResource)deletemeVirtualFolder).getUnderlyingResource();
- assertNotNull(deletemeFolder);
- }
-
- public void testGetWorkspaceRelativePath() {
- IPath realPath = realWebInfFolder.getFullPath();
- IPath virtualPath = ((IVirtualResource)webInfFolder).getWorkspaceRelativePath();
- assertEquals("The workspace relative path of the virtual resource must match the real resource", realPath, virtualPath); //$NON-NLS-1$
-
- }
-
- public void testGetComponent() {
- assertNotNull(((IVirtualResource)webInfFolder).getComponent()); //$NON-NLS-1$
- }
-
- public void testGetProjectRelativePath() {
- IPath realPath = realWebInfFolder.getProjectRelativePath();
- IPath virtualPath = webInfFolder.getProjectRelativePath();
- assertEquals("The project relative path of the virtual resource must match the real resource", realPath, virtualPath); //$NON-NLS-1$
- }
-
- public void testGetRuntimePath() {
- IPath virtualPath = ((IVirtualResource)webInfFolder).getRuntimePath();
- assertEquals("The runtime path of the virtual resource must match the real resource", WEBINF_FOLDER_RUNTIME_PATH, virtualPath); //$NON-NLS-1$
-
- }
-
- public void testGetName() {
- assertEquals("The name of the virtual resource must match the expected name.", TEST_FOLDER_NAME, webInfFolder.getName()); //$NON-NLS-1$
- }
-
- public void testGetParent() {
- assertEquals("The parent of the virtual resource must match the component.", component, ((IVirtualResource)webInfFolder).getParent()); //$NON-NLS-1$
- }
-
- public void testEquals() {
- IVirtualResource resource = ((IVirtualResource)webInfFolder).getParent();
- boolean bRetValue = resource.equals(component);
- assertTrue(bRetValue);
- }
-
- public void testGetProject() {
- assertEquals("The project of the virtual resource must match the test project.", TEST_PROJECT, ((IVirtualResource)webInfFolder).getProject()); //$NON-NLS-1$
- }
-
- public void testGetType() {
- assertEquals("The type of the virtual resource must match the type of the test project.", IVirtualResource.FOLDER, ((IVirtualResource)webInfFolder).getType()); //$NON-NLS-1$
- }
-
-
- /*public void testGetFilePath() {
- IVirtualFile test3jsp = testdataFolder.getFile(new Path("/jsps/TestJsp3.jsp"));
-
- IPath expectedPath = TESTDATA_FOLDER_REAL_PATH.append(new Path("/jsps/TestJsp3.jsp"));
- assertEquals("The test file project relative path must match.", expectedPath, test3jsp.getProjectRelativePath()); //$NON-NLS-1$
- }*/
-
-
-
- /*
- * Class under test for void delete(int, IProgressMonitor)
- */
- /*public void testDeleteintIProgressMonitor() throws Exception {
- deletemeVirtualFolder.delete(0, null);
-
- assertTrue("The real folder should be deleted when IVirtualResource.DELETE_METAMODEL_ONLY is NOT supplied.", !deletemeFolder.exists()); //$NON-NLS-1$
-
- IVirtualResource[] members = component.members();
-
- for (int i = 0; i < members.length; i++) {
- if(members[i].getRuntimePath().equals(deletemeVirtualFolder.getRuntimePath())) {
- fail("Found deleted folder in members()"); //$NON-NLS-1$
- }
- }
- }*/
-
- /*
- * Class under test for void delete(int, IProgressMonitor)
- */
- /*public void testDeleteintIProgressMonitor2() throws Exception {
- deletemeVirtualFolder.delete(IVirtualResource.IGNORE_UNDERLYING_RESOURCE, null);
-
- assertTrue("The real folder should not be deleted when IVirtualResource.DELETE_METAMODEL_ONLY is supplied.", deletemeFolder.exists()); //$NON-NLS-1$
-
- // only handles explicit mappings
- StructureEdit moduleCore = null;
- try {
- URI runtimeURI = URI.createURI(deletemeVirtualFolder.getRuntimePath().toString());
- moduleCore = StructureEdit.getStructureEditForWrite(TEST_PROJECT);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(TestWorkspace.WEB_MODULE_1_NAME);
- ComponentResource[] resources = wbComponent.findWorkbenchModuleResourceByDeployPath(runtimeURI);
- assertTrue("There should be no matching components found in the model.", resources.length == 0); //$NON-NLS-1$
-
- } finally {
- if (moduleCore != null) {
- moduleCore.saveIfNecessary(null);
- moduleCore.dispose();
- }
- }
- }*/
-
- /*
- * Class under test for void delete(boolean, IProgressMonitor)
- */
- /*public void testDeletebooleanIProgressMonitor() throws Exception {
- deletemeVirtualFolder.delete(IVirtualResource.FORCE, null);
-
- assertTrue("The real folder should be deleted when IVirtualResource.DELETE_METAMODEL_ONLY is NOT supplied.", !deletemeFolder.exists()); //$NON-NLS-1$
-
- IVirtualResource[] members = component.members();
-
- for (int i = 0; i < members.length; i++) {
- if(members[i].getRuntimePath().equals(deletemeVirtualFolder.getRuntimePath())) {
- fail("Found deleted folder in members()"); //$NON-NLS-1$
- }
- }
- } */
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualReferenceAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualReferenceAPITest.java
deleted file mode 100644
index 18a1013..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/IVirtualReferenceAPITest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-
-public class IVirtualReferenceAPITest extends TestCase {
-
- public static void main(String[] args) {
- }
-
- public void testCreate() {
- IVirtualReference reference = new VirtualReference();
- reference.create(0,null);
-
- }
-
- public void testSetRuntimePath() {
- IVirtualReference reference = new VirtualReference();
- reference.setRuntimePath(new Path("/"));
- }
-
- public void testGetRuntimePath() {
- IVirtualReference reference = new VirtualReference();
- IPath path = reference.getRuntimePath();
- }
-
- public void testSetDependencyType() {
- IVirtualReference reference = new VirtualReference();
- int dependencyType = 0;
- reference.setDependencyType(dependencyType);
- }
-
- public void testGetDependencyType() {
- IVirtualReference reference = new VirtualReference();
- int dependencyType = 0;
- dependencyType = reference.getDependencyType();
- }
-
- public void testExists() {
- IVirtualReference reference = new VirtualReference();
- boolean exists = reference.exists();
- }
-
- public void testGetEnclosingComponent() {
- IVirtualReference reference = new VirtualReference();
- IVirtualComponent component = reference.getEnclosingComponent();
- }
-
- public void testGetReferencedComponent() {
- IVirtualReference reference = new VirtualReference();
- IVirtualComponent component = reference.getReferencedComponent();
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreAPIFVTTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreAPIFVTTest.java
deleted file mode 100644
index 468f084..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreAPIFVTTest.java
+++ /dev/null
@@ -1,361 +0,0 @@
-/***************************************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others. All rights reserved. This program and the
- * accompanying materials are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors: IBM Corporation - initial API and implementation
- **************************************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.internal.impl.ResourceTreeNode;
-import org.eclipse.wst.common.componentcore.internal.impl.ResourceTreeRoot;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-import org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests.TestWorkspace;
-
-/**
- *
- * <p>
- * To run this test, extract the /testData/virtual-api-test_workspace.zip found under the same
- * plugin, and use "Run As -> JUnit Plugin Test". Be sure to point the configuration at the
- * extracted workspace, and make sure that "Clear workspace contents" is NOT checked. The test may
- * be run using a Headless Eclipse.
- * </p>
- */
-public class ModuleCoreAPIFVTTest extends TestCase {
-
- private static final Class IFOLDER_CLASS = IVirtualFolder.class;
- private static final Class IFILE_CLASS = IVirtualFile.class;
-
- private final Map virtualResourceTree = new HashMap();
- private static final Map IGNORE = new HashMap();
-
-
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTestSuite(ModuleCoreAPIFVTTest.class);
- return suite;
- }
-
- public ModuleCoreAPIFVTTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- setupNavigateComponentTest();
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- tearDownCreateNewModuleTest();
- tearDownCreateLinkTest();
- }
-
- public void tearDownCreateNewModuleTest() throws Exception {
- IFolder rootFolder = TestWorkspace.getTargetProject().getFolder(TestWorkspace.NEW_WEB_MODULE_NAME);
- if (rootFolder.exists())
- rootFolder.delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, null);
-
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(TestWorkspace.NEW_WEB_MODULE_NAME);
-
- if (wbComponent != null) {
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/")); //$NON-NLS-1$
-
- for (int i = 0; i < componentResources.length; i++) {
- wbComponent.getResources().remove(componentResources[i]);
- }
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.save(null);
- moduleCore.dispose();
- }
- }
-
- }
-
- /**
- * Create a Map structure that mimics the expected structure on disk.
- */
- public void setupNavigateComponentTest() throws Exception {
- IPath images;
- IPath jsps;
- IPath WEB_INF;
- TestWorkspace.init();
- virtualResourceTree.put((images = new Path("images")), new HashMap()); //$NON-NLS-1$
- virtualResourceTree.put((jsps = new Path("jsps")), new HashMap()); //$NON-NLS-1$
- virtualResourceTree.put(new Path(TestWorkspace.META_INF), new HashMap()); //$NON-NLS-1$
- virtualResourceTree.put((WEB_INF = new Path(TestWorkspace.WEB_INF)), new HashMap()); //$NON-NLS-1$
- virtualResourceTree.put(new Path("TestFile1.txt"), null); //$NON-NLS-1$
- virtualResourceTree.put(new Path("TestFile2.txt"), null); //$NON-NLS-1$
-
- ((Map) virtualResourceTree.get(images)).put(new Path("icon.gif"), null); //$NON-NLS-1$
-
- ((Map) virtualResourceTree.get(jsps)).put(new Path("TestJsp1.jsp"), null); //$NON-NLS-1$
- ((Map) virtualResourceTree.get(jsps)).put(new Path("TestJsp2.jsp"), null); //$NON-NLS-1$
- ((Map) virtualResourceTree.get(jsps)).put(new Path("TestJsp3.jsp"), null); //$NON-NLS-1$
-
- ((Map) virtualResourceTree.get(WEB_INF)).put(new Path("web.xml"), null); //$NON-NLS-1$
- ((Map) virtualResourceTree.get(WEB_INF)).put(new Path("classes"), IGNORE); //$NON-NLS-1$
- ((Map) virtualResourceTree.get(WEB_INF)).put(new Path("lib"), new HashMap()); //$NON-NLS-1$
- }
-
- /**
- * Checks for and removes the mapping and folder that will be created by
- * {@link ModuleCoreAPIFVTTest#testCreateLink()}.
- */
- public void tearDownCreateLinkTest() throws Exception {
- IFolder module2Images = TestWorkspace.getTargetProject().getFolder(new Path("/WebModule2/images")); //$NON-NLS-1$
- if (module2Images.exists())
- module2Images.delete(IResource.FORCE | IResource.ALWAYS_DELETE_PROJECT_CONTENT, null);
-
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(TestWorkspace.WEB_MODULE_2_NAME);
-
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/images")); //$NON-NLS-1$
-
- for (int i = 0; i < componentResources.length; i++) {
- wbComponent.getResources().remove(componentResources[i]);
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.save(null);
- moduleCore.dispose();
- }
- }
- }
-
-
- public void assertTree(Map resourceTree, IVirtualFolder virtualFolder) throws Exception {
- assertTree(resourceTree, virtualFolder, ""); //$NON-NLS-1$
- }
-
- /**
- * <p>
- * All methods lised in the "see" clauses are tested by this method.
- * </p>
- *
- * @see IContainer#members()
- * @see IResource#getName()
- *
- * @param resourceTree
- * @param virtualFolder
- * @param indent
- */
- public void assertTree(Map resourceTree, IVirtualFolder virtualFolder, String indent) throws Exception {
- // API_TEST VirtualContainer.members()
- IVirtualResource[] members = virtualFolder.members();
-
- assertEquals("The number of resources contained by \"" + virtualFolder.getProjectRelativePath() + "\"", //$NON-NLS-1$ //$NON-NLS-2$
- resourceTree.size(), members.length);
- IPath relativePath;
- Map subTree;
- for (int i = 0; i < members.length; i++) {
- System.out.println(indent + members[i]);
- relativePath = new Path(members[i].getName());
-
- subTree = (Map) resourceTree.get(relativePath);
- if (subTree != null) {
- assertType(members[i], IFOLDER_CLASS);
- if (subTree != IGNORE)
- assertTree(subTree, (IVirtualFolder) members[i], indent + "\t"); //$NON-NLS-1$
- } else {
- assertType(members[i], IFILE_CLASS);
- }
- }
- }
-
- /**
- */
- public void assertType(IVirtualResource resource, Class type) {
- assertTrue("Expected a(n) " + type.getName() + " for member: " + resource.getProjectRelativePath(), //$NON-NLS-1$ //$NON-NLS-2$
- type.isInstance(resource));
- }
-
- /**
- * <p>
- * All methods lised in the "see" clauses are tested by this method.
- * </p>
- *
- * @see ComponentCore#createComponent(IProject, String)
- * @see IContainer#getFolder(org.eclipse.core.runtime.IPath)
- * @see IContainer#members()
- */
- public void testNavigateComponent() throws Exception {
-
- IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.getTargetProject(), TestWorkspace.WEB_MODULE_1_NAME);
- IVirtualFolder root = component.getFolder(new Path("/")); //$NON-NLS-1$
- // TODO
- //assertTree(virtualResourceTree, root);
-
- }
-
-
- /**
- * <p>
- * All methods lised in the "see" clauses are tested by this method.
- * </p>
- *
- * @see ComponentCore#createComponent(IProject, String)
- * @see IContainer#getFolder(org.eclipse.core.runtime.IPath)
- * @see IFolder#createLink(org.eclipse.core.runtime.IPath, int,
- * org.eclipse.core.runtime.IProgressMonitor)
- *
- */
- public void testCreateLink() throws Exception {
-
- IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.getTargetProject(), TestWorkspace.WEB_MODULE_2_NAME);
- IVirtualFolder images = component.getFolder(new Path("/images")); //$NON-NLS-1$
- ((IVirtualResource)images).createLink(new Path("/WebModule2/images"), 0, null); //$NON-NLS-1$
-
- IFolder realImages = TestWorkspace.getTargetProject().getFolder(new Path("/WebModule2/images")); //$NON-NLS-1$
- assertTrue("The /WebContent2/images directory must exist.", realImages.exists()); //$NON-NLS-1$
-
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(TestWorkspace.WEB_MODULE_2_NAME);
-
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/images")); //$NON-NLS-1$
-
- assertTrue("There should be at least one mapping for virtual path \"/images\".", componentResources.length > 0); //$NON-NLS-1$
-
- ResourceTreeRoot resourceTreeRoot = ResourceTreeRoot.getSourceResourceTreeRoot(wbComponent);
- componentResources = resourceTreeRoot.findModuleResources(realImages.getProjectRelativePath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + realImages.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/images\".", componentResources[0].getRuntimePath().toString().equals("/images")); //$NON-NLS-1$ //$NON-NLS-2$
-
- // make sure that only one component resource is created
-
- images.createLink(new Path("/WebModule2/images"), 0, null); //$NON-NLS-1$
-
- componentResources = resourceTreeRoot.findModuleResources(realImages.getProjectRelativePath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + realImages.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/images\".", componentResources[0].getRuntimePath().toString().equals("/images")); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- if (moduleCore != null)
- moduleCore.dispose();
- }
-
- }
-
- /**
- * <p>
- * All methods lised in the "see" clauses are tested by this method.
- * </p>
- *
- * @see ComponentCore#createComponent(IProject, String)
- * @see IContainer#getFolder(org.eclipse.core.runtime.IPath)
- * @see IFolder#createLink(org.eclipse.core.runtime.IPath, int,
- * org.eclipse.core.runtime.IProgressMonitor)
- *
- */
- public void testCreateWebModule() throws Exception {
-
- IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.getTargetProject(), TestWorkspace.NEW_WEB_MODULE_NAME);
- // if(!component.exists())
- component.create(0, null);
- IVirtualFolder root = component.getFolder(new Path("/")); //$NON-NLS-1$
- IPath realWebContentPath = new Path(TestWorkspace.NEW_WEB_MODULE_NAME + IPath.SEPARATOR + "WebContent"); //$NON-NLS-1$
- root.createLink(realWebContentPath, 0, null); //$NON-NLS-1$
-
- IVirtualFolder metaInfFolder = root.getFolder(TestWorkspace.META_INF);
- metaInfFolder.create(IVirtualResource.FORCE, null);
-
- IVirtualFolder webInfFolder = root.getFolder(TestWorkspace.WEB_INF);
- webInfFolder.create(IVirtualResource.FORCE, null);
-
- IFolder realWebContent = TestWorkspace.getTargetProject().getFolder(realWebContentPath);
- assertTrue("The " + realWebContent + " directory must exist.", realWebContent.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-
- IFolder realMetaInfFolder = realWebContent.getFolder(TestWorkspace.META_INF);
- assertTrue("The " + realMetaInfFolder + " directory must exist.", realMetaInfFolder.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-
- IFolder realWebInfFolder = realWebContent.getFolder(TestWorkspace.WEB_INF);
- assertTrue("The " + realWebInfFolder + " directory must exist.", realWebInfFolder.exists()); //$NON-NLS-1$ //$NON-NLS-2$
-
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(TestWorkspace.NEW_WEB_MODULE_NAME);
-
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/" + TestWorkspace.META_INF)); //$NON-NLS-1$
-
- assertTrue("There should be at least one mapping for virtual path \"/" + TestWorkspace.META_INF + "\".", componentResources.length > 0); //$NON-NLS-1$ //$NON-NLS-2$
-
- ResourceTreeRoot resourceTreeRoot = ResourceTreeRoot.getSourceResourceTreeRoot(wbComponent);
- componentResources = resourceTreeRoot.findModuleResources(metaInfFolder.getProjectRelativePath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + metaInfFolder.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/" + TestWorkspace.META_INF + "\".", componentResources[0].getRuntimePath().toString().equals("/" + TestWorkspace.META_INF)); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-
- // try to force duplicate mappings
- metaInfFolder.create(IVirtualResource.FORCE, null);
- webInfFolder.create(IVirtualResource.FORCE, null);
-
- // ensure that multiple mappings aren't added
-
- assertTrue("The mapping should not be duplicated.", !isDuplicated(wbComponent, metaInfFolder.getRuntimePath())); //$NON-NLS-1$
- assertTrue("The mapping should not be duplicated.", !isDuplicated(wbComponent, webInfFolder.getRuntimePath())); //$NON-NLS-1$
- } finally {
- if (moduleCore != null)
- moduleCore.dispose();
- }
-
- }
-
- private boolean isDuplicated(WorkbenchComponent wbComponent, IPath runtimePath) {
-
- URI runtimeURI = URI.createURI(runtimePath.toString());
- boolean found = false;
- List resourceList = wbComponent.getResources();
- for (Iterator iter = resourceList.iterator(); iter.hasNext();) {
- ComponentResource resource = (ComponentResource) iter.next();
- if(resource.getRuntimePath().equals(runtimeURI))
- if(found)
- return true;
- else
- found = true;
- }
- return false;
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreNatureAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreNatureAPITest.java
deleted file mode 100644
index 057cce4..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreNatureAPITest.java
+++ /dev/null
@@ -1,180 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.emf.ecore.resource.ResourceSet;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.jem.util.emf.workbench.EMFWorkbenchContextBase;
-import org.eclipse.wst.common.componentcore.ModuleCoreNature;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ArtifactEditModel;
-import org.eclipse.wst.common.componentcore.internal.util.IModuleConstants;
-import org.eclipse.wst.common.internal.emfworkbench.integration.EditModel;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class ModuleCoreNatureAPITest extends TestCase {
-
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
-
-
- // /This should be extracted out, dont have time, just trying to get coverage
- // for m4 integration....
-
- protected void setUp() throws Exception {
- if (!getTargetProject().exists())
- if (!createProject())
- fail();
- project = getTargetProject();
- }
-
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-
- public void testConfigure() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- try {
- nature.configure();
- } catch (CoreException e) {
- e.printStackTrace();
- fail();
- }
- }
-
- public void testGetModuleCoreNature() {
- new ModuleCoreNature();
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- assertNotNull(nature);
- }
-
-
-
- public void testGetModuleStructuralModelForRead() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- nature.getModuleStructuralModelForRead(this);
- ArtifactEditModel model = nature.getArtifactEditModelForRead(moduleURI, this);
- assertNotNull(model);
- }
-
- public void testGetModuleStructuralModelForWrite() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- ArtifactEditModel model = nature.getArtifactEditModelForWrite(moduleURI, this);
- assertNotNull(model);
- }
-
- public void testGetArtifactEditModelForRead() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- EditModel model = nature.getEditModelForRead(EDIT_MODEL_ID, this);
- assertNotNull(model);
- }
-
- public void testGetArtifactEditModelForWrite() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- EditModel model = nature.getEditModelForWrite(EDIT_MODEL_ID, this);
- assertNotNull(model);
- }
-
- /*
- * Class under test for String getNatureID()
- */
- public void testGetNatureID() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- String id = nature.getNatureID();
- assertTrue(id.equals(IModuleConstants.MODULE_NATURE_ID));
- }
-
- public void testPrimaryContributeToContext() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- EMFWorkbenchContextBase context = new EMFWorkbenchContextBase(project);
- try {
- nature.primaryContributeToContext(context);
- } catch (Exception e) {
- fail();
- }
-
- }
-
- /*
- * Class under test for ResourceSet getResourceSet()
- */
- public void testGetResourceSet() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- ResourceSet set = nature.getResourceSet();
- assertNotNull(set);
- }
-
- public void testSecondaryContributeToContext() {
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- EMFWorkbenchContextBase context = new EMFWorkbenchContextBase(project);
- try {
- nature.secondaryContributeToContext(context);
- } catch (Exception e) {
- fail();
- }
- }
-
- /*
- * Class under test for String getPluginID()
- */
- public void testGetPluginID() {
- // protected cant test unless in same package....
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
-
- }
-
- public void testAddModuleCoreNatureIfNecessary() {
- try {
- project.getDescription().setNatureIds(new String[0]);
- } catch (CoreException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- ModuleCoreNature.addModuleCoreNatureIfNecessary(project, new NullProgressMonitor());
- ModuleCoreNature nature = ModuleCoreNature.getModuleCoreNature(project);
- assertNotNull(nature);
- }
-
- public void testUnresolveableURIException() {
- UnresolveableURIException uriEx = new UnresolveableURIException(moduleURI);
- assertNotNull(uriEx);
- }
-
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreURIConverterUnitTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreURIConverterUnitTest.java
deleted file mode 100644
index 8b377ea..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/ModuleCoreURIConverterUnitTest.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
-
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.componentcore.internal.impl.ComponentCoreURIConverter;
-import org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests.TestWorkspace;
-
-public class ModuleCoreURIConverterUnitTest extends TestCase {
-
- public static Test suite() {
- TestSuite suite = new TestSuite();
- suite.addTestSuite(ModuleCoreURIConverterUnitTest.class);
- return suite;
- }
-
- public ModuleCoreURIConverterUnitTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- TestWorkspace.init();
- }
-
- public void testNormalizeDDURI() throws Exception {
-
- ComponentCoreURIConverter converter = new ComponentCoreURIConverter(TestWorkspace.getTargetProject());
-
- URI inputURI = URI.createURI("module:/resource/TestVirtualAPI/WebModule2/WEB-INF/web.xml"); //$NON-NLS-1$
-
- URI resultURI = converter.normalize(inputURI);
-
- URI expectedURI = URI.createURI("platform:/resource/TestVirtualAPI/WebModule2/WebContent/WEB-INF/web.xml"); //$NON-NLS-1$
- // TODO
- //assertEquals("The resultant URI must match the expected URI", expectedURI, resultURI); //$NON-NLS-1$
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditAPITest.java
deleted file mode 100644
index ea0e5ef..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/StructureEditAPITest.java
+++ /dev/null
@@ -1,630 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.ModuleStructuralModel;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualComponent;
-import org.eclipse.wst.common.internal.emfworkbench.EMFWorkbenchContext;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class StructureEditAPITest extends TestCase {
- public static String fileSep = System.getProperty("file.separator");
- public static final String PROJECT_NAME = "TestArtifactEdit";
- public static final String WEB_MODULE_NAME = "WebModule1";
- public static final URI moduleURI = URI.createURI("module:/resource/TestArtifactEdit/WebModule1");
- public static final String EDIT_MODEL_ID = "jst.web";
- private Path zipFilePath = new Path("TestData" + fileSep + "TestArtifactEdit.zip");
- private IProject project;
-
-
- // /This should be extracted out, dont have time, just trying to get coverage
- // for m4 integration....
-
- protected void setUp() throws Exception {
- if (!getTargetProject().exists())
- if (!createProject())
- fail();
- project = getTargetProject();
- }
-
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-
- public void testGetStructureEditForRead() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testGetStructureEditForWrite() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testGetModuleCoreNature() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- try {
- moduleCore.getModuleCoreNature(moduleURI);
- } catch (UnresolveableURIException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- /*
- * Class under test for IProject getContainingProject(WorkbenchComponent)
- */
- public void testGetContainingProjectWorkbenchComponent() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- moduleCore.getContainingProject(wbComponent);
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- /*
- * Class under test for IProject getContainingProject(URI)
- */
- public void testGetContainingProjectURI() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- try {
- moduleCore.getContainingProject(moduleURI);
- } catch (UnresolveableURIException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testGetEclipseResource() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
- moduleCore.getEclipseResource(componentResource);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testGetOutputContainerRoot() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
- StructureEdit.getOutputContainerRoot(wbComponent);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
- }
- }
-
- public void testGetOutputContainersForProject() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
- StructureEdit.getOutputContainersForProject(project);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
- }
- }
-
- public void testGetDeployedName() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
- try {
- StructureEdit.getDeployedName(moduleURI);
- } catch (UnresolveableURIException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
- }
- }
-
- public void testGetComponentType() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
- StructureEdit.getComponentType(new VirtualComponent(project, "", new Path("")));
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
- }
- }
-
- public void testSetComponentType() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- ComponentResource componentResource = wbComponent.findResourcesByRuntimePath(new Path("/TestArtifactEdit/WebModule1"))[0];
- VirtualComponent vc = new VirtualComponent(project, "", new Path(""));
- StructureEdit.setComponentType(vc, wbComponent.getComponentType());
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
- }
- }
-
- /*
- * Class under test for void StructureEdit(ModuleCoreNature, boolean)
- */
- public void testStructureEditModuleCoreNatureboolean() {
- StructureEdit moduleCore = null;
- try {
- // protected
- // StructureEdit edit = new StructureEdit(ModuleCoreNature.getModuleCoreNature(project),
- // true);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
- }
- }
-
- /*
- * Class under test for void StructureEdit(ModuleStructuralModel)
- */
- public void testStructureEditModuleStructuralModel() {
- StructureEdit moduleCore = null;
- EMFWorkbenchContext context = new EMFWorkbenchContext(project);
- ModuleStructuralModel msm = new ModuleStructuralModel(EDIT_MODEL_ID, context, false);
- try {
- // protected
- StructureEdit edit = new StructureEdit(msm);
- assertNotNull(edit);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
- }
- }
-
- public void testSave() {
-
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- moduleCore.save(new NullProgressMonitor());
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
-
- public void testSaveIfNecessary() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- moduleCore.saveIfNecessary(new NullProgressMonitor());
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testDispose() {
- // disposed everywhere
- }
-
- public void testPrepareProjectComponentsIfNecessary() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- moduleCore.prepareProjectComponentsIfNecessary();
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testGetComponentModelRoot() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- moduleCore.getComponentModelRoot();
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testGetSourceContainers() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- moduleCore.getSourceContainers(wbComponent);
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testGetWorkbenchModules() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- moduleCore.getWorkbenchModules();
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testCreateWorkbenchModule() {
-
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- moduleCore.createWorkbenchModule("test");
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
-
- public void testCreateWorkbenchModuleResource() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- moduleCore.createWorkbenchModuleResource(null);
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testCreateModuleType() {
- StructureEdit moduleCore = null;
-
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- moduleCore.createModuleType(EDIT_MODEL_ID);
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
-
- /*
- * Class under test for ComponentResource[] findResourcesByRuntimePath(URI, URI)
- */
- public void testFindResourcesByRuntimePathURIURI() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- try {
- moduleCore.findResourcesByRuntimePath(moduleURI);
- } catch (UnresolveableURIException e) {
- e.printStackTrace();
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- /*
- * Class under test for ComponentResource[] findResourcesByRuntimePath(URI)
- */
- public void testFindResourcesByRuntimePathURI() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(WEB_MODULE_NAME);
- try {
- moduleCore.findResourcesByRuntimePath(moduleURI, moduleURI);
- } catch (UnresolveableURIException e) {
- e.printStackTrace();
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testFindResourcesBySourcePath() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- try {
- moduleCore.findResourcesBySourcePath(moduleURI);
- } catch (UnresolveableURIException e) {
- e.printStackTrace();
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testFindComponentByName() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- moduleCore.findComponentByName(WEB_MODULE_NAME);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testFindComponentByURI() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- try {
- moduleCore.findComponentByURI(moduleURI);
- } catch (UnresolveableURIException e) {
- e.printStackTrace();
- }
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
-
- }
-
- public void testFindComponentsByType() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(project);
- moduleCore.findComponentsByType(EDIT_MODEL_ID);
-
-
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testIsLocalDependency() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- moduleCore.isLocalDependency(null);
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testGetFirstModule() {
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(project);
- moduleCore.getFirstModule();
- } finally {
- if (moduleCore != null) {
- moduleCore.dispose();
-
- }
- assertNotNull(moduleCore);
-
- }
- }
-
- public void testCreateComponentURI() {
- StructureEdit moduleCore = null;
- URI uri = StructureEdit.createComponentURI(project, "testComp");
- assertNotNull(uri);
-
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/TestWorkspace.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/TestWorkspace.java
deleted file mode 100644
index 15ee99d..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/tests/TestWorkspace.java
+++ /dev/null
@@ -1,76 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class TestWorkspace {
-
- public static final String PROJECT_NAME = "TestVirtualAPI"; //$NON-NLS-1$
- public static final String WEB_MODULE_1_NAME = "WebModule1"; //$NON-NLS-1$
- public static final String WEB_MODULE_2_NAME = "WebModule2"; //$NON-NLS-1$
-
- public static final String NEW_WEB_MODULE_NAME = "NewWebModule"; //$NON-NLS-1$
-
-
- public static final String META_INF = "META-INF"; //$NON-NLS-1$
- public static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
- private static Path zipFilePath = new Path("testData/TestVirtualAPI.zip");
-
- public static final IProject TEST_PROJECT = ResourcesPlugin.getWorkspace().getRoot().getProject(TestWorkspace.PROJECT_NAME);
-
- public static final String[] MODULE_NAMES = new String[]{WEB_MODULE_1_NAME, WEB_MODULE_2_NAME};
-
-
- public static IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public static void init() {
-
- try {
- IProject project = getTargetProject();
- if (!project.exists())
- createProject();
- project.refreshLocal(IResource.DEPTH_INFINITE, null);
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- public static boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private static IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/DefectVerificationTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/DefectVerificationTests.java
deleted file mode 100644
index 8b035e0..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/DefectVerificationTests.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-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.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class DefectVerificationTests extends TestCase {
-
-
- private static Path zipFilePath = new Path("testData/DefectVerificationTests.zip");
-
- protected void setUp() throws Exception {
-// IPath localZipPath = getLocalPath();
-// ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{"DefectVerificationProject"});
-// util.createProjects();
- }
-
- public void test96862() {
-
- IPath filePath = new Path("/WEB-INF/web.xml");
- IPath folderPath = new Path("/WEB-INF");
-
- IVirtualComponent component = ComponentCore.createComponent(getProject(), "DefectVerificationProject");
-
-
- IVirtualResource fileResource = component.findMember(filePath);
- assertEquals("The returned type should be a file.", IVirtualResource.FILE, fileResource.getType());
-
- IVirtualResource folderResource = component.findMember(folderPath);
- assertEquals("The returned type should be a folder.", IVirtualResource.FOLDER, folderResource.getType());
-
- }
-
- private IProject getProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject("DefectVerificationProject");
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- }
-
-
- private static IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IFlexibleProjectAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IFlexibleProjectAPITest.java
deleted file mode 100644
index bd6700d..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IFlexibleProjectAPITest.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.resources.FlexibleProject;
-import org.eclipse.wst.common.componentcore.resources.IFlexibleProject;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-
-public class IFlexibleProjectAPITest extends TestCase {
-
- private IFlexibleProject flexibleProject;
-
- public IFlexibleProjectAPITest (String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
-
- TestWorkspace.init();
- flexibleProject = ComponentCore.createFlexibleProject(TestWorkspace.getTargetProject());
- }
-
- public void testFlexibleProjectIProject() {
-
- IFlexibleProject localFlexiProject = new FlexibleProject(TestWorkspace.getTargetProject());
- // should be created without exception
-
- }
-
- public void testGetComponents() {
-
- IVirtualComponent[] components = flexibleProject.getComponents();
- assertEquals("Verify the number of modules defined in the test project.", TestWorkspace.MODULE_NAMES.length, components.length);
-
- boolean found = false;
- for (int componentIndex = 0; componentIndex < components.length; componentIndex++) {
- found = false;
- for (int moduleNamesIndex = 0; moduleNamesIndex < TestWorkspace.MODULE_NAMES.length; moduleNamesIndex++) {
- if(TestWorkspace.MODULE_NAMES[moduleNamesIndex].equals(components[componentIndex].getName())) {
- found = true;
- break;
- }
- }
- assertTrue("A component with the following name must be found in the project: " + components[componentIndex].getName(), found);
- }
-
- }
-
- public void testGetComponent() {
- IVirtualComponent component = flexibleProject.getComponent(TestWorkspace.WEB_MODULE_1_NAME);
- assertEquals("The component must match the expected.", TestWorkspace.WEB_MODULE_1_NAME, component.getName());
- }
-
- public void testGetProject() {
-
- assertEquals("The project associated with the flexible project must match the expected.", TestWorkspace.getTargetProject(), flexibleProject.getProject());
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualComponentAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualComponentAPITest.java
deleted file mode 100644
index 0ae0956..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualComponentAPITest.java
+++ /dev/null
@@ -1,129 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import java.util.List;
-import java.util.Properties;
-
-import junit.framework.TestSuite;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.emf.common.util.URI;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ReferencedComponent;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.internal.impl.ModuleURIUtil;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualComponentAPITest extends IVirtualContainerAPITest {
-
- private IVirtualComponent virtualComponent;
- private WorkbenchComponent workbenchComponent;
- private StructureEdit structureEdit;
-
- public IVirtualComponentAPITest(String name) {
- super(name);
- }
-
- public static TestSuite suite() {
- TestSuite suite = new TestSuite();
- suite.addTest(new IVirtualComponentAPITest("testGetReferences"));
- return suite;
- }
-
- protected void doSetup() throws Exception {
- virtualComponent = ComponentCore.createComponent(TestWorkspace.TEST_PROJECT, TestWorkspace.WEB_MODULE_1_NAME);
- structureEdit = StructureEdit.getStructureEditForRead(TestWorkspace.TEST_PROJECT);
- workbenchComponent = structureEdit.findComponentByName(TestWorkspace.WEB_MODULE_1_NAME);
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
- if(structureEdit != null)
- structureEdit.dispose();
- }
-
- public void testGetName() {
-
- String name = virtualComponent.getName();
- }
-
- public void testGetComponentTypeId() {
- String id = virtualComponent.getComponentTypeId() ;
- }
-
- public void testSetComponentTypeId() {
- String id = "jst.ejb";
- virtualComponent.setComponentTypeId(id) ;
- }
-
- public void testGetMetaProperties() {
- Properties properties = virtualComponent.getMetaProperties() ;
- }
-
- public void testGetMetaResources() {
- IPath[] metaresources = virtualComponent.getMetaResources() ;
-
- }
-
- public void testSetMetaResources() {
-
- IPath[] metaresources = new IPath[1];
- metaresources[0] = new Path("/test");
- virtualComponent.setMetaResources(metaresources) ;
-
- }
-
- public void testGetResources() {
- String resource = "/test";
- IVirtualResource[] virtualResource = virtualComponent.getResources(resource) ;
-
- }
-
- public void testGetReferences() {
- IVirtualReference[] references = virtualComponent.getReferences();
-
- for(int i=0; i<references.length;i++)
- assertReference(references[i]);
- }
-
- private void assertReference(IVirtualReference reference) {
- List referencedComponents = workbenchComponent.getReferencedComponents();
- ReferencedComponent referencedComponent = null;
- String componentName = null;
- for(int i=0; i<referencedComponents.size(); i++) {
- referencedComponent = (ReferencedComponent) referencedComponents.get(i);
- try {
- componentName = ModuleURIUtil.getDeployedName(referencedComponent.getHandle());
- } catch (UnresolveableURIException e) {
- }
- if(componentName != null && componentName.equals(reference.getReferencedComponent().getName())) {
- assertEquals("The runtime paths must match.", referencedComponent.getRuntimePath(), reference.getRuntimePath());
- assertEquals("The workbench component should match the enclosing component.", virtualComponent, reference.getEnclosingComponent());
- assertEquals("The dependencyTypes should match.", referencedComponent.getDependencyType().getValue(), reference.getDependencyType());
- URI actualHandle = ModuleURIUtil.fullyQualifyURI(reference.getReferencedComponent().getProject(), reference.getReferencedComponent().getName());
- assertEquals("The handles should match.", referencedComponent.getHandle(), actualHandle);
- return;
- }
- }
- fail("A matching reference was not found for "+reference.getRuntimePath());
- }
-
- public void testSetReferences() {
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualContainerAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualContainerAPITest.java
deleted file mode 100644
index b5c2946..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualContainerAPITest.java
+++ /dev/null
@@ -1,181 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import org.eclipse.core.resources.IContainer;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public abstract class IVirtualContainerAPITest extends IVirtualResourceAPITest {
-
- protected IVirtualContainer targetVirtualContainer;
- protected IContainer targetPlatformContainer;
- protected IPath expectedPlatformContainerPath;
-
- /*
- * The following fields assume a minimum structure of:
- *
- * / [Root]
- * /jsps [Folder]
- * /TestJsp3.jsp [File]
- * /WEB-INF [Folder]
- * /lib [Folder]
- * /TestFile1.txt [File]
- *
- */
-
-
- protected IPath expectedFileSingleDepthPath = new Path("/jsps/TestJsp3.jsp");
- protected IPath expectedFolderSingleDepthPath = new Path("WEB-INF/lib");
-
- protected String expectedFolderName = "jsps";
- protected IPath expectedFolderZerothDepthPath = new Path(expectedFolderName);
-
- protected String expectedFileName = "TestFile1.txt";
- protected IPath expectedFileZerothDepthPath = new Path(expectedFileName);
-
- public IVirtualContainerAPITest(String name) {
- super(name);
- }
-
-
- protected void assertRequirements() {
- super.assertRequirements();
-// assertNotNull("The target virtual container must be specified.", targetVirtualContainer);
-// assertNotNull("The target platform container must be specified.", targetPlatformContainer);
-// assertNotNull("The expected platform container path must be specified.", expectedPlatformContainerPath);
- }
-
-
- public void testGetFileString() {
- IVirtualFile testFile1txt = targetVirtualContainer.getFile(expectedFileName); //$NON-NLS-1$
- assertEquals("The test file project relative path must match.", expectedPlatformContainerPath.append(expectedFileName), testFile1txt.getProjectRelativePath()); //$NON-NLS-1$
- }
-
- public void testGetFilePath() {
- IVirtualFile test3jsp = targetVirtualContainer.getFile(expectedFileSingleDepthPath);
- IPath expectedPath = expectedPlatformContainerPath.append(expectedFileSingleDepthPath);
- assertEquals("The test file project relative path must match.", expectedPath, test3jsp.getProjectRelativePath()); //$NON-NLS-1$
- }
-
- /*
- * Class under test for IVirtualFolder getFolder(String)
- */
- public void testGetFolderString() {
- IVirtualFolder jspsFolder = targetVirtualContainer.getFolder(expectedFolderName);
- assertNotNull("The folder should not be null.", jspsFolder);
- assertEquals("The name of the folder returned shouled match the expected folder.", expectedFolderName, jspsFolder.getName());
- }
-
- /*
- * Class under test for IVirtualFolder getFolder(IPath)
- */
- public void testGetFolderIPath() {
- IVirtualFolder testGetFolder = targetVirtualContainer.getFolder(expectedFolderZerothDepthPath);
- assertNotNull("The folder should not be null.", testGetFolder);
- assertEquals("The name of the folder returned shouled match the expected folder.", expectedFolderZerothDepthPath, testGetFolder.getRuntimePath());
- }
-
- /*
- * Class under test for boolean exists(IPath)
- */
- public void testExistsIPath() {
- assertTrue("The expected file path should be found to exist.", targetVirtualContainer.exists(expectedFileSingleDepthPath));
- }
-
- /*
- * Class under test for IVirtualResource findMember(String)
- */
- public void testFindMemberString() {
- IVirtualResource foundResource = targetVirtualContainer.findMember(expectedFolderName);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FOLDER.", IVirtualResource.FOLDER, foundResource.getType());
- IVirtualFolder foundFolder = (IVirtualFolder) foundResource;
- assertEquals("The name should be correct.", expectedFolderName, foundResource.getName());
-
-
- foundResource = targetVirtualContainer.findMember(expectedFileName);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FILE.", IVirtualResource.FILE, foundResource.getType());
- IVirtualFile foundFile = (IVirtualFile) foundResource;
- assertEquals("The name should be correct.", expectedFileName, foundResource.getName());
- }
-
- /*
- * Class under test for IVirtualResource findMember(String, int)
- */
- public void testFindMemberStringint() {
-
- IVirtualResource foundResource = targetVirtualContainer.findMember(expectedFolderName, IVirtualResource.NONE);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FOLDER.", IVirtualResource.FOLDER, foundResource.getType());
- IVirtualFolder foundFolder = (IVirtualFolder) foundResource;
- assertEquals("The name should be correct.", expectedFolderName, foundResource.getName());
-
-
- foundResource = targetVirtualContainer.findMember(expectedFolderName, IVirtualResource.NONE);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FILE.", IVirtualResource.FILE, foundResource.getType());
- IVirtualFile foundFile = (IVirtualFile) foundResource;
- assertEquals("The name should be correct.", expectedFileName, foundResource.getName());
- }
-
- /*
- * Class under test for IVirtualResource findMember(IPath)
- */
- public void testFindMemberIPath() {
-
- IVirtualResource foundResource = targetVirtualContainer.findMember(expectedFolderSingleDepthPath);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FOLDER.", IVirtualResource.FOLDER, foundResource.getType());
- IVirtualFolder foundFolder = (IVirtualFolder) foundResource;
- assertEquals("The name should be correct.", expectedFolderSingleDepthPath.lastSegment(), foundResource.getName());
-
-
- foundResource = targetVirtualContainer.findMember(expectedFileSingleDepthPath);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FILE.", IVirtualResource.FILE, foundResource.getType());
- IVirtualFile foundFile = (IVirtualFile) foundResource;
- assertEquals("The name should be correct.", expectedFileSingleDepthPath.lastSegment(), foundResource.getName());
- }
-
- /*
- * Class under test for IVirtualResource findMember(IPath, int)
- */
- public void testFindMemberIPathint() {
- IVirtualResource foundResource = targetVirtualContainer.findMember(expectedFolderSingleDepthPath, IVirtualResource.NONE);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FOLDER.", IVirtualResource.FOLDER, foundResource.getType());
- IVirtualFolder foundFolder = (IVirtualFolder) foundResource;
- assertEquals("The name should be correct.", expectedFolderSingleDepthPath.lastSegment(), foundResource.getName());
-
-
- foundResource = targetVirtualContainer.findMember(expectedFileSingleDepthPath, IVirtualResource.NONE);
- assertEquals("The type found for the expected folder name should be IVirtualResource.FILE.", IVirtualResource.FILE, foundResource.getType());
- IVirtualFile foundFile = (IVirtualFile) foundResource;
- assertEquals("The name should be correct.", expectedFileSingleDepthPath.lastSegment(), foundResource.getName());
- }
-
-
- /*
- * Class under test for IVirtualResource[] members()
- */
- public void testMembers() {
- }
-
- /*
- * Class under test for IVirtualResource[] members(int)
- */
- public void testMembersint() {
- }
-
-
- public void testCreate() {
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFileAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFileAPITest.java
deleted file mode 100644
index bb34527..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFileAPITest.java
+++ /dev/null
@@ -1,63 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFile;
-
-public class IVirtualFileAPITest extends IVirtualResourceAPITest {
-
- public IVirtualFileAPITest(String name) {
- super(name);
- }
-
- protected void doSetup() throws Exception {
-
-
- }
-
- /*
- * Class under test for void VirtualFile(IProject, String, IPath)
- */
- public void testVirtualFileIProjectStringIPath() {
-
- }
-
-
- public void testGetUnderlyingFile() {
-
- IFile platformFileToCreate = ((IVirtualFile)targetVirtualResourceToCreate).getUnderlyingFile();
- assertTrue("The underyling resource should not exist.", !platformFileToCreate.exists() );
-
- IFile existingPlatformFile = ((IVirtualFile)targetExistingVirtualResource).getUnderlyingFile();
- assertTrue("The underyling resource should not exist.", !existingPlatformFile.exists() );
-
- }
-
- public void testGetUnderlyingFiles() {
-
- IResource[] platformFileToCreate = ((IVirtualFile)targetVirtualResourceToCreate).getUnderlyingFiles();
- assertEquals("There should only be one resource in the result array.", 1, platformFileToCreate.length);
- assertEquals("The type of the underlying resource should match IResource.FILE.", IResource.FILE, platformFileToCreate[0].getType());
- assertTrue("The underyling resource should not exist.", !platformFileToCreate[0].exists() );
-
-
- IResource[] existingPlatformFile = ((IVirtualFile)targetExistingVirtualResource).getUnderlyingFiles();
- assertEquals("There should only be one resource in the result array.", 1, existingPlatformFile.length);
- assertEquals("The type of the underlying resource should match IResource.FILE.", IResource.FILE, existingPlatformFile[0].getType());
- assertTrue("The underyling resource should not exist.", !existingPlatformFile[0].exists() );
-
- IFile multiPlatformFile = ((IVirtualFile)targetMultiVirtualResource).getUnderlyingFile();
- assertTrue("The underyling resource should not exist.", !multiPlatformFile.exists() );
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFolderAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFolderAPITest.java
deleted file mode 100644
index 26f485c..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualFolderAPITest.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import java.util.Arrays;
-import java.util.HashSet;
-import java.util.Set;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public class IVirtualFolderAPITest extends IVirtualContainerAPITest {
-
- public static final String TEST_FOLDER_NAME = "WEB-INF"; //$NON-NLS-1$
-
- public static final IPath WEBCONTENT_FOLDER_REAL_PATH = new Path("/WebModule1/WebContent/");
- public static final IPath WEBINF_FOLDER_REAL_PATH = WEBCONTENT_FOLDER_REAL_PATH.append(TEST_FOLDER_NAME); //$NON-NLS-1$ //$NON-NLS-2$
- public static final IPath WEBINF_FOLDER_RUNTIME_PATH = new Path("/"+TEST_FOLDER_NAME); //$NON-NLS-1$
-
- public static final IPath TESTDATA_FOLDER_REAL_PATH = new Path("WebModule1/testdata"); //$NON-NLS-1$ //$NON-NLS-2$
- public static final IPath TESTDATA_FOLDER_RUNTIME_PATH = new Path("/"); //$NON-NLS-1$
-
- private static final IPath DELETEME_PATH = new Path("/deleteme"); //$NON-NLS-1$
-
- ;
-
- public IVirtualFolderAPITest(String name) {
- super(name);
- }
-
- protected void doSetup() throws Exception {
-
- expectedPlatformContainerPath = TESTDATA_FOLDER_REAL_PATH;
-
- expectedRuntimePath = WEBINF_FOLDER_RUNTIME_PATH;
- expectedName = TEST_FOLDER_NAME;
- expectedProject = TestWorkspace.TEST_PROJECT;
-
- targetExistingPlatformResource = TestWorkspace.TEST_PROJECT.getFolder(WEBINF_FOLDER_REAL_PATH);
-
- virtualParent = ComponentCore.createComponent(TestWorkspace.TEST_PROJECT, TestWorkspace.WEB_MODULE_1_NAME);
- targetExistingVirtualResource = virtualParent.getFolder(WEBINF_FOLDER_RUNTIME_PATH);
-
- targetVirtualContainer = virtualParent.getFolder(TESTDATA_FOLDER_RUNTIME_PATH);
- targetPlatformContainer = TestWorkspace.TEST_PROJECT.getFolder(TESTDATA_FOLDER_REAL_PATH);
-
- targetVirtualResourceToDelete = virtualParent.getFolder(DELETEME_PATH);
- targetVirtualResourceToDelete.create(IVirtualResource.FORCE, null);
-
- targetPlatformResourceToDelete = expectedProject.getFolder(targetVirtualResourceToDelete.getProjectRelativePath());
-
- }
-
- protected void tearDown() throws Exception {
- super.tearDown();
-
- if(targetPlatformResourceToDelete.exists())
- targetPlatformResourceToDelete.delete(IVirtualResource.FORCE, null);
- }
-
-
- public void testGetUnderlyingFolder() {
- IFolder underlyingResource = ((IVirtualFolder)targetExistingVirtualResource).getUnderlyingFolder();
- IFolder expectedPlatformResource = TestWorkspace.TEST_PROJECT.getFolder(WEBINF_FOLDER_RUNTIME_PATH);
- assertEquals("The underlying resource should be " +expectedPlatformResource.getProjectRelativePath(), expectedPlatformResource, underlyingResource);
- }
-
- public void testGetUnderlyingFolders() {
-
- IFolder[] underlyingResources = ((IVirtualFolder)targetVirtualContainer).getUnderlyingFolders();
- assertEquals("There should be two folders mapped to root", 2, underlyingResources.length);
-
- Set underlyingResourcesSet = new HashSet(Arrays.asList(underlyingResources));
- Set expectedUnderlyingResourcesSet = new HashSet();
- expectedUnderlyingResourcesSet.add(TestWorkspace.TEST_PROJECT.getFolder(TESTDATA_FOLDER_REAL_PATH));
- expectedUnderlyingResourcesSet.add(TestWorkspace.TEST_PROJECT.getFolder(WEBCONTENT_FOLDER_REAL_PATH));
- assertEquals("Expecting two folders mapped to root." +expectedUnderlyingResourcesSet, underlyingResourcesSet);
-
- }
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualReferenceAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualReferenceAPITest.java
deleted file mode 100644
index 4c915dd..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualReferenceAPITest.java
+++ /dev/null
@@ -1,60 +0,0 @@
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.internal.resources.VirtualReference;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualReference;
-
-public class IVirtualReferenceAPITest extends TestCase {
-
- public static void main(String[] args) {
- }
-
- public void testCreate() {
- IVirtualReference reference = new VirtualReference();
- reference.create(0,null);
-
- }
-
- public void testSetRuntimePath() {
- IVirtualReference reference = new VirtualReference();
- reference.setRuntimePath(new Path("/"));
- }
-
- public void testGetRuntimePath() {
- IVirtualReference reference = new VirtualReference();
- IPath path = reference.getRuntimePath();
- }
-
- public void testSetDependencyType() {
- IVirtualReference reference = new VirtualReference();
- int dependencyType = 0;
- reference.setDependencyType(dependencyType);
- }
-
- public void testGetDependencyType() {
- IVirtualReference reference = new VirtualReference();
- int dependencyType = 0;
- dependencyType = reference.getDependencyType();
- }
-
- public void testExists() {
- IVirtualReference reference = new VirtualReference();
- boolean exists = reference.exists();
- }
-
- public void testGetEnclosingComponent() {
- IVirtualReference reference = new VirtualReference();
- IVirtualComponent component = reference.getEnclosingComponent();
- }
-
- public void testGetReferencedComponent() {
- IVirtualReference reference = new VirtualReference();
- IVirtualComponent component = reference.getReferencedComponent();
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualResourceAPITest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualResourceAPITest.java
deleted file mode 100644
index b8c6ddd..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/IVirtualResourceAPITest.java
+++ /dev/null
@@ -1,271 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IFolder;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.ComponentCore;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-import org.eclipse.wst.common.componentcore.internal.WorkbenchComponent;
-import org.eclipse.wst.common.componentcore.internal.impl.ResourceTreeNode;
-import org.eclipse.wst.common.componentcore.internal.impl.ResourceTreeRoot;
-import org.eclipse.wst.common.componentcore.resources.IVirtualComponent;
-import org.eclipse.wst.common.componentcore.resources.IVirtualContainer;
-import org.eclipse.wst.common.componentcore.resources.IVirtualFolder;
-import org.eclipse.wst.common.componentcore.resources.IVirtualResource;
-
-public abstract class IVirtualResourceAPITest extends TestCase {
-
- protected IVirtualContainer virtualParent;
- protected IVirtualResource targetExistingVirtualResource;
- protected IResource targetExistingPlatformResource;
-
- protected IVirtualFolder targetVirtualResourceToDelete;
- protected IResource targetPlatformResourceToDelete;
-
- protected IVirtualResource targetVirtualResourceToCreate = null;
- protected IVirtualResource targetMultiVirtualResource = null;
-
- protected IProject expectedProject;
- protected IPath expectedRuntimePath;
- protected String expectedName;
-
- private static final String PROJECT_NAME = null;
-
- public IVirtualResourceAPITest(String name) {
- super(name);
- }
-
- protected final void setUp() throws Exception {
- TestWorkspace.init();
- doSetup();
- assertRequirements();
- }
-
- protected void assertRequirements() {
-
- }
-
- protected abstract void doSetup() throws Exception ;
-
- public void testCreateLinkIPathintIProgressMonitor() throws Exception {
-
- IVirtualComponent component = ComponentCore.createComponent(TestWorkspace.getTargetProject(), TestWorkspace.WEB_MODULE_2_NAME);
- IVirtualFolder images = component.getFolder(new Path("/images")); //$NON-NLS-1$
- images.createLink(new Path("/WebModule2/images"), 0, null); //$NON-NLS-1$
-
- IFolder realImages = TestWorkspace.getTargetProject().getFolder(new Path("/WebModule2/images")); //$NON-NLS-1$
- assertTrue("The /WebContent2/images directory must exist.", realImages.exists()); //$NON-NLS-1$
-
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForRead(TestWorkspace.getTargetProject());
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(TestWorkspace.WEB_MODULE_2_NAME);
-
- ComponentResource[] componentResources = wbComponent.findResourcesByRuntimePath(new Path("/images")); //$NON-NLS-1$
-
- assertTrue("There should be at least one mapping for virtual path \"/images\".", componentResources.length > 0); //$NON-NLS-1$
-
- ResourceTreeRoot resourceTreeRoot = ResourceTreeRoot.getSourceResourceTreeRoot(wbComponent);
- componentResources = resourceTreeRoot.findModuleResources(realImages.getFullPath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + realImages.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/images\".", componentResources[0].getRuntimePath().toString().equals("/images")); //$NON-NLS-1$ //$NON-NLS-2$
-
- // make sure that only one component resource is created
-
- images.createLink(new Path("/WebModule2/images"), 0, null); //$NON-NLS-1$
-
- componentResources = resourceTreeRoot.findModuleResources(realImages.getFullPath(), ResourceTreeNode.CREATE_NONE);
-
- assertTrue("There should be exactly one Component resource with the source path \"" + realImages.getProjectRelativePath() + "\".", componentResources.length == 1); //$NON-NLS-1$ //$NON-NLS-2$
-
- assertTrue("The runtime path should match \"/images\".", componentResources[0].getRuntimePath().toString().equals("/images")); //$NON-NLS-1$ //$NON-NLS-2$
- } finally {
- if (moduleCore != null)
- moduleCore.dispose();
- }
-
- }
-
- public void testEquals() throws Exception {
-
- }
-
- public void testExists() throws Exception {
-
- }
-
- public void testGetFileExtension() {
- assertTrue("The existing virtual resource should have no file extension.", targetExistingVirtualResource.getFileExtension() == null); //$NON-NLS-1$
- }
-
- public void testGetWorkspaceRelativePath() {
- IPath realPath = targetExistingPlatformResource.getFullPath();
- IPath virtualPath = targetExistingVirtualResource.getWorkspaceRelativePath();
- assertEquals("The workspace relative path of the virtual resource must match the real resource", realPath, virtualPath); //$NON-NLS-1$
-
- }
-
- public void testGetProjectRelativePath() {
- IPath realPath = targetExistingPlatformResource.getProjectRelativePath();
- IPath virtualPath = targetExistingVirtualResource.getProjectRelativePath();
- assertEquals("The project relative path of the virtual resource must match the real resource", realPath, virtualPath); //$NON-NLS-1$
- }
-
- public void testGetRuntimePath() {
- IPath virtualPath = targetExistingVirtualResource.getRuntimePath();
- assertEquals("The runtime path of the virtual resource must match the real resource", expectedRuntimePath, virtualPath); //$NON-NLS-1$
- }
-
-
- public void testGetName() {
- assertEquals("The name of the virtual resource must match the expected name.", expectedName, targetExistingVirtualResource.getName()); //$NON-NLS-1$
- }
-
- public void testGetParent() {
- assertEquals("The parent of the virtual resource must match the component.", virtualParent, targetExistingVirtualResource.getParent()); //$NON-NLS-1$
- }
-
- public void testGetProject() {
- assertEquals("The project of the virtual resource must match the test project.", expectedProject, targetExistingVirtualResource.getProject()); //$NON-NLS-1$
- }
-
- public void testGetType() {
- assertEquals("The type of the virtual resource must match the test project.", IResource.FOLDER, targetExistingVirtualResource.getType()); //$NON-NLS-1$
- }
-
- public void testGetComponent() {
- assertEquals("The component name of the virtual resource must match the test project.", TestWorkspace.WEB_MODULE_1_NAME, targetExistingVirtualResource.getComponent().getName()); //$NON-NLS-1$
- }
-
- public void testIsAccessible() {
- assertEquals("The platform resource should be accessible only if the virtual resource is accessible.", targetExistingPlatformResource.isAccessible(), targetExistingPlatformResource.isAccessible()); //$NON-NLS-1$
- }
-
- /*
- * Class under test for void delete(int, IProgressMonitor)
- */
- public void testDeleteintIProgressMonitor() throws Exception {
- targetVirtualResourceToDelete.delete(0, null);
-
- assertTrue("The real folder should be deleted when IVirtualResource.DELETE_METAMODEL_ONLY is NOT supplied.", !targetPlatformResourceToDelete.exists()); //$NON-NLS-1$
-
- IVirtualResource[] members = virtualParent.members();
-
- for (int i = 0; i < members.length; i++) {
- if(members[i].getRuntimePath().equals(targetVirtualResourceToDelete.getRuntimePath())) {
- fail("Found deleted folder in members()"); //$NON-NLS-1$
- }
- }
- }
-
- /*
- * Class under test for void delete(int, IProgressMonitor)
- */
- public void testDeleteintIProgressMonitor2() throws Exception {
- targetVirtualResourceToDelete.delete(IVirtualResource.IGNORE_UNDERLYING_RESOURCE, null);
-
- assertTrue("The real resource should not be deleted when IVirtualResource.IGNORE_UNDERLYING_RESOURCE is supplied.", targetPlatformResourceToDelete.exists()); //$NON-NLS-1$
-
- // only handles explicit mappings
- StructureEdit moduleCore = null;
- try {
- moduleCore = StructureEdit.getStructureEditForWrite(expectedProject);
- WorkbenchComponent wbComponent = moduleCore.findComponentByName(TestWorkspace.WEB_MODULE_1_NAME);
- ComponentResource[] resources = wbComponent.findResourcesByRuntimePath(targetVirtualResourceToDelete.getRuntimePath());
- assertTrue("There should be no matching resources found in the model.", resources.length == 0); //$NON-NLS-1$
-
- } finally {
- if (moduleCore != null) {
- moduleCore.saveIfNecessary(null);
- moduleCore.dispose();
- }
- }
- }
-
- /*
- * Class under test for void delete(boolean, IProgressMonitor)
- */
- public void testDeleteintIProgressMonitor3() throws Exception {
- targetVirtualResourceToDelete.delete(IVirtualResource.FORCE, null);
-
- assertTrue("The real resource should be deleted when IVirtualResource.IGNORE_UNDERLYING_RESOURCE is NOT supplied.", !targetPlatformResourceToDelete.exists()); //$NON-NLS-1$
-
- IVirtualResource[] members = virtualParent.members();
-
- for (int i = 0; i < members.length; i++) {
- if(members[i].getRuntimePath().equals(targetVirtualResourceToDelete.getRuntimePath())) {
- fail("Found deleted folder in members()"); //$NON-NLS-1$
- }
- }
- }
-
-
- public void testGetUnderlyingResource() {
- IResource platformResourceToCreate = targetVirtualResourceToCreate.getUnderlyingResource();
- int expectedType = determineExpectedType(targetVirtualResourceToCreate);
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, platformResourceToCreate.getType());
- assertTrue("The underyling resource should not exist.", !platformResourceToCreate.exists() );
-
- expectedType = determineExpectedType(targetExistingVirtualResource);
- IResource exitingPlatformResource = targetExistingVirtualResource.getUnderlyingResource();
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, exitingPlatformResource.getType());
- assertTrue("The underyling resource should exist.", exitingPlatformResource.exists() );
-
-
- expectedType = determineExpectedType(targetMultiVirtualResource);
- IResource multiPlatformResource = targetMultiVirtualResource.getUnderlyingResource();
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, multiPlatformResource.getType());
- assertTrue("The underyling resource should exist.", multiPlatformResource.exists() );
-
- }
-
- public void testGetUnderlyingResources() {
-
- int expectedType = determineExpectedType(targetVirtualResourceToCreate);
- IResource[] platformResourcesToCreate = targetVirtualResourceToCreate.getUnderlyingResources();
- assertEquals("There should only be one resource in the result array.", 1, platformResourcesToCreate.length);
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, platformResourcesToCreate[0].getType());
- assertTrue("The underyling resource should not exist.", !platformResourcesToCreate[0].exists() );
-
- expectedType = determineExpectedType(targetExistingVirtualResource);
- IResource[] existingPlatformResource = targetExistingVirtualResource.getUnderlyingResources();
- assertEquals("There should only be one resource in the result array.", 1, existingPlatformResource.length);
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, existingPlatformResource[0].getType());
- assertTrue("The underyling resource should not exist.", existingPlatformResource[0].exists() );
-
-
- expectedType = determineExpectedType(targetMultiVirtualResource);
- IResource[] multiPlatformResources = targetMultiVirtualResource.getUnderlyingResources();
- assertEquals("The type of the underlying resource should match the expected type.", expectedType, multiPlatformResources[0].getType());
- assertTrue("The underyling resource should not exist.", multiPlatformResources[0].exists() );
- }
-
- private int determineExpectedType(IVirtualResource aVirtualResource) {
- switch(targetVirtualResourceToCreate.getType()) {
- case IVirtualResource.FILE:
- return IResource.FILE;
- case IVirtualResource.FOLDER:
- case IVirtualResource.COMPONENT:
- return IResource.FOLDER;
- }
- return 0;
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/StructureEditTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/StructureEditTest.java
deleted file mode 100644
index 8c64f28..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/StructureEditTest.java
+++ /dev/null
@@ -1,59 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.IResource;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.wst.common.componentcore.UnresolveableURIException;
-import org.eclipse.wst.common.componentcore.internal.ComponentResource;
-import org.eclipse.wst.common.componentcore.internal.StructureEdit;
-
-public class StructureEditTest extends TestCase {
-
- private IResource aResource;
-
- public StructureEditTest(String name) {
- super(name);
- }
-
- protected void setUp() throws Exception {
- super.setUp();
- TestWorkspace.init();
- aResource= TestWorkspace.TEST_PROJECT.getFile(new Path("WebModule1/testdata/TestFile1.txt"));
- }
-
- public void testFindBySourcePath() {
- IProject proj = aResource.getProject();
- StructureEdit se = null;
- List foundResources = new ArrayList();
- try {
- se = StructureEdit.getStructureEditForRead(proj);
- ComponentResource[] resources = se.findResourcesBySourcePath(aResource.getProjectRelativePath());
- assertEquals("There should be one resource found.", 1, resources.length);
-
- resources = se.findResourcesBySourcePath(aResource.getFullPath());
- assertEquals("There should be one resource found.", 1, resources.length);
- }
- catch (UnresolveableURIException e) {
- e.printStackTrace();
- }
- finally {
- se.dispose();
- }
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/TestWorkspace.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/TestWorkspace.java
deleted file mode 100644
index 9ca5ad4..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/componentcore/virtualpath/tests/TestWorkspace.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.componentcore.virtualpath.tests;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IPath;
-import org.eclipse.core.runtime.Path;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.etools.common.test.apitools.ProjectUnzipUtil;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class TestWorkspace {
-
- public static final String PROJECT_NAME = "TestVirtualAPI"; //$NON-NLS-1$
- public static final String WEB_MODULE_1_NAME = "WebModule1"; //$NON-NLS-1$
- public static final String WEB_MODULE_2_NAME = "WebModule2"; //$NON-NLS-1$
-
- public static final String NEW_WEB_MODULE_NAME = "NewWebModule"; //$NON-NLS-1$
-
-
- public static final String META_INF = "META-INF"; //$NON-NLS-1$
- public static final String WEB_INF = "WEB-INF"; //$NON-NLS-1$
- private static Path zipFilePath = new Path("testData/TestVirtualAPI.zip");
-
- public static final IProject TEST_PROJECT = ResourcesPlugin.getWorkspace().getRoot().getProject(TestWorkspace.PROJECT_NAME);
-
- public static final String[] MODULE_NAMES = new String[]{WEB_MODULE_1_NAME, WEB_MODULE_2_NAME};
-
-
- public static IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject(PROJECT_NAME);
- }
-
- public static void init() {
-
- try {
- IProject project = getTargetProject();
- if (project.exists())
- project.delete(true, true, null);
- createProject();
- } catch (CoreException e) {
- e.printStackTrace();
- }
- }
-
- public static boolean createProject() {
- IPath localZipPath = getLocalPath();
- ProjectUnzipUtil util = new ProjectUnzipUtil(localZipPath, new String[]{PROJECT_NAME});
- return util.createProjects();
- }
-
- private static IPath getLocalPath() {
- URL url = CommonTestsPlugin.instance.find(zipFilePath);
- try {
- url = Platform.asLocalURL(url);
- } catch (IOException e) {
- e.printStackTrace();
- }
- return new Path(url.getPath());
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/A.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/A.java
deleted file mode 100644
index feaa5c2..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/A.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class A extends AbstractDataModelProvider {
- public static final String P = "A.P";
-
- public String[] getPropertyNames() {
- return new String[]{P};
- }
-
- public String getID() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/B.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/B.java
deleted file mode 100644
index ba67ae5..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/B.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class B extends AbstractDataModelProvider {
- public static final String P = "B.P";
-
- public String[] getPropertyNames() {
- return new String[]{P};
- }
-
- public String getID() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/C.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/C.java
deleted file mode 100644
index 58bc2d0..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/C.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class C extends AbstractDataModelProvider {
- public static final String P = "C.P";
-
- public String[] getPropertyNames() {
- return new String[]{P};
- }
-
- public String getID() {
- // TODO Auto-generated method stub
- return null;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelAPITests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelAPITests.java
deleted file mode 100644
index 859218b..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelAPITests.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class DataModelAPITests extends TestSuite {
-
- public static Test suite() {
- return new DataModelAPITests();
- }
-
- public DataModelAPITests() {
- super();
- addTest(new SimpleTestSuite(EventTest.class));
- addTest(new SimpleTestSuite(NestingTest.class));
- addTest(new SimpleTestSuite(NestedListeningTest.class));
- addTest(new SimpleTestSuite(SimpleDataModelTest.class));
- addTest(new SimpleTestSuite(DataModelFactoryTest.class));
- addTest(new SimpleTestSuite(DataModelEnablementTest.class));
- addTest(new SimpleTestSuite(TestAbstractDMProvider.class));
- addTest(new SimpleTestSuite(ValidationTest.class));
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelEnablementTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelEnablementTest.java
deleted file mode 100644
index f55b358..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelEnablementTest.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2004, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.internal.enablement.DataModelEnablementFactory;
-import org.eclipse.wst.common.frameworks.internal.operations.IProjectCreationProperties;
-import org.eclipse.wst.common.frameworks.internal.operations.ProjectCreationDataModelProvider;
-
-public class DataModelEnablementTest extends TestCase {
-
- public void testValidExtensionIDAndProviderType() {
- IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject("temp");
- if(proj == null){
- IDataModel model = DataModelFactory.createDataModel(new ProjectCreationDataModelProvider());
- model.setProperty(IProjectCreationProperties.PROJECT_NAME, "temp");
- IDataModelOperation op = model.getDefaultOperation();
- try {
- op.execute(new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- proj = ResourcesPlugin.getWorkspace().getRoot().getProject("temp");
- }
- IDataModel dataModel = DataModelEnablementFactory.createDataModel("testProviderBase", proj);
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
- public void testValidExtensionIDImplementorForProviderType() {
- IProject proj = ResourcesPlugin.getWorkspace().getRoot().getProject("temp");
- if(proj == null){
- IDataModel model = DataModelFactory.createDataModel(new ProjectCreationDataModelProvider());
- model.setProperty(IProjectCreationProperties.PROJECT_NAME, "temp");
- IDataModelOperation op = model.getDefaultOperation();
- try {
- op.execute(new NullProgressMonitor(), null);
- } catch (ExecutionException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- proj = ResourcesPlugin.getWorkspace().getRoot().getProject("temp");
- }
- IDataModel dataModel = DataModelEnablementFactory.createDataModel("testProviderBogus", proj);
- assertTrue(dataModel == null);
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelFactoryTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelFactoryTest.java
deleted file mode 100644
index c580f00..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/DataModelFactoryTest.java
+++ /dev/null
@@ -1,77 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class DataModelFactoryTest extends TestCase {
-
-
- public void testBogusExtension() {
- Exception exception = null;
- IDataModel dataModel = null;
- try {
- dataModel = DataModelFactory.createDataModel("bogus");
- } catch (Exception e) {
- exception = e;
- }
- assertNull(dataModel);
- }
-
- public void testInvalidExtensionID() {
- Exception exception = null;
- IDataModel dataModel = null;
- try {
- dataModel = DataModelFactory.createDataModel("badID");
- } catch (Exception e) {
- exception = e;
- }
- assertNull(dataModel);
- }
-
- public void testInvalidExtensionClass() {
- Exception exception = null;
- IDataModel dataModel = null;
- try {
- dataModel = DataModelFactory.createDataModel(Object.class);
- } catch (Exception e) {
- exception = e;
- }
- assertNull(dataModel);
- }
-
- public void testValidExtensionIDAndProviderType() {
- String[] descs = DataModelFactory.getDataModelProviderIDsForKind("testProviderBase");
- IDataModel dataModel = DataModelFactory.createDataModel(descs[0]);
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
- public void testValidExtensionID() {
- IDataModel dataModel = DataModelFactory.createDataModel("org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel");
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
- public void testValidExtensionClass() {
- IDataModel dataModel = DataModelFactory.createDataModel(ITestDataModel.class);
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
- public void testValidExtensionInstance() {
- IDataModel dataModel = DataModelFactory.createDataModel(new TestDataModelProvider());
- assertTrue(dataModel.isProperty(ITestDataModel.FOO));
- }
-
-
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/EventTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/EventTest.java
deleted file mode 100644
index b983871..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/EventTest.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class EventTest extends TestCase {
-
- public void testEventCreation() {
- IDataModel dm = DataModelFactory.createDataModel(new A());
- dm.setProperty(A.P, "aaa");
- DataModelEvent event = new DataModelEvent(dm, A.P, DataModelEvent.VALUE_CHG);
- assertEquals(dm, event.getDataModel());
- assertEquals(A.P, event.getPropertyName());
- assertEquals("aaa", event.getProperty());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- dm.setProperty(A.P, "bbb");
- assertEquals("bbb", event.getProperty());
- event = new DataModelEvent(dm, A.P, DataModelEvent.ENABLE_CHG);
- assertEquals(DataModelEvent.ENABLE_CHG, event.getFlag());
- assertEquals(dm.isPropertyEnabled(A.P), event.isPropertyEnabled());
- event = new DataModelEvent(dm, A.P, DataModelEvent.VALID_VALUES_CHG);
- assertEquals(DataModelEvent.VALID_VALUES_CHG, event.getFlag());
- }
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ITestDataModel.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ITestDataModel.java
deleted file mode 100644
index 6580f2d..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ITestDataModel.java
+++ /dev/null
@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-public interface ITestDataModel {
-
- public static final String FOO = "ITestDataModel.FOO";
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestedListeningTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestedListeningTest.java
deleted file mode 100644
index 12174e4..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestedListeningTest.java
+++ /dev/null
@@ -1,150 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-
-public class NestedListeningTest extends TestCase {
-
- public void testListeners1() {
- TestListener aL = new TestListener();
- TestListener bL = new TestListener();
- TestListener cL = new TestListener();
-
- IDataModel a = DataModelFactory.createDataModel(new A());
- IDataModel b = DataModelFactory.createDataModel(new B());
- IDataModel c = DataModelFactory.createDataModel(new C());
- a.addListener(aL);
- b.addListener(bL);
- c.addListener(cL);
-
- // cylical
- a.addNestedModel("b", b);
- b.addNestedModel("c", c);
- c.addNestedModel("a", a);
- aL.clearEvents();
- bL.clearEvents();
- cL.clearEvents();
- a.setProperty(A.P, "a");
- b.setProperty(B.P, "b");
- c.setProperty(C.P, "c");
- List aEvents = aL.getEvents();
- List bEvents = bL.getEvents();
- List cEvents = cL.getEvents();
- assertEquals(3, aEvents.size());
- assertEquals(3, bEvents.size());
- assertEquals(3, cEvents.size());
- for (int i = 0; i < 3; i++) {
- DataModelEvent aEvent = (DataModelEvent) aEvents.get(i);
- DataModelEvent bEvent = (DataModelEvent) bEvents.get(i);
- DataModelEvent cEvent = (DataModelEvent) cEvents.get(i);
-
- IDataModel dataModel = aEvent.getDataModel();
- assertEquals(bEvent.getDataModel(), dataModel);
- assertEquals(cEvent.getDataModel(), dataModel);
-
- String propertyName = aEvent.getPropertyName();
- assertEquals(bEvent.getPropertyName(), propertyName);
- assertEquals(cEvent.getPropertyName(), propertyName);
-
- int flag = aEvent.getFlag();
- assertEquals(bEvent.getFlag(), flag);
- assertEquals(cEvent.getFlag(), flag);
-
- Object property = aEvent.getProperty();
- assertEquals(bEvent.getProperty(), property);
- assertEquals(cEvent.getProperty(), property);
- switch (i) {
- case 0 :
- assertEquals(a, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, A.P);
- assertEquals(property, "a");
- assertTrue(dataModel.isPropertySet(propertyName));
- break;
- case 1 :
- assertEquals(b, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, B.P);
- assertEquals(property, "b");
- assertTrue(dataModel.isPropertySet(propertyName));
- break;
- case 2 :
- assertEquals(c, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, C.P);
- assertEquals(property, "c");
- assertTrue(dataModel.isPropertySet(propertyName));
- break;
- }
- }
-
- aL.clearEvents();
- bL.clearEvents();
- cL.clearEvents();
- a.setProperty(A.P, null);
- b.setProperty(B.P, null);
- c.setProperty(C.P, null);
- aEvents = aL.getEvents();
- bEvents = bL.getEvents();
- cEvents = cL.getEvents();
- assertEquals(3, aEvents.size());
- assertEquals(3, bEvents.size());
- assertEquals(3, cEvents.size());
- for (int i = 0; i < 3; i++) {
- DataModelEvent aEvent = (DataModelEvent) aEvents.get(i);
- DataModelEvent bEvent = (DataModelEvent) bEvents.get(i);
- DataModelEvent cEvent = (DataModelEvent) cEvents.get(i);
-
- IDataModel dataModel = aEvent.getDataModel();
- assertEquals(bEvent.getDataModel(), dataModel);
- assertEquals(cEvent.getDataModel(), dataModel);
-
- String propertyName = aEvent.getPropertyName();
- assertEquals(bEvent.getPropertyName(), propertyName);
- assertEquals(cEvent.getPropertyName(), propertyName);
-
- int flag = aEvent.getFlag();
- assertEquals(bEvent.getFlag(), flag);
- assertEquals(cEvent.getFlag(), flag);
-
- Object property = aEvent.getProperty();
- assertEquals(bEvent.getProperty(), property);
- assertEquals(cEvent.getProperty(), property);
- switch (i) {
- case 0 :
- assertEquals(a, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, A.P);
- assertTrue(!dataModel.isPropertySet(propertyName));
- break;
- case 1 :
- assertEquals(b, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, B.P);
- assertTrue(!dataModel.isPropertySet(propertyName));
- break;
- case 2 :
- assertEquals(c, dataModel);
- assertEquals(flag, DataModelEvent.VALUE_CHG);
- assertEquals(propertyName, C.P);
- assertTrue(!dataModel.isPropertySet(propertyName));
- break;
- }
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestingTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestingTest.java
deleted file mode 100644
index 605d257..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/NestingTest.java
+++ /dev/null
@@ -1,511 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import java.util.Collection;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class NestingTest extends TestCase {
-
- private IDataModel a;
- private IDataModel b;
- private IDataModel c;
-
- protected void setUp() throws Exception {
- super.setUp();
- a = DataModelFactory.createDataModel(new A());
- b = DataModelFactory.createDataModel(new B());
- c = DataModelFactory.createDataModel(new C());
- }
-
- protected void tearDown() throws Exception {
- if (null != a) {
- a.dispose();
- a = null;
- }
- if (null != b) {
- b.dispose();
- b = null;
- }
-
- if (null != c) {
- c.dispose();
- c = null;
- }
- }
-
- public void testInvalidNestedModel() {
- String NESTED_MODEL_NOT_LOCATED = WTPResourceHandler.getString("21"); //$NON-NLS-1$
- Exception ex = null;
- try {
- a.getNestedModel("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(NESTED_MODEL_NOT_LOCATED));
- ex = null;
- try {
- a.getNestedModel(null);
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(NESTED_MODEL_NOT_LOCATED));
-
- a.addNestedModel("b", b);
- ex = null;
- try {
- a.getNestedModel(null);
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(NESTED_MODEL_NOT_LOCATED));
-
- }
-
- public void testIsNestedModel() {
- Assert.assertFalse(a.isNestedModel(""));
- Assert.assertFalse(a.isNestedModel(null));
- a.addNestedModel("b", b);
- Assert.assertTrue(a.isNestedModel("b"));
- Assert.assertFalse(a.isNestedModel("c"));
- a.addNestedModel("c", c);
- Assert.assertTrue(a.isNestedModel("c"));
- }
-
- public void testRemoveNonExistentModels() {
- Assert.assertNull(a.removeNestedModel("a"));
- Assert.assertNull(a.removeNestedModel(null));
- }
-
- public void testGetNestedAndGetNesting() {
- Assert.assertEquals(0, a.getNestedModels().size());
- Assert.assertEquals(0, b.getNestingModels().size());
-
- Assert.assertTrue(a.addNestedModel("b", b));
- Assert.assertEquals(1, a.getNestedModels().size());
- Assert.assertTrue(a.getNestedModels().contains(b));
- Assert.assertEquals(b, a.getNestedModel("b"));
- Assert.assertEquals(1, b.getNestingModels().size());
- Assert.assertTrue(b.getNestingModels().contains(a));
-
- Assert.assertTrue(a.addNestedModel("c", c));
- Assert.assertEquals(2, a.getNestedModels().size());
- Assert.assertTrue(a.getNestedModels().contains(c));
- Assert.assertEquals(c, a.getNestedModel("c"));
- Assert.assertEquals(1, c.getNestingModels().size());
- Assert.assertTrue(c.getNestingModels().contains(a));
-
- Assert.assertTrue(b.addNestedModel("c", c));
- Assert.assertEquals(1, b.getNestedModels().size());
- Assert.assertTrue(b.getNestedModels().contains(c));
- Assert.assertEquals(2, c.getNestingModels().size());
- Assert.assertTrue(c.getNestingModels().contains(b));
-
- Assert.assertEquals(b, a.removeNestedModel("b"));
- Assert.assertEquals(1, a.getNestedModels().size());
- Assert.assertEquals(0, b.getNestingModels().size());
-
- Assert.assertEquals(c, a.removeNestedModel("c"));
- Assert.assertEquals(0, a.getNestedModels().size());
- Assert.assertEquals(1, c.getNestingModels().size());
- Assert.assertTrue(c.getNestingModels().contains(b));
-
- Assert.assertEquals(c, b.removeNestedModel("c"));
- Assert.assertEquals(0, b.getNestedModels().size());
- Assert.assertEquals(0, c.getNestingModels().size());
- }
-
- public void testSelfNest() {
- Assert.assertFalse(a.addNestedModel("a", a));
- Assert.assertEquals(0, a.getNestedModels().size());
- }
-
- public void testDuplicateNest() {
- Assert.assertTrue(a.addNestedModel("b1", b));
- Assert.assertEquals(b, a.getNestedModel("b1"));
- Assert.assertFalse(a.addNestedModel("b2", b));
- Assert.assertEquals(b, a.getNestedModel("b1"));
- Assert.assertFalse(a.isNestedModel("b2"));
- }
-
-
- /**
- * <code>
- * 1 2 3 4 5 6
- * A | A | A | A | A | A
- * B | | B | B | B | B
- * C | | C
- * </code>
- */
- public void testIsPropertySimpleNesting0() {
- a.addNestedModel("b", b); // 1
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isNestedProperty(B.P));
-
- a.removeNestedModel("b"); // 2
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isNestedProperty(B.P));
-
- a.addNestedModel("b", b); // 3
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isNestedProperty(B.P));
-
- b.addNestedModel("c", c); // 4
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(a.isNestedProperty(C.P));
-
- b.removeNestedModel("c"); // 5
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(a.isNestedProperty(C.P));
-
- b.addNestedModel("c", c); // 6
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(a.isNestedProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4
- * A | A | A | A
- * B | B | B |
- * C | |
- * </code>
- */
- public void testIsPropertySimpleNesting1() {
- a.addNestedModel("b", b); // 1
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isNestedProperty(B.P));
- // check a's nested
- Assert.assertTrue(b == a.getNestedModel("b"));
- Collection nestedModelNames = a.getNestedModelNames();
- Assert.assertEquals(1, nestedModelNames.size());
- Assert.assertTrue(nestedModelNames.contains("b"));
- Collection baseProperties = a.getBaseProperties();
- Assert.assertEquals(1, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(A.P));
- Collection nestedProperties = a.getNestedProperties();
- Assert.assertEquals(1, nestedProperties.size());
- Assert.assertTrue(nestedProperties.contains(B.P));
- Collection allProperties = a.getAllProperties();
- Assert.assertEquals(2, allProperties.size());
- Assert.assertTrue(allProperties.contains(A.P));
- Assert.assertTrue(allProperties.contains(B.P));
-
-
- b.addNestedModel("c", c); // 2
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(a.isNestedProperty(C.P));
- Assert.assertFalse(b.isBaseProperty(C.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(b.isNestedProperty(C.P));
- // check a's nested
- Assert.assertTrue(b == a.getNestedModel("b"));
- nestedModelNames = a.getNestedModelNames();
- Assert.assertEquals(1, nestedModelNames.size());
- Assert.assertTrue(nestedModelNames.contains("b"));
- baseProperties = a.getBaseProperties();
- Assert.assertEquals(1, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(A.P));
- nestedProperties = a.getNestedProperties();
- Assert.assertEquals(2, nestedProperties.size());
- Assert.assertTrue(nestedProperties.contains(B.P));
- Assert.assertTrue(nestedProperties.contains(C.P));
- allProperties = a.getAllProperties();
- Assert.assertEquals(3, allProperties.size());
- Assert.assertTrue(allProperties.contains(A.P));
- Assert.assertTrue(allProperties.contains(B.P));
- Assert.assertTrue(allProperties.contains(C.P));
- // check b's nested
- Assert.assertTrue(c == b.getNestedModel("c"));
- nestedModelNames = b.getNestedModelNames();
- Assert.assertEquals(1, nestedModelNames.size());
- Assert.assertTrue(nestedModelNames.contains("c"));
- baseProperties = b.getBaseProperties();
- Assert.assertEquals(1, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(B.P));
- nestedProperties = b.getNestedProperties();
- Assert.assertEquals(1, nestedProperties.size());
- Assert.assertTrue(nestedProperties.contains(C.P));
- allProperties = b.getAllProperties();
- Assert.assertEquals(2, allProperties.size());
- Assert.assertTrue(allProperties.contains(B.P));
- Assert.assertTrue(allProperties.contains(C.P));
-
- b.removeNestedModel("c"); // 3
- Assert.assertFalse(a.isBaseProperty(C.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(a.isNestedProperty(C.P));
- Assert.assertFalse(b.isBaseProperty(C.P));
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertFalse(b.isNestedProperty(C.P));
- // check a's nested
- Assert.assertTrue(b == a.getNestedModel("b"));
- nestedModelNames = a.getNestedModelNames();
- Assert.assertEquals(1, nestedModelNames.size());
- Assert.assertTrue(nestedModelNames.contains("b"));
- baseProperties = a.getBaseProperties();
- Assert.assertEquals(1, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(A.P));
- nestedProperties = a.getNestedProperties();
- Assert.assertEquals(1, nestedProperties.size());
- Assert.assertTrue(nestedProperties.contains(B.P));
- allProperties = a.getAllProperties();
- Assert.assertEquals(2, allProperties.size());
- Assert.assertTrue(allProperties.contains(A.P));
- Assert.assertTrue(allProperties.contains(B.P));
- // check b's nested
- nestedModelNames = b.getNestedModelNames();
- Assert.assertEquals(0, nestedModelNames.size());
- baseProperties = b.getBaseProperties();
- Assert.assertEquals(1, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(B.P));
- nestedProperties = b.getNestedProperties();
- Assert.assertEquals(0, nestedProperties.size());
- allProperties = b.getAllProperties();
- Assert.assertEquals(1, allProperties.size());
- Assert.assertTrue(allProperties.contains(B.P));
-
- a.removeNestedModel("b"); // 4
- Assert.assertFalse(a.isBaseProperty(B.P));
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isNestedProperty(B.P));
- // check a's nested
- nestedModelNames = a.getNestedModelNames();
- Assert.assertEquals(0, nestedModelNames.size());
- baseProperties = a.getBaseProperties();
- Assert.assertEquals(1, baseProperties.size());
- Assert.assertTrue(baseProperties.contains(A.P));
- nestedProperties = a.getNestedProperties();
- Assert.assertEquals(0, nestedProperties.size());
- allProperties = a.getAllProperties();
- Assert.assertEquals(1, allProperties.size());
- Assert.assertTrue(allProperties.contains(A.P));
- }
-
- /**
- * <code>
- * 1 2 3 4
- * A | A | A | A
- * | B | |
- * B | C | B | B
- * C | | C |
- * | | C
- * </code>
- */
- public void testIsPropertySimpleNesting2() {
- b.addNestedModel("c", c); // 1
- Assert.assertTrue(b.isProperty(C.P));
-
- a.addNestedModel("b", b); // 2
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
-
- a.removeNestedModel("b"); // 3
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
-
- b.removeNestedModel("c"); // 4
- Assert.assertFalse(b.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5
- * A | A | A | A | A
- * B | B | B | B | B
- * C | C | C |
- * | C2 |
- * </code>
- */
- public void testIsPropertyComplexNesting1() {
- a.addNestedModel("b", b); // 1
- b.addNestedModel("c", c); // 2
- Assert.assertTrue(a.isProperty(C.P));
- IDataModel c2 = DataModelFactory.createDataModel(new C());
- b.addNestedModel("c2", c2); // 3
- b.removeNestedModel("c2"); // 4
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c"); // 5
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertFalse(a.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5 6 7
- * A | A | A | A | A | A | A
- * B | B | B | B | B | B | B
- * C | C | C | C | C2 |
- * C2 | C2 |
- * </code>
- */
- public void testIsPropertyComplexNesting2() {
- a.addNestedModel("b", b); // 1
- b.addNestedModel("c", c); // 2
- Assert.assertTrue(a.isProperty(C.P));
- IDataModel c2 = DataModelFactory.createDataModel(new C());
- a.addNestedModel("c2", c2); // 3
- a.removeNestedModel("c2"); // 4
- Assert.assertTrue(a.isProperty(C.P));
- b.addNestedModel("c2", c2); // 5
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c"); // 6
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c2"); // 7
- Assert.assertFalse(a.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5 6
- * A | A | B | A | C | A
- * B | B | C | B | A | B
- * C | C | A | C | B | C
- * A (loop) | | A(loop)
- * </code>
- */
- public void testIsPropertyComplexNesting3() {
- a.addNestedModel("b", b);
- b.addNestedModel("c", c); // 1
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertFalse(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- c.addNestedModel("a", a); // 2
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- a.removeNestedModel("b"); // 3
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- a.addNestedModel("b", b); // 4
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- b.removeNestedModel("c"); // 5
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- c.removeNestedModel("a");
- a.removeNestedModel("b");
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertFalse(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- }
-
- public void testSetGetProperty1() {
- // cylical
- a.addNestedModel("b", b);
- b.addNestedModel("c", c);
- c.addNestedModel("a", a);
-
- a.setProperty(A.P, "a");
- a.setProperty(B.P, "b");
- a.setProperty(C.P, "c");
- assertEquals("a", a.getProperty(A.P));
- assertEquals("a", b.getProperty(A.P));
- assertEquals("a", c.getProperty(A.P));
- assertEquals("b", a.getProperty(B.P));
- assertEquals("b", b.getProperty(B.P));
- assertEquals("b", c.getProperty(B.P));
- assertEquals("c", a.getProperty(C.P));
- assertEquals("c", b.getProperty(C.P));
- assertEquals("c", c.getProperty(C.P));
-
- b.setProperty(A.P, "aa");
- b.setProperty(B.P, "bb");
- b.setProperty(C.P, "cc");
- assertEquals("aa", a.getProperty(A.P));
- assertEquals("aa", b.getProperty(A.P));
- assertEquals("aa", c.getProperty(A.P));
- assertEquals("bb", a.getProperty(B.P));
- assertEquals("bb", b.getProperty(B.P));
- assertEquals("bb", c.getProperty(B.P));
- assertEquals("cc", a.getProperty(C.P));
- assertEquals("cc", b.getProperty(C.P));
- assertEquals("cc", c.getProperty(C.P));
-
- c.setProperty(A.P, "aaa");
- c.setProperty(B.P, "bbb");
- c.setProperty(C.P, "ccc");
- assertEquals("aaa", a.getProperty(A.P));
- assertEquals("aaa", b.getProperty(A.P));
- assertEquals("aaa", c.getProperty(A.P));
- assertEquals("bbb", a.getProperty(B.P));
- assertEquals("bbb", b.getProperty(B.P));
- assertEquals("bbb", c.getProperty(B.P));
- assertEquals("ccc", a.getProperty(C.P));
- assertEquals("ccc", b.getProperty(C.P));
- assertEquals("ccc", c.getProperty(C.P));
- }
-
-
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/SimpleDataModelTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/SimpleDataModelTest.java
deleted file mode 100644
index 82eb453..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/SimpleDataModelTest.java
+++ /dev/null
@@ -1,429 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-import org.eclipse.wst.common.frameworks.internal.WTPResourceHandler;
-
-
-public class SimpleDataModelTest extends TestCase {
-
- private class DMProvider extends AbstractDataModelProvider {
- public static final String INT_PROP = "INT_PROP";
- public static final String INT_PROP2 = "INT_PROP2";
- public static final String INT_PROP3 = "INT_PROP3";
- public static final String INT_PROP4 = "INT_PROP4";
- public static final String BOOLEAN_PROP = "BOOLEAN_PROP";
- public static final String BOOLEAN_PROP2 = "BOOLEAN_PROP2";
- public static final String STRING_PROP = "STRING_PROP";
-
- public String[] getPropertyNames() {
- return new String[]{INT_PROP, INT_PROP2, INT_PROP3, INT_PROP4, BOOLEAN_PROP, BOOLEAN_PROP2, STRING_PROP};
- }
-
- public Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(INT_PROP)) {
- return new Integer(10);
- } else if (propertyName.equals(INT_PROP2)) {
- return getProperty(INT_PROP);
- } else if (propertyName.equals(BOOLEAN_PROP)) {
- return Boolean.TRUE;
- } else if (propertyName.equals(STRING_PROP)) {
- return "foo" + getProperty(INT_PROP) + getProperty(BOOLEAN_PROP);
- }
- return super.getDefaultProperty(propertyName);
- }
-
- public boolean isPropertyEnabled(String propertyName) {
- if (propertyName.equals(BOOLEAN_PROP2)) {
- return getBooleanProperty(BOOLEAN_PROP);
- }
- return true;
- }
-
- public boolean propertySet(String propertyName, Object propertyValue) {
- if (propertyName.equals(INT_PROP)) {
- model.notifyPropertyChange(INT_PROP2, IDataModel.VALUE_CHG);
- model.notifyPropertyChange(INT_PROP2, IDataModel.VALID_VALUES_CHG);
- model.notifyPropertyChange(STRING_PROP, IDataModel.DEFAULT_CHG);
- }
- if (propertyName.equals(BOOLEAN_PROP)) {
- model.notifyPropertyChange(BOOLEAN_PROP2, IDataModel.ENABLE_CHG);
- model.notifyPropertyChange(STRING_PROP, IDataModel.DEFAULT_CHG);
- }
- return true;
- }
-
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- if (INT_PROP2.equals(propertyName)) {
- int range = getIntProperty(INT_PROP);
- Integer[] ints = new Integer[range];
- for (int i = 0; i < ints.length; i++) {
- ints[i] = new Integer(i + 1);
- }
- return DataModelPropertyDescriptor.createDescriptors(ints);
- }
- if (INT_PROP3.equals(propertyName)) {
- int range = 3;
- Integer[] ints = new Integer[range];
- for (int i = 0; i < ints.length; i++) {
- ints[i] = new Integer(i + 1);
- }
- String[] descriptions = new String[]{"one", "two", "three"};
- return DataModelPropertyDescriptor.createDescriptors(ints, descriptions);
- }
- if (INT_PROP4.equals(propertyName)) {
- DataModelPropertyDescriptor[] descriptors = new DataModelPropertyDescriptor[3];
- String[] descriptions = new String[]{"one", "two", "three"};
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = new DataModelPropertyDescriptor(new Integer(i + 1), descriptions[i]);
- }
- return descriptors;
- }
- return null;
- }
-
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- Object property = getProperty(propertyName);
- if (INT_PROP2.equals(propertyName)) {
- return new DataModelPropertyDescriptor(property);
- } else if (INT_PROP3.equals(propertyName) || INT_PROP4.equals(propertyName)) {
- String[] descriptions = new String[]{"one", "two", "three"};
- int value = ((Integer) property).intValue();
- return new DataModelPropertyDescriptor(property, descriptions[value - 1]);
- }
- return null;
- }
-
-
- public String getID() {
- return id;
- }
-
- public List getExtendedContext() {
- return extendedContext;
- }
-
- }
-
- private String id;
- private List extendedContext;
-
- private IDataModel dm;
- private TestListener dmL;
-
- protected void setUp() throws Exception {
- super.setUp();
- dm = DataModelFactory.createDataModel(new DMProvider());
- dmL = new TestListener();
- dm.addListener(dmL);
- }
-
- public void testBasics() {
- id = null;
- assertEquals("", dm.getID());
- id = "foo";
- assertEquals("foo", dm.getID());
- extendedContext = null;
- assertNotNull(dm.getExtendedContext());
- extendedContext = new ArrayList();
- assertTrue(dm.getExtendedContext() == extendedContext);
- extendedContext.add("foo");
- assertTrue(dm.getExtendedContext() == extendedContext);
- assertNotNull(dm.getDefaultOperation());
- }
-
- public void testInvalidProperty() {
- String PROPERTY_NOT_LOCATED_ = WTPResourceHandler.getString("20"); //$NON-NLS-1$
- Exception ex = null;
- try {
- dm.getProperty("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
- ex = null;
- try {
- dm.getIntProperty("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
- ex = null;
- ex = null;
- try {
- dm.getBooleanProperty("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
- ex = null;
- ex = null;
- try {
- dm.getStringProperty("foo");
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
- ex = null;
- try {
- dm.getStringProperty(null);
- } catch (RuntimeException e) {
- ex = e;
- }
- Assert.assertNotNull(ex);
- Assert.assertTrue(ex.getMessage().startsWith(PROPERTY_NOT_LOCATED_));
-
- }
-
- public void testPropertyDescriptors() {
- DataModelPropertyDescriptor[] descriptors = dm.getValidPropertyDescriptors(DMProvider.INT_PROP2);
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals("" + value, descriptors[i].getPropertyDescription());
- }
- descriptors = dm.getValidPropertyDescriptors(DMProvider.INT_PROP3);
- String[] descriptions = new String[]{"one", "two", "three"};
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals(descriptions[i], descriptors[i].getPropertyDescription());
- }
- descriptors = dm.getValidPropertyDescriptors(DMProvider.INT_PROP4);
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals(descriptions[i], descriptors[i].getPropertyDescription());
- }
- for (int i = 1; i < 4; i++) {
- dm.setIntProperty(DMProvider.INT_PROP2, i);
- DataModelPropertyDescriptor descriptor = dm.getPropertyDescriptor(DMProvider.INT_PROP2);
- assertEquals(descriptor.getPropertyValue(), dm.getProperty(DMProvider.INT_PROP2));
- assertEquals(((Integer) descriptor.getPropertyValue()).intValue(), dm.getIntProperty(DMProvider.INT_PROP2));
- assertTrue(descriptor.getPropertyDescription().equals(Integer.toString(i)));
-
- dm.setIntProperty(DMProvider.INT_PROP3, i);
- descriptor = dm.getPropertyDescriptor(DMProvider.INT_PROP3);
- assertEquals(descriptor.getPropertyValue(), dm.getProperty(DMProvider.INT_PROP3));
- assertEquals(((Integer) descriptor.getPropertyValue()).intValue(), dm.getIntProperty(DMProvider.INT_PROP3));
- assertTrue(descriptor.getPropertyDescription().equals(descriptions[i - 1]));
-
- dm.setIntProperty(DMProvider.INT_PROP4, i);
- descriptor = dm.getPropertyDescriptor(DMProvider.INT_PROP4);
- assertEquals(descriptor.getPropertyValue(), dm.getProperty(DMProvider.INT_PROP4));
- assertEquals(((Integer) descriptor.getPropertyValue()).intValue(), dm.getIntProperty(DMProvider.INT_PROP4));
- assertTrue(descriptor.getPropertyDescription().equals(descriptions[i - 1]));
- }
- }
-
-
- public void testDefaults() {
- assertEquals(true, dm.getBooleanProperty(DMProvider.BOOLEAN_PROP));
- assertEquals(true, ((Boolean) dm.getProperty(DMProvider.BOOLEAN_PROP)).booleanValue());
- assertEquals(10, dm.getIntProperty(DMProvider.INT_PROP));
- assertEquals(10, ((Integer) dm.getProperty(DMProvider.INT_PROP)).intValue());
- assertEquals("foo10true", (String) dm.getProperty(DMProvider.STRING_PROP));
- assertEquals("foo10true", dm.getStringProperty(DMProvider.STRING_PROP));
- }
-
- public void testPropertyChangedOnListener() {
- dmL.clearEvents();
- DataModelEvent event = new DataModelEvent(dm, A.P, DataModelEvent.VALUE_CHG);
- dmL.propertyChanged(event);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
- assertTrue(events.contains(event));
-
- dmL.clearEvents();
- IDataModelListener idml = dmL;
- idml.propertyChanged(event);
- events = dmL.getEvents();
- assertEquals(1, events.size());
- assertTrue(events.contains(event));
-
- }
-
- public void testAddRemoveListener() {
- dmL.clearEvents();
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
-
- dmL.clearEvents();
- dm.removeListener(dmL);
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- events = dmL.getEvents();
- assertEquals(0, events.size());
-
- dmL.clearEvents();
- dm.addListener(dmL);
- dm.addListener(dmL);
- dm.addListener(dmL);
- dm.addListener(dmL);
- dm.addListener(dmL);
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- events = dmL.getEvents();
- assertEquals(1, events.size());
-
- dmL.clearEvents();
- dm.removeListener(dmL);
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- events = dmL.getEvents();
- assertEquals(0, events.size());
- }
-
- public void testFiringEvents() {
- dmL.clearEvents();
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.DEFAULT_CHG);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
- DataModelEvent event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
-
- dmL.clearEvents();
- dm.notifyPropertyChange(DMProvider.INT_PROP2, IDataModel.VALID_VALUES_CHG);
- events = dmL.getEvents();
- assertEquals(1, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALID_VALUES_CHG, event.getFlag());
- }
-
- public void testSimpleSetEvents() {
- dmL.clearEvents();
- dm.setIntProperty(DMProvider.INT_PROP2, 100);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
- DataModelEvent event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(100, dm.getIntProperty(DMProvider.INT_PROP2));
-
- dmL.clearEvents();
- dm.setIntProperty(DMProvider.INT_PROP2, 100);
- events = dmL.getEvents();
- assertEquals(0, events.size());
-
- dmL.clearEvents();
- dm.setIntProperty(DMProvider.INT_PROP2, 101);
- events = dmL.getEvents();
- assertEquals(1, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- }
-
- public void testComplexEvents() {
- dmL.clearEvents();
- dm.setIntProperty(DMProvider.INT_PROP, 11);
- List events = dmL.getEvents();
- assertEquals(4, events.size());
-
- DataModelEvent event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(11, ((Integer) dm.getProperty(DMProvider.INT_PROP2)).intValue());
-
- event = (DataModelEvent) events.get(1);
- assertEquals(DMProvider.INT_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.VALID_VALUES_CHG, event.getFlag());
- DataModelPropertyDescriptor[] descriptors = event.getValidPropertyDescriptors();
- DataModelPropertyDescriptor[] descriptors2 = dm.getValidPropertyDescriptors(DMProvider.INT_PROP2);
- assertEquals(11, descriptors.length);
- assertEquals(11, descriptors2.length);
-
- event = (DataModelEvent) events.get(2);
- assertEquals(DMProvider.STRING_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals("foo11true", event.getProperty());
- assertEquals("foo11true", dm.getDefaultProperty(DMProvider.STRING_PROP));
- assertEquals("foo11true", dm.getProperty(DMProvider.STRING_PROP));
-
- event = (DataModelEvent) events.get(3);
- assertEquals(DMProvider.INT_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(11, ((Integer) dm.getProperty(DMProvider.INT_PROP)).intValue());
-
- dmL.clearEvents();
- dm.setBooleanProperty(DMProvider.BOOLEAN_PROP, false);
- events = dmL.getEvents();
- assertEquals(3, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.BOOLEAN_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.ENABLE_CHG, event.getFlag());
- assertFalse(dm.isPropertyEnabled(DMProvider.BOOLEAN_PROP2));
- assertFalse(event.isPropertyEnabled());
-
- event = (DataModelEvent) events.get(1);
- assertEquals(DMProvider.STRING_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals("foo11false", event.getProperty());
- assertEquals("foo11false", dm.getDefaultProperty(DMProvider.STRING_PROP));
- assertEquals("foo11false", dm.getProperty(DMProvider.STRING_PROP));
-
- event = (DataModelEvent) events.get(2);
- assertEquals(DMProvider.BOOLEAN_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(false, dm.getBooleanProperty(DMProvider.BOOLEAN_PROP));
-
- dm.setStringProperty(DMProvider.STRING_PROP, "bar");
- assertEquals("bar", dm.getStringProperty(DMProvider.STRING_PROP));
- assertEquals("foo11false", dm.getDefaultProperty(DMProvider.STRING_PROP));
- dmL.clearEvents();
- dm.setBooleanProperty(DMProvider.BOOLEAN_PROP, true);
- events = dmL.getEvents();
- assertEquals(2, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.BOOLEAN_PROP2, event.getPropertyName());
- event = (DataModelEvent) events.get(1);
- assertEquals(DMProvider.BOOLEAN_PROP, event.getPropertyName());
-
- assertEquals("bar", dm.getStringProperty(DMProvider.STRING_PROP));
- dm.setStringProperty(DMProvider.STRING_PROP, null);
- assertEquals("foo11true", dm.getStringProperty(DMProvider.STRING_PROP));
- dmL.clearEvents();
- dm.setBooleanProperty(DMProvider.BOOLEAN_PROP, false);
- events = dmL.getEvents();
- assertEquals(3, events.size());
- event = (DataModelEvent) events.get(0);
- assertEquals(DMProvider.BOOLEAN_PROP2, event.getPropertyName());
- assertEquals(DataModelEvent.ENABLE_CHG, event.getFlag());
- assertFalse(dm.isPropertyEnabled(DMProvider.BOOLEAN_PROP2));
- assertFalse(event.isPropertyEnabled());
-
- event = (DataModelEvent) events.get(1);
- assertEquals(DMProvider.STRING_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals("foo11false", event.getProperty());
-
- event = (DataModelEvent) events.get(2);
- assertEquals(DMProvider.BOOLEAN_PROP, event.getPropertyName());
- assertEquals(DataModelEvent.VALUE_CHG, event.getFlag());
- assertEquals(false, dm.getBooleanProperty(DMProvider.BOOLEAN_PROP));
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestAbstractDMProvider.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestAbstractDMProvider.java
deleted file mode 100644
index 3f94822..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestAbstractDMProvider.java
+++ /dev/null
@@ -1,205 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.commands.ExecutionException;
-import org.eclipse.core.runtime.IAdaptable;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelPropertyDescriptor;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelOperation;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-
-public class TestAbstractDMProvider extends TestCase {
-
- private static final String INTEGER = "INTEGER";
- private static final String BOOLEAN = "BOOLEAN";
- private static final String STRING = "STRING";
- private static final String OBJECT = "OBJECT";
-
- private class DMOp extends AbstractDataModelOperation {
-
- public DMOp() {
- super();
- }
-
- public DMOp(IDataModel model) {
- super(model);
- }
-
- public IStatus execute(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return null;
- }
-
- public IStatus redo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return null;
- }
-
- public IStatus undo(IProgressMonitor monitor, IAdaptable info) throws ExecutionException {
- return null;
- }
-
- public void setID(String id) {
- super.setID(id);
- }
-
- public String getID() {
- return super.getID();
- }
-
- public void setDataModel(IDataModel model) {
- super.setDataModel(model);
- }
-
- public IDataModel getDataModel() {
- return super.getDataModel();
- }
- }
-
- private class DMProvider extends AbstractDataModelProvider {
-
- public String[] getPropertyNames() {
- return combineProperties(new String[]{INTEGER, BOOLEAN}, new String[]{STRING, OBJECT});
- }
-
- public void init() {
- super.init();
- }
-
- public Object getDefaultProperty(String propertyName) {
- return super.getDefaultProperty(propertyName);
- }
-
- public boolean isPropertyEnabled(String propertyName) {
- return super.isPropertyEnabled(propertyName);
- }
-
- public IStatus validate(String name) {
- return super.validate(name);
- }
-
- public boolean propertySet(String propertyName, Object propertyValue) {
- return super.propertySet(propertyName, propertyValue);
- }
-
- public DataModelPropertyDescriptor getPropertyDescriptor(String propertyName) {
- return super.getPropertyDescriptor(propertyName);
- }
-
- public DataModelPropertyDescriptor[] getValidPropertyDescriptors(String propertyName) {
- return super.getValidPropertyDescriptors(propertyName);
- }
-
- public List getExtendedContext() {
- return super.getExtendedContext();
- }
-
- public IDataModelOperation getDefaultOperation() {
- return super.getDefaultOperation();
- }
-
- public String getID() {
- return super.getID();
- }
-
- public void dispose() {
- super.dispose();
- }
-
- public void protectedTest() {
- super.getProperty(INTEGER);
- super.setProperty(INTEGER, new Integer(1));
- super.getBooleanProperty(BOOLEAN);
- super.setBooleanProperty(BOOLEAN, true);
- super.getIntProperty(INTEGER);
- super.setIntProperty(INTEGER, 1);
- super.getStringProperty(STRING);
- super.isPropertySet(INTEGER);
- }
- }
-
- IDataModelProvider idmp = null;
- AbstractDataModelProvider dmp = null;
- IDataModel dm = null;
-
- IDataModelOperation idmo = null;
- AbstractDataModelOperation dmo = null;
-
- protected void setUp() throws Exception {
- super.setUp();
- dmp = new DMProvider();
- idmp = dmp;
- dm = DataModelFactory.createDataModel(dmp);
- }
-
- public void testAbstractDataModelProvider() {
- dmp.setDataModel(dm);
- assertTrue(dm == dmp.getDataModel());
- assertNotNull(dmp.getPropertyNames());
- dmp.init();
- assertNull(dmp.getDefaultProperty(INTEGER));
- assertTrue(dmp.isPropertyEnabled(INTEGER));
- assertNull(dmp.validate(INTEGER));
- assertTrue(dmp.propertySet(INTEGER, new Integer(1)));
- assertNull(dmp.getPropertyDescriptor(INTEGER));
- assertNull(dmp.getValidPropertyDescriptors(INTEGER));
- assertNull(dmp.getExtendedContext());
- assertNull(dmp.getDefaultOperation());
- assertTrue(dmp.getID().equals(dmp.getClass().getName()));
- ((DMProvider) dmp).protectedTest();
- dmp.dispose();
- }
-
- public void testIDataModelProvider() {
- idmp.setDataModel(dm);
- assertTrue(dm == idmp.getDataModel());
- assertNotNull(idmp.getPropertyNames());
- idmp.init();
- assertNull(idmp.getDefaultProperty(INTEGER));
- assertTrue(idmp.isPropertyEnabled(INTEGER));
- assertNull(idmp.validate(INTEGER));
- assertTrue(idmp.propertySet(INTEGER, new Integer(1)));
- assertNull(idmp.getPropertyDescriptor(INTEGER));
- assertNull(idmp.getValidPropertyDescriptors(INTEGER));
- assertNull(idmp.getExtendedContext());
- assertNull(idmp.getDefaultOperation());
- assertTrue(idmp.getID().equals(idmp.getClass().getName()));
- idmp.dispose();
- }
-
- public void testAbstractDataModelOperation() {
- dmo = new DMOp();
- dmo = new DMOp(dm);
- idmo = dmo;
- dmo.setID("foo");
- assertTrue(dmo.getID().equals("foo"));
- dmo.setDataModel(dm);
- assertTrue(dm == dmo.getDataModel());
- }
-
- public void testIDataModelOperation() {
- dmo = new DMOp();
- idmo = dmo;
- idmo.setID("foo");
- assertTrue(idmo.getID().equals("foo"));
- idmo.setDataModel(dm);
- assertTrue(dm == idmo.getDataModel());
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestDataModelProvider.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestDataModelProvider.java
deleted file mode 100644
index f4e32dd..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestDataModelProvider.java
+++ /dev/null
@@ -1,37 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-
-public class TestDataModelProvider extends AbstractDataModelProvider implements ITestDataModel {
-
- private static int instanceCount = 0;
-
- public static int getInstanceCount() {
- return instanceCount;
- }
-
-
- public TestDataModelProvider(){
- super();
- instanceCount++;
- }
-
- public String[] getPropertyNames() {
- return new String[]{ITestDataModel.FOO};
- }
-
- public String getID() {
- return ITestDataModel.class.getName();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestListener.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestListener.java
deleted file mode 100644
index 3adeb19..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/TestListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.common.frameworks.datamodel.DataModelEvent;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelListener;
-
-public class TestListener implements IDataModelListener {
-
- private ArrayList events = new ArrayList();
-
- public void clearEvents() {
- events.clear();
- }
-
- public List getEvents() {
- return events;
- }
-
- public void propertyChanged(DataModelEvent event) {
- events.add(event);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ValidationTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ValidationTest.java
deleted file mode 100644
index e9b8130..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/datamodel/tests/ValidationTest.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.datamodel.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.runtime.IStatus;
-import org.eclipse.core.runtime.Status;
-import org.eclipse.wst.common.frameworks.datamodel.AbstractDataModelProvider;
-import org.eclipse.wst.common.frameworks.datamodel.DataModelFactory;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModel;
-import org.eclipse.wst.common.frameworks.datamodel.IDataModelProvider;
-import org.eclipse.wst.common.tests.CommonTestsPlugin;
-
-public class ValidationTest extends TestCase {
-
- private static final String A = "A";
- private static final String B = "B";
- private static final String C = "C";
-
- private static final String[] allProperties = new String[]{A, B, C};
-
-
- private class P extends AbstractDataModelProvider {
-
-
- public String[] getPropertyNames() {
- return allProperties;
- }
-
- public IStatus validate(String propertyName) {
- validationList.add(propertyName);
- return status;
- }
- }
-
- private IStatus errorStatus = new Status(IStatus.ERROR, CommonTestsPlugin.PLUGIN_ID, 0, "error", null);
- private IStatus okStatus = IDataModelProvider.OK_STATUS;
-
- private IStatus status;
-
- private List validationList;
-
- private IDataModel dm;
-
- protected void setUp() throws Exception {
- super.setUp();
- dm = DataModelFactory.createDataModel(new P());
- status = okStatus;
- validationList = new ArrayList();
- }
-
- public void testBasicValidation() {
- for (int i = 0; i < 2; i++) {
- boolean ok = i == 0;
- status = ok ? okStatus : errorStatus;
-
- validationList.clear();
- assertTrue(dm.isValid() == ok);
- assertEquals(ok ? 3 : 1, validationList.size());
- assertTrue(validationList.contains(A));
- if (ok) {
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- }
- validationList.clear();
-
- assertTrue(dm.validate().isOK() == ok);
- // TODO
- //assertEquals(ok ? 3 : 1, validationList.size());
- assertTrue(validationList.contains(A));
- if (ok) {
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- }
- validationList.clear();
-
- assertTrue(dm.validate(true).isOK() == ok);
- assertEquals(ok ? 3 : 1, validationList.size());
- validationList.clear();
-
- assertTrue(dm.validate(false).isOK() == ok);
- assertEquals(3, validationList.size());
- assertTrue(validationList.contains(A));
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- validationList.clear();
-
- for (int j = 0; j < allProperties.length; j++) {
- assertTrue(dm.isPropertyValid(allProperties[j]) == ok);
- assertEquals(1, validationList.size());
- assertTrue(validationList.contains(allProperties[j]));
- validationList.clear();
- assertTrue(dm.validateProperty(allProperties[j]).isOK() == ok);
- assertEquals(1, validationList.size());
- assertTrue(validationList.contains(allProperties[j]));
- validationList.clear();
- }
- }
- }
-
- public void testNestedValidation() {
- dm.addNestedModel("a", DataModelFactory.createDataModel(new A()));
- dm.addNestedModel("b", DataModelFactory.createDataModel(new B()));
- dm.addNestedModel("c", DataModelFactory.createDataModel(new C()));
-
- for (int i = 0; i < 4; i++) {
- validationList.clear();
- switch (i) {
- case 0 :
- assertTrue(dm.isValid());
- break;
- case 1 :
- assertTrue(dm.validate().isOK());
- break;
- case 2 :
- assertTrue(dm.validate(true).isOK());
- break;
- case 3 :
- assertTrue(dm.validate(false).isOK());
- break;
- }
- assertEquals(6, validationList.size());
- assertTrue(validationList.contains(A));
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- assertTrue(validationList.contains("a"));
- assertTrue(validationList.contains("b"));
- assertTrue(validationList.contains("c"));
- validationList.clear();
- }
- status = errorStatus;
- for (int i = 0; i < 3; i++) {
- validationList.clear();
- switch (i) {
- case 0 :
- assertTrue(!dm.isValid());
- break;
- case 1 :
- assertTrue(!dm.validate().isOK());
- break;
- case 2 :
- assertTrue(!dm.validate(true).isOK());
- break;
- }
- // TODO
- //assertEquals(1, validationList.size());
- //assertTrue(!validationList.contains("a"));
- //assertTrue(!validationList.contains("b"));
- //assertTrue(!validationList.contains("c"));
- validationList.clear();
- }
-
- assertTrue(!dm.validate(false).isOK());
- assertEquals(6, validationList.size());
- assertTrue(validationList.contains(A));
- assertTrue(validationList.contains(B));
- assertTrue(validationList.contains(C));
- assertTrue(validationList.contains("a"));
- assertTrue(validationList.contains("b"));
- assertTrue(validationList.contains("c"));
- validationList.clear();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/A.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/A.java
deleted file mode 100644
index c5f26bf..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/A.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-public class A extends WTPOperationDataModel {
- public static final String P = "A.P";
-
- public WTPOperation getDefaultOperation() {
- return null;
- }
-
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(P);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/B.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/B.java
deleted file mode 100644
index 84445b7..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/B.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-public class B extends WTPOperationDataModel {
- public static final String P = "B.P";
-
- public WTPOperation getDefaultOperation() {
- return null;
- }
-
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(P);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/C.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/C.java
deleted file mode 100644
index 7954bb4..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/C.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-public class C extends WTPOperationDataModel {
- public static final String P = "C.P";
-
- public WTPOperation getDefaultOperation() {
- return null;
- }
-
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(P);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/EventTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/EventTest.java
deleted file mode 100644
index f1df3e7..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/EventTest.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent;
-
-public class EventTest extends TestCase {
-
- public void testEventCreation() {
- WTPOperationDataModel dm = new A();
- dm.setProperty(A.P, "aaa");
- WTPOperationDataModelEvent event = new WTPOperationDataModelEvent(dm, A.P, WTPOperationDataModelEvent.PROPERTY_CHG);
- assertEquals(dm, event.getDataModel());
- assertEquals(A.P, event.getPropertyName());
- assertEquals("aaa", event.getProperty());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- dm.setProperty(A.P, "bbb");
- assertEquals("bbb", event.getProperty());
- event = new WTPOperationDataModelEvent(dm, A.P, WTPOperationDataModelEvent.ENABLE_CHG);
- assertEquals(WTPOperationDataModelEvent.ENABLE_CHG, event.getFlag());
- event = new WTPOperationDataModelEvent(dm, A.P, WTPOperationDataModelEvent.VALID_VALUES_CHG);
- assertEquals(WTPOperationDataModelEvent.VALID_VALUES_CHG, event.getFlag());
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/NestedListeningTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/NestedListeningTest.java
deleted file mode 100644
index a0fce33..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/NestedListeningTest.java
+++ /dev/null
@@ -1,149 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent;
-
-public class NestedListeningTest extends TestCase {
-
- public void testListeners1() {
- TestListener aL = new TestListener();
- TestListener bL = new TestListener();
- TestListener cL = new TestListener();
-
- A a = new A();
- B b = new B();
- C c = new C();
- a.addListener(aL);
- b.addListener(bL);
- c.addListener(cL);
-
- // cylical
- a.addNestedModel("b", b);
- b.addNestedModel("c", c);
- c.addNestedModel("a", a);
- aL.clearEvents();
- bL.clearEvents();
- cL.clearEvents();
- a.setProperty(A.P, "a");
- b.setProperty(B.P, "b");
- c.setProperty(C.P, "c");
- List aEvents = aL.getEvents();
- List bEvents = bL.getEvents();
- List cEvents = cL.getEvents();
- assertEquals(3, aEvents.size());
- assertEquals(3, bEvents.size());
- assertEquals(3, cEvents.size());
- for (int i = 0; i < 3; i++) {
- WTPOperationDataModelEvent aEvent = (WTPOperationDataModelEvent) aEvents.get(i);
- WTPOperationDataModelEvent bEvent = (WTPOperationDataModelEvent) bEvents.get(i);
- WTPOperationDataModelEvent cEvent = (WTPOperationDataModelEvent) cEvents.get(i);
-
- WTPOperationDataModel dataModel = aEvent.getDataModel();
- assertEquals(bEvent.getDataModel(), dataModel);
- assertEquals(cEvent.getDataModel(), dataModel);
-
- String propertyName = aEvent.getPropertyName();
- assertEquals(bEvent.getPropertyName(), propertyName);
- assertEquals(cEvent.getPropertyName(), propertyName);
-
- int flag = aEvent.getFlag();
- assertEquals(bEvent.getFlag(), flag);
- assertEquals(cEvent.getFlag(), flag);
-
- Object property = aEvent.getProperty();
- assertEquals(bEvent.getProperty(), property);
- assertEquals(cEvent.getProperty(), property);
- switch (i) {
- case 0 :
- assertEquals(a, dataModel);
- assertEquals(flag, WTPOperationDataModelEvent.PROPERTY_CHG);
- assertEquals(propertyName, A.P);
- assertEquals(property, "a");
- assertTrue(dataModel.isSet(propertyName));
- break;
- case 1 :
- assertEquals(b, dataModel);
- assertEquals(flag, WTPOperationDataModelEvent.PROPERTY_CHG);
- assertEquals(propertyName, B.P);
- assertEquals(property, "b");
- assertTrue(dataModel.isSet(propertyName));
- break;
- case 2 :
- assertEquals(c, dataModel);
- assertEquals(flag, WTPOperationDataModelEvent.PROPERTY_CHG);
- assertEquals(propertyName, C.P);
- assertEquals(property, "c");
- assertTrue(dataModel.isSet(propertyName));
- break;
- }
- }
-
- aL.clearEvents();
- bL.clearEvents();
- cL.clearEvents();
- a.setProperty(A.P, null);
- b.setProperty(B.P, null);
- c.setProperty(C.P, null);
- aEvents = aL.getEvents();
- bEvents = bL.getEvents();
- cEvents = cL.getEvents();
- assertEquals(3, aEvents.size());
- assertEquals(3, bEvents.size());
- assertEquals(3, cEvents.size());
- for (int i = 0; i < 3; i++) {
- WTPOperationDataModelEvent aEvent = (WTPOperationDataModelEvent) aEvents.get(i);
- WTPOperationDataModelEvent bEvent = (WTPOperationDataModelEvent) bEvents.get(i);
- WTPOperationDataModelEvent cEvent = (WTPOperationDataModelEvent) cEvents.get(i);
-
- WTPOperationDataModel dataModel = aEvent.getDataModel();
- assertEquals(bEvent.getDataModel(), dataModel);
- assertEquals(cEvent.getDataModel(), dataModel);
-
- String propertyName = aEvent.getPropertyName();
- assertEquals(bEvent.getPropertyName(), propertyName);
- assertEquals(cEvent.getPropertyName(), propertyName);
-
- int flag = aEvent.getFlag();
- assertEquals(bEvent.getFlag(), flag);
- assertEquals(cEvent.getFlag(), flag);
-
- Object property = aEvent.getProperty();
- assertEquals(bEvent.getProperty(), property);
- assertEquals(cEvent.getProperty(), property);
- switch (i) {
- case 0 :
- assertEquals(a, dataModel);
- assertEquals(flag, WTPOperationDataModelEvent.PROPERTY_CHG);
- assertEquals(propertyName, A.P);
- assertTrue(!dataModel.isSet(propertyName));
- break;
- case 1 :
- assertEquals(b, dataModel);
- assertEquals(flag, WTPOperationDataModelEvent.PROPERTY_CHG);
- assertEquals(propertyName, B.P);
- assertTrue(!dataModel.isSet(propertyName));
- break;
- case 2 :
- assertEquals(c, dataModel);
- assertEquals(flag, WTPOperationDataModelEvent.PROPERTY_CHG);
- assertEquals(propertyName, C.P);
- assertTrue(!dataModel.isSet(propertyName));
- break;
- }
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/NestingTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/NestingTest.java
deleted file mode 100644
index 1ce5d1c..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/NestingTest.java
+++ /dev/null
@@ -1,299 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import junit.framework.Assert;
-import junit.framework.TestCase;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class NestingTest extends TestCase {
-
- private A a;
- private B b;
- private C c;
-
- protected void setUp() throws Exception {
- super.setUp();
- a = new A();
- b = new B();
- c = new C();
- }
-
- protected void tearDown() throws Exception {
- if (null != a) {
- a.dispose();
- a = null;
- }
- if (null != b) {
- b.dispose();
- b = null;
- }
-
- if (null != c) {
- c.dispose();
- c = null;
- }
- }
-
-
- /**
- * <code>
- * 1 2 3 4 5 6
- * A | A | A | A | A | A
- * B | | B | B | B | B
- * C | | C
- * </code>
- */
- public void testIsPropertySimpleNesting0() {
- a.addNestedModel("b", b); // 1
- Assert.assertTrue(a.isProperty(B.P));
-
- a.removeNestedModel("b"); // 2
- Assert.assertFalse(a.isProperty(B.P));
-
- a.addNestedModel("b", b); // 3
- Assert.assertTrue(a.isProperty(B.P));
-
- b.addNestedModel("c", c); // 4
- Assert.assertTrue(a.isProperty(C.P));
-
- b.removeNestedModel("c"); // 5
- Assert.assertFalse(a.isProperty(C.P));
-
- b.addNestedModel("c", c); // 6
- Assert.assertTrue(a.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4
- * A | A | A | A
- * B | B | B |
- * C | |
- * </code>
- */
- public void testIsPropertySimpleNesting1() {
- a.addNestedModel("b", b); // 1
- Assert.assertTrue(a.isProperty(B.P));
-
- b.addNestedModel("c", c); // 2
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(C.P));
-
- b.removeNestedModel("c"); // 3
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(C.P));
-
- a.removeNestedModel("b"); // 4
- Assert.assertFalse(a.isProperty(B.P));
- }
-
- /**
- * <code>
- * 1 2 3 4
- * A | A | A | A
- * | B | |
- * B | C | B | B
- * C | | C |
- * | | C
- * </code>
- */
- public void testIsPropertySimpleNesting2() {
- b.addNestedModel("c", c); // 1
- Assert.assertTrue(b.isProperty(C.P));
-
- a.addNestedModel("b", b); // 2
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
-
- a.removeNestedModel("b"); // 3
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
-
- b.removeNestedModel("c"); // 4
- Assert.assertFalse(b.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5
- * A | A | A | A | A
- * B | B | B | B | B
- * C | C | C |
- * | C2 |
- * </code>
- */
- public void testIsPropertyComplexNesting1() {
- a.addNestedModel("b", b); // 1
- b.addNestedModel("c", c); // 2
- Assert.assertTrue(a.isProperty(C.P));
- C c2 = new C();
- b.addNestedModel("c2", c2); // 3
- b.removeNestedModel("c2"); // 4
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c"); // 5
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertFalse(a.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5 6 7
- * A | A | A | A | A | A | A
- * B | B | B | B | B | B | B
- * C | C | C | C | C2 |
- * C2 | C2 |
- * </code>
- */
- public void testIsPropertyComplexNesting2() {
- a.addNestedModel("b", b); // 1
- b.addNestedModel("c", c); // 2
- Assert.assertTrue(a.isProperty(C.P));
- C c2 = new C();
- a.addNestedModel("c2", c2); // 3
- a.removeNestedModel("c2"); // 4
- Assert.assertTrue(a.isProperty(C.P));
- b.addNestedModel("c2", c2); // 5
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c"); // 6
- Assert.assertTrue(a.isProperty(C.P));
- b.removeNestedModel("c2"); // 7
- Assert.assertFalse(a.isProperty(C.P));
- }
-
- /**
- * <code>
- * 1 2 3 4 5 6
- * A | A | B | A | C | A
- * B | B | C | B | A | B
- * C | C | A | C | B | C
- * A (loop) | | A(loop)
- * </code>
- */
- public void testIsPropertyComplexNesting3() {
- a.addNestedModel("b", b);
- b.addNestedModel("c", c); // 1
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertFalse(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- c.addNestedModel("a", a); // 2
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- a.removeNestedModel("b"); // 3
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- a.addNestedModel("b", b); // 4
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertTrue(a.isProperty(C.P));
- Assert.assertTrue(b.isProperty(A.P));
- Assert.assertTrue(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- b.removeNestedModel("c"); // 5
- Assert.assertTrue(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertTrue(c.isProperty(A.P));
- Assert.assertTrue(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- c.removeNestedModel("a");
- a.removeNestedModel("b");
- Assert.assertFalse(a.isProperty(B.P));
- Assert.assertFalse(a.isProperty(C.P));
- Assert.assertFalse(b.isProperty(A.P));
- Assert.assertFalse(b.isProperty(C.P));
- Assert.assertFalse(c.isProperty(A.P));
- Assert.assertFalse(c.isProperty(B.P));
- Assert.assertFalse(a.isProperty("foo"));
- Assert.assertFalse(b.isProperty("foo"));
- Assert.assertFalse(c.isProperty("foo"));
- }
-
- public void testSetGetProperty1() {
- // cylical
- a.addNestedModel("b", b);
- b.addNestedModel("c", c);
- c.addNestedModel("a", a);
-
- a.setProperty(A.P, "a");
- a.setProperty(B.P, "b");
- a.setProperty(C.P, "c");
- assertEquals("a", a.getProperty(A.P));
- assertEquals("a", b.getProperty(A.P));
- assertEquals("a", c.getProperty(A.P));
- assertEquals("b", a.getProperty(B.P));
- assertEquals("b", b.getProperty(B.P));
- assertEquals("b", c.getProperty(B.P));
- assertEquals("c", a.getProperty(C.P));
- assertEquals("c", b.getProperty(C.P));
- assertEquals("c", c.getProperty(C.P));
-
- b.setProperty(A.P, "aa");
- b.setProperty(B.P, "bb");
- b.setProperty(C.P, "cc");
- assertEquals("aa", a.getProperty(A.P));
- assertEquals("aa", b.getProperty(A.P));
- assertEquals("aa", c.getProperty(A.P));
- assertEquals("bb", a.getProperty(B.P));
- assertEquals("bb", b.getProperty(B.P));
- assertEquals("bb", c.getProperty(B.P));
- assertEquals("cc", a.getProperty(C.P));
- assertEquals("cc", b.getProperty(C.P));
- assertEquals("cc", c.getProperty(C.P));
-
- c.setProperty(A.P, "aaa");
- c.setProperty(B.P, "bbb");
- c.setProperty(C.P, "ccc");
- assertEquals("aaa", a.getProperty(A.P));
- assertEquals("aaa", b.getProperty(A.P));
- assertEquals("aaa", c.getProperty(A.P));
- assertEquals("bbb", a.getProperty(B.P));
- assertEquals("bbb", b.getProperty(B.P));
- assertEquals("bbb", c.getProperty(B.P));
- assertEquals("ccc", a.getProperty(C.P));
- assertEquals("ccc", b.getProperty(C.P));
- assertEquals("ccc", c.getProperty(C.P));
- }
-
-
-}
\ No newline at end of file
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/SimpleDataModelTest.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/SimpleDataModelTest.java
deleted file mode 100644
index d2e0d2b..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/SimpleDataModelTest.java
+++ /dev/null
@@ -1,279 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPPropertyDescriptor;
-
-public class SimpleDataModelTest extends TestCase {
-
- private class DM extends WTPOperationDataModel {
- public static final String INT_PROP = "INT_PROP";
- public static final String INT_PROP2 = "INT_PROP2";
- public static final String INT_PROP3 = "INT_PROP3";
- public static final String INT_PROP4 = "INT_PROP4";
- public static final String BOOLEAN_PROP = "BOOLEAN_PROP";
- public static final String BOOLEAN_PROP2 = "BOOLEAN_PROP2";
- public static final String STRING_PROP = "STRING_PROP";
-
- protected void initValidBaseProperties() {
- super.initValidBaseProperties();
- addValidBaseProperty(INT_PROP);
- addValidBaseProperty(INT_PROP2);
- addValidBaseProperty(INT_PROP3);
- addValidBaseProperty(INT_PROP4);
- addValidBaseProperty(BOOLEAN_PROP);
- addValidBaseProperty(BOOLEAN_PROP2);
- addValidBaseProperty(STRING_PROP);
- }
-
- protected Object getDefaultProperty(String propertyName) {
- if (propertyName.equals(INT_PROP)) {
- return new Integer(10);
- } else if (propertyName.equals(INT_PROP2)) {
- return getProperty(INT_PROP);
- } else if (propertyName.equals(BOOLEAN_PROP)) {
- return Boolean.TRUE;
- } else if (propertyName.equals(STRING_PROP)) {
- return "foo" + getProperty(INT_PROP) + getProperty(BOOLEAN_PROP);
- }
- return super.getDefaultProperty(propertyName);
- }
-
- protected Boolean basicIsEnabled(String propertyName) {
- if (propertyName.equals(BOOLEAN_PROP2)) {
- return (Boolean) getProperty(BOOLEAN_PROP);
- }
- return super.basicIsEnabled(propertyName);
- }
-
- protected boolean doSetProperty(String propertyName, Object propertyValue) {
- boolean success = super.doSetProperty(propertyName, propertyValue);
- if (propertyName.equals(INT_PROP)) {
- notifyDefaultChange(INT_PROP2);
- notifyValidValuesChange(INT_PROP2);
- notifyDefaultChange(STRING_PROP);
- }
- if (propertyName.equals(BOOLEAN_PROP)) {
- notifyEnablementChange(BOOLEAN_PROP2);
- notifyDefaultChange(STRING_PROP);
- }
- return success;
- }
-
- protected WTPPropertyDescriptor[] doGetValidPropertyDescriptors(String propertyName) {
- if (INT_PROP2.equals(propertyName)) {
- int range = getIntProperty(INT_PROP);
- Integer[] ints = new Integer[range];
- for (int i = 0; i < ints.length; i++) {
- ints[i] = new Integer(i + 1);
- }
- return WTPPropertyDescriptor.createDescriptors(ints);
- }
- if (INT_PROP3.equals(propertyName)) {
- int range = 3;
- Integer[] ints = new Integer[range];
- for (int i = 0; i < ints.length; i++) {
- ints[i] = new Integer(i + 1);
- }
- String[] descriptions = new String[]{"one", "two", "three"};
- return WTPPropertyDescriptor.createDescriptors(ints, descriptions);
- }
- if (INT_PROP4.equals(propertyName)) {
- WTPPropertyDescriptor[] descriptors = new WTPPropertyDescriptor[3];
- String[] descriptions = new String[]{"one", "two", "three"};
- for (int i = 0; i < descriptors.length; i++) {
- descriptors[i] = new WTPPropertyDescriptor(new Integer(i + 1), descriptions[i]);
- }
- return descriptors;
- }
- return super.doGetValidPropertyDescriptors(propertyName);
- }
-
- public WTPOperation getDefaultOperation() {
- return null;
- }
- };
-
- private DM dm;
- private TestListener dmL;
-
- protected void setUp() throws Exception {
- super.setUp();
- dm = new DM();
- dmL = new TestListener();
- dm.addListener(dmL);
- }
-
- public void testPropertyDescriptors() {
- WTPPropertyDescriptor[] descriptors = dm.getValidPropertyDescriptors(DM.INT_PROP2);
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals("" + value, descriptors[i].getPropertyDescription());
- }
- descriptors = dm.getValidPropertyDescriptors(DM.INT_PROP3);
- String[] descriptions = new String[]{"one", "two", "three"};
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals(descriptions[i], descriptors[i].getPropertyDescription());
- }
- descriptors = dm.getValidPropertyDescriptors(DM.INT_PROP4);
- for (int i = 0; i < descriptors.length; i++) {
- int value = i + 1;
- assertEquals(value, ((Integer) descriptors[i].getPropertyValue()).intValue());
- assertEquals(descriptions[i], descriptors[i].getPropertyDescription());
- }
- }
-
-
- public void testDefaults() {
- assertEquals(true, dm.getBooleanProperty(DM.BOOLEAN_PROP));
- assertEquals(true, ((Boolean) dm.getProperty(DM.BOOLEAN_PROP)).booleanValue());
- assertEquals(10, dm.getIntProperty(DM.INT_PROP));
- assertEquals(10, ((Integer) dm.getProperty(DM.INT_PROP)).intValue());
- assertEquals("foo10true", (String) dm.getProperty(DM.STRING_PROP));
- assertEquals("foo10true", dm.getStringProperty(DM.STRING_PROP));
- }
-
- public void testFiringEvents() {
- dmL.clearEvents();
- dm.notifyDefaultChange(DM.INT_PROP2);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
- WTPOperationDataModelEvent event = (WTPOperationDataModelEvent) events.get(0);
- assertEquals(DM.INT_PROP2, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
-
- dmL.clearEvents();
- dm.notifyValidValuesChange(DM.INT_PROP2);
- events = dmL.getEvents();
- assertEquals(1, events.size());
- event = (WTPOperationDataModelEvent) events.get(0);
- assertEquals(DM.INT_PROP2, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.VALID_VALUES_CHG, event.getFlag());
- }
-
- public void testSimpleSetEvents() {
- dmL.clearEvents();
- dm.setIntProperty(DM.INT_PROP2, 100);
- List events = dmL.getEvents();
- assertEquals(1, events.size());
- WTPOperationDataModelEvent event = (WTPOperationDataModelEvent) events.get(0);
- assertEquals(DM.INT_PROP2, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- assertEquals(100, dm.getIntProperty(DM.INT_PROP2));
-
- dmL.clearEvents();
- dm.setIntProperty(DM.INT_PROP2, 100);
- events = dmL.getEvents();
- assertEquals(0, events.size());
-
- dmL.clearEvents();
- dm.setIntProperty(DM.INT_PROP2, 101);
- events = dmL.getEvents();
- assertEquals(1, events.size());
- event = (WTPOperationDataModelEvent) events.get(0);
- assertEquals(DM.INT_PROP2, event.getPropertyName());
- }
-
- public void testComplexEvents() {
- dmL.clearEvents();
- dm.setIntProperty(DM.INT_PROP, 11);
- List events = dmL.getEvents();
- assertEquals(4, events.size());
-
- WTPOperationDataModelEvent event = (WTPOperationDataModelEvent) events.get(0);
- assertEquals(DM.INT_PROP2, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- assertEquals(11, ((Integer) dm.getProperty(DM.INT_PROP2)).intValue());
-
- event = (WTPOperationDataModelEvent) events.get(1);
- assertEquals(DM.INT_PROP2, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.VALID_VALUES_CHG, event.getFlag());
- WTPPropertyDescriptor[] descriptors = event.getValidPropertyDescriptors();
- WTPPropertyDescriptor[] descriptors2 = dm.getValidPropertyDescriptors(DM.INT_PROP2);
- assertEquals(11, descriptors.length);
- assertEquals(11, descriptors2.length);
-
- event = (WTPOperationDataModelEvent) events.get(2);
- assertEquals(DM.STRING_PROP, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- assertEquals("foo11true", event.getProperty());
-
- event = (WTPOperationDataModelEvent) events.get(3);
- assertEquals(DM.INT_PROP, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- assertEquals(11, ((Integer) dm.getProperty(DM.INT_PROP)).intValue());
-
- dmL.clearEvents();
- dm.setBooleanProperty(DM.BOOLEAN_PROP, false);
- events = dmL.getEvents();
- assertEquals(3, events.size());
- event = (WTPOperationDataModelEvent) events.get(0);
- assertEquals(DM.BOOLEAN_PROP2, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.ENABLE_CHG, event.getFlag());
- assertFalse(dm.isEnabled(DM.BOOLEAN_PROP2).booleanValue());
-
- event = (WTPOperationDataModelEvent) events.get(1);
- assertEquals(DM.STRING_PROP, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- assertEquals("foo11false", event.getProperty());
-
- event = (WTPOperationDataModelEvent) events.get(2);
- assertEquals(DM.BOOLEAN_PROP, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- assertEquals(false, dm.getBooleanProperty(DM.BOOLEAN_PROP));
-
- dm.setProperty(DM.STRING_PROP, "bar");
- assertEquals("bar", dm.getStringProperty(DM.STRING_PROP));
- dmL.clearEvents();
- dm.setBooleanProperty(DM.BOOLEAN_PROP, true);
- events = dmL.getEvents();
- assertEquals(2, events.size());
- event = (WTPOperationDataModelEvent) events.get(0);
- assertEquals(DM.BOOLEAN_PROP2, event.getPropertyName());
- event = (WTPOperationDataModelEvent) events.get(1);
- assertEquals(DM.BOOLEAN_PROP, event.getPropertyName());
-
- assertEquals("bar", dm.getStringProperty(DM.STRING_PROP));
- dm.setProperty(DM.STRING_PROP, null);
- assertEquals("foo11true", dm.getStringProperty(DM.STRING_PROP));
- dmL.clearEvents();
- dm.setBooleanProperty(DM.BOOLEAN_PROP, false);
- events = dmL.getEvents();
- assertEquals(3, events.size());
- event = (WTPOperationDataModelEvent) events.get(0);
- assertEquals(DM.BOOLEAN_PROP2, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.ENABLE_CHG, event.getFlag());
- assertFalse(dm.isEnabled(DM.BOOLEAN_PROP2).booleanValue());
-
- event = (WTPOperationDataModelEvent) events.get(1);
- assertEquals(DM.STRING_PROP, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- assertEquals("foo11false", event.getProperty());
-
- event = (WTPOperationDataModelEvent) events.get(2);
- assertEquals(DM.BOOLEAN_PROP, event.getPropertyName());
- assertEquals(WTPOperationDataModelEvent.PROPERTY_CHG, event.getFlag());
- assertEquals(false, dm.getBooleanProperty(DM.BOOLEAN_PROP));
-
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/TestListener.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/TestListener.java
deleted file mode 100644
index 433480c..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/TestListener.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelEvent;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModelListener;
-
-public class TestListener implements WTPOperationDataModelListener {
-
- private ArrayList events = new ArrayList();
-
- public void clearEvents() {
- events.clear();
- }
-
- public List getEvents() {
- return events;
- }
-
- public void propertyChanged(WTPOperationDataModelEvent event) {
- events.add(event);
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/WTPOperationAPITests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/WTPOperationAPITests.java
deleted file mode 100644
index 7b888ad..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/WTPOperationAPITests.java
+++ /dev/null
@@ -1,39 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-import org.eclipse.wst.common.frameworks.operations.tests.extended.OpTests;
-import org.eclipse.wst.common.tests.SimpleTestSuite;
-
-/**
- * @author jsholl
- *
- * TODO To change the template for this generated type comment go to Window - Preferences - Java -
- * Code Style - Code Templates
- */
-public class WTPOperationAPITests extends TestSuite {
-
- public static Test suite() {
- return new WTPOperationAPITests();
- }
-
- public WTPOperationAPITests() {
- super();
- addTest(new SimpleTestSuite(EventTest.class));
- addTest(new SimpleTestSuite(NestingTest.class));
- addTest(new SimpleTestSuite(NestedListeningTest.class));
- addTest(new SimpleTestSuite(SimpleDataModelTest.class));
- addTest(new SimpleTestSuite(OpTests.class));
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/A.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/A.java
deleted file mode 100644
index 6a153e6..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/A.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-
-public class A extends AbstractTestOperation {
-
- public A() {
- super();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/AbstractTestOperation.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/AbstractTestOperation.java
deleted file mode 100644
index 476879d..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/AbstractTestOperation.java
+++ /dev/null
@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-import java.lang.reflect.InvocationTargetException;
-
-import org.eclipse.core.runtime.CoreException;
-import org.eclipse.core.runtime.IProgressMonitor;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-public class AbstractTestOperation extends WTPOperation {
-
- public AbstractTestOperation() {
- super();
- }
-
- public AbstractTestOperation(WTPOperationDataModel dm) {
- super(dm);
- }
-
- protected void execute(IProgressMonitor monitor) throws CoreException, InvocationTargetException, InterruptedException {
- OpTests.executionList.add(getClass().getName());
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/B.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/B.java
deleted file mode 100644
index 0f7dc81..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/B.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-
-public class B extends AbstractTestOperation {
-
- public B() {
- super();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/C.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/C.java
deleted file mode 100644
index f3720b8..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/C.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-
-public class C extends AbstractTestOperation {
-
- public C() {
- super();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/D.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/D.java
deleted file mode 100644
index 1ddf000..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/D.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-public class D extends AbstractTestOperation {
-
- public D() {
- super();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/E.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/E.java
deleted file mode 100644
index a8474fe..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/E.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-public class E extends AbstractTestOperation {
-
- public E() {
- super();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/F.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/F.java
deleted file mode 100644
index c0fcd5f..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/F.java
+++ /dev/null
@@ -1,19 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-public class F extends AbstractTestOperation {
-
- public F() {
- super();
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/OpTests.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/OpTests.java
deleted file mode 100644
index 6360af8..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/OpTests.java
+++ /dev/null
@@ -1,146 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-public class OpTests extends TestCase {
-
- public static List executionList = new ArrayList();
-
- public static final String a = A.class.getName();
- public static final String b = B.class.getName();
- public static final String c = C.class.getName();
- public static final String d = D.class.getName();
- public static final String e = E.class.getName();
- public static final String f = F.class.getName();
- public static final String r = R.class.getName();
-
-
- private String[] expectedExecution;
-
- protected void setUp() throws Exception {
- super.setUp();
- executionList.clear();
- expectedExecution = null;
- IProject p = ResourcesPlugin.getWorkspace().getRoot().getProject("foo");
- if(!p.exists()){
- p.create(null);
- }
- }
-
- public void testAllOn() throws Exception {
- RootDM dm = new RootDM();
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{c, a, d, r, e, b, f};
- checkResults();
- }
-
- public void testAllOff() throws Exception {
- RootDM dm = new RootDM();
- dm.setBooleanProperty(WTPOperationDataModel.ALLOW_EXTENSIONS, false);
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{r};
- checkResults();
- }
-
- public void testAOff() throws Exception {
- RootDM dm = new RootDM();
- List restrictedList = new ArrayList();
- restrictedList.add(a);
- dm.setProperty(WTPOperationDataModel.RESTRICT_EXTENSIONS, restrictedList);
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{r, e, b, f};
- checkResults();
- }
-
- public void testBOff() throws Exception {
- RootDM dm = new RootDM();
- List restrictedList = new ArrayList();
- restrictedList.add(b);
- dm.setProperty(WTPOperationDataModel.RESTRICT_EXTENSIONS, restrictedList);
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{c, a, d, r};
- checkResults();
- }
-
- public void testCOff() throws Exception {
- RootDM dm = new RootDM();
- List restrictedList = new ArrayList();
- restrictedList.add(c);
- dm.setProperty(WTPOperationDataModel.RESTRICT_EXTENSIONS, restrictedList);
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{a, d, r, e, b, f};
- checkResults();
- }
-
- public void testCFOff() throws Exception {
- RootDM dm = new RootDM();
- List restrictedList = new ArrayList();
- restrictedList.add(c);
- restrictedList.add(f);
- dm.setProperty(WTPOperationDataModel.RESTRICT_EXTENSIONS, restrictedList);
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{a, d, r, e, b};
- checkResults();
- }
-
- public void testCBOff() throws Exception {
- RootDM dm = new RootDM();
- List restrictedList = new ArrayList();
- restrictedList.add(c);
- restrictedList.add(b);
- dm.setProperty(WTPOperationDataModel.RESTRICT_EXTENSIONS, restrictedList);
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{a, d, r};
- checkResults();
- }
-
- public void testAEFOff() throws Exception {
- RootDM dm = new RootDM();
- List restrictedList = new ArrayList();
- restrictedList.add(a);
- restrictedList.add(e);
- restrictedList.add(f);
- dm.setProperty(WTPOperationDataModel.RESTRICT_EXTENSIONS, restrictedList);
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{r, b};
- checkResults();
- }
-
- public void testABOff() throws Exception {
- RootDM dm = new RootDM();
- List restrictedList = new ArrayList();
- restrictedList.add(a);
- restrictedList.add(b);
- dm.setProperty(WTPOperationDataModel.RESTRICT_EXTENSIONS, restrictedList);
- dm.getDefaultOperation().run(null);
- expectedExecution = new String[]{r};
- checkResults();
- }
-
-
- private void checkResults() {
- assertEquals(expectedExecution.length, executionList.size());
- for (int i = 0; i < expectedExecution.length; i++) {
- assertEquals(expectedExecution[i], (String) executionList.get(i));
- }
-
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/R.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/R.java
deleted file mode 100644
index a5ed681..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/R.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-
-public class R extends AbstractTestOperation {
-
- public R(WTPOperationDataModel dm){
- super(dm);
- }
-
- public R() {
- super();
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/RootDM.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/RootDM.java
deleted file mode 100644
index 9db3419..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/operations/tests/extended/RootDM.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2003, 2005 IBM Corporation and others.
- * All rights reserved. This program and the accompanying materials
- * are made available under the terms of the Eclipse Public License v1.0
- * which accompanies this distribution, and is available at
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * IBM Corporation - initial API and implementation
- *******************************************************************************/
-package org.eclipse.wst.common.frameworks.operations.tests.extended;
-
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.resources.ResourcesPlugin;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperation;
-import org.eclipse.wst.common.frameworks.internal.operations.WTPOperationDataModel;
-
-public class RootDM extends WTPOperationDataModel {
-
- public WTPOperation getDefaultOperation() {
- return new R(this);
- }
-
- public IProject getTargetProject() {
- return ResourcesPlugin.getWorkspace().getRoot().getProject("foo");
- }
-
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVT.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVT.java
deleted file mode 100644
index 6401dc8..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVT.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Created on Apr 1, 2003
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-package org.eclipse.wst.common.frameworks.tests.bvt;
-
-import java.net.URL;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-import junit.textui.TestRunner;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-import org.eclipse.wst.common.frameworks.artifactedit.tests.ArtifactEditAPITests;
-import org.eclipse.wst.common.frameworks.componentcore.tests.AllTests;
-import org.eclipse.wst.common.frameworks.datamodel.tests.DataModelAPITests;
-
-
-/**
- * @author jsholl
- *
- * To change this generated comment go to
- * Window>Preferences>Java>Code Generation>Code and Comments
- */
-public class AutomatedBVT extends TestSuite {
-
- public static String baseDirectory = System.getProperty("user.dir") + java.io.File.separatorChar + "TestData" + java.io.File.separatorChar;
-
- static {
- try {
- IPluginDescriptor pluginDescriptor = Platform.getPluginRegistry().getPluginDescriptor("org.eclipse.wst.common.tests");
- URL url = pluginDescriptor.getInstallURL();
- AutomatedBVT.baseDirectory = Platform.asLocalURL(url).getFile() + "TestData"+ java.io.File.separatorChar;
- } catch (Exception e) {
- System.err.println("Using working directory since a workspace URL could not be located.");
- }
- }
-
- public static int unimplementedMethods;
-
- public static void main(String[] args) {
- unimplementedMethods = 0;
- TestRunner.run(suite());
- if (unimplementedMethods > 0) {
- System.out.println("\nCalls to warnUnimpl: " + unimplementedMethods);
- }
- }
-
- public AutomatedBVT() {
- super();
- TestSuite suite = (TestSuite) AutomatedBVT.suite();
- for (int i = 0; i < suite.testCount(); i++) {
- addTest(suite.testAt(i));
- }
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite("Test for org.eclipse.wst.common.test.bvt");
- suite.addTest(AllTests.suite());
- suite.addTest(DataModelAPITests.suite());
- suite.addTest(ArtifactEditAPITests.suite());
- return suite;
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVTEclipse.java b/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVTEclipse.java
deleted file mode 100644
index 2f1623e..0000000
--- a/tests/org.eclipse.wst.common.tests/frameworktests/org/eclipse/wst/common/frameworks/tests/bvt/AutomatedBVTEclipse.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Created on Mar 25, 2004
- *
- * To change the template for this generated file go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-package org.eclipse.wst.common.frameworks.tests.bvt;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.eclipse.core.runtime.IPluginDescriptor;
-import org.eclipse.core.runtime.Platform;
-
-/**
- * @author jsholl
- *
- * To change the template for this generated type comment go to
- * Window - Preferences - Java - Code Generation - Code and Comments
- */
-public class AutomatedBVTEclipse extends AutomatedBVT {
-
- public AutomatedBVTEclipse(){
- super();
- IPluginDescriptor pluginDescriptor = Platform.getPluginRegistry().getPluginDescriptor("org.eclipse.wst.common.tests");
- URL url = pluginDescriptor.getInstallURL();
- try {
- AutomatedBVT.baseDirectory = Platform.asLocalURL(url).getFile() + "TestData"+ java.io.File.separatorChar;
- } catch (IOException e) {
- // TODO Auto-generated catch block
- e.printStackTrace();
- }
- }
-}
diff --git a/tests/org.eclipse.wst.common.tests/plugin.xml b/tests/org.eclipse.wst.common.tests/plugin.xml
deleted file mode 100644
index 039980d..0000000
--- a/tests/org.eclipse.wst.common.tests/plugin.xml
+++ /dev/null
@@ -1,114 +0,0 @@
-<?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="Eclipse.org"
- 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.eclipse.core.resources" export="true"/>
- <import plugin="org.eclipse.core.runtime.compatibility"/>
- <import plugin="org.eclipse.wst.common.frameworks" export="true"/>
- <import plugin="org.eclipse.wst.common.emfworkbench.integration"/>
- <import plugin="org.eclipse.emf.common"/>
- <import plugin="org.eclipse.emf.ecore"/>
- <import plugin="org.eclipse.core.commands"/>
- <import plugin="org.eclipse.wst.common.modulecore"/>
- <import plugin="org.eclipse.wst.common.tests.collector" export="true"/>
- <import plugin="org.eclipse.jem.util" />
- </requires>
- <extension-point id="DataModelVerifier" name="Data Model Verifier Factory Extension" schema="schema/dataModelVerifier.exsd"/>
-
- <extension
- point="org.eclipse.wst.common.tests.collector.suites">
- <suite
- class="org.eclipse.wst.common.frameworks.operations.tests.WTPOperationAPITests"
- name="WTP Operation API Tests">
- </suite>
- </extension>
- <extension
- point="org.eclipse.wst.common.tests.collector.suites">
- <suite
- class="org.eclipse.wst.common.frameworks.datamodel.tests.DataModelAPITests"
- name="IDataModel API Tests">
- </suite>
- </extension>
- <extension
- point="org.eclipse.wst.common.frameworks.DataModelProviderExtension">
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider"
- id="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- <DataModelProvider
- class="bogusClass"
- id="bogus"/>
- <ProviderDefinesType
- providerType="testProviderBase"
- providerID="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- <ProviderDefinesType
- providerType="testProviderBogus"
- providerID="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- <ProviderImplementsType
- providerType="testProviderBogus"
- providerID="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModelBogus"/>
- <ProviderImplementsType
- providerType="testProviderBogus"
- providerID="fake.nonregistered.functiongroup.ITestDataModel"
- />
- <!-- Test for incomplete id's, classes' and duplicates
- <DataModelProvider
- class=""
- id="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider"
- id=""/>
- <DataModelProvider
- class="org.eclipse.wst.common.frameworks.datamodel.tests.TestDataModelProvider"
- id="org.eclipse.wst.common.frameworks.datamodel.tests.ITestDataModel"/>
- -->
- </extension>
-
- <extension
- point="org.eclipse.wst.common.tests.collector.suites">
- <suite
- class=" org.eclipse.wst.common.frameworks.tests.bvt.AutomatedBVT"
- name="Common Framework BVT Tests"/>
- </extension>
-
- <extension
- point="org.eclipse.wst.common.frameworks.OperationExtension"
- id="org.eclipse.wst.common.frameworks.operations.tests.extended">
- <operationExtension
- id="org.eclipse.wst.common.frameworks.operations.tests.extended.R"
- postOperationClass="org.eclipse.wst.common.frameworks.operations.tests.extended.B"
- preOperationClass="org.eclipse.wst.common.frameworks.operations.tests.extended.A"/>
- <operationExtension
- id="org.eclipse.wst.common.frameworks.operations.tests.extended.A"
- postOperationClass="org.eclipse.wst.common.frameworks.operations.tests.extended.D"
- preOperationClass="org.eclipse.wst.common.frameworks.operations.tests.extended.C"/>
- <operationExtension
- id="org.eclipse.wst.common.frameworks.operations.tests.extended.B"
- postOperationClass="org.eclipse.wst.common.frameworks.operations.tests.extended.F"
- preOperationClass="org.eclipse.wst.common.frameworks.operations.tests.extended.E"/>
- </extension>
- <extension
- point="org.eclipse.wst.common.frameworks.ExtendableOperation">
- <extendableOperation
- class="org.eclipse.wst.common.frameworks.operations.tests.extended.A"
- id="org.eclipse.wst.common.frameworks.operations.tests.extended.A"/>
- <extendableOperation
- class="org.eclipse.wst.common.frameworks.operations.tests.extended.B"
- id="org.eclipse.wst.common.frameworks.operations.tests.extended.B"/>
- <extendableOperation
- class="org.eclipse.wst.common.frameworks.operations.tests.extended.R"
- id="org.eclipse.wst.common.frameworks.operations.tests.extended.R"/>
- </extension>
-
-</plugin>
diff --git a/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd b/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd
deleted file mode 100644
index 96228a5..0000000
--- a/tests/org.eclipse.wst.common.tests/schema/dataModelVerifier.exsd
+++ /dev/null
@@ -1,98 +0,0 @@
-<?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/test.xml b/tests/org.eclipse.wst.common.tests/test.xml
deleted file mode 100644
index c71e412..0000000
--- a/tests/org.eclipse.wst.common.tests/test.xml
+++ /dev/null
@@ -1,56 +0,0 @@
-<?xml version="1.0"?>
-
-<project name="testsuite" default="run" basedir=".">
- <!-- The property ${eclipse-home} should be passed into this script -->
- <!-- Set a meaningful default value for when it is not. -->
- <property name="eclipse-home" value="${basedir}\..\.."/>
-
- <!-- sets the properties eclipse-home, and library-file -->
- <property name="plugin-name" value="org.eclipse.wst.common.tests"/>
- <property name="library-file" value="${eclipse-home}/plugins/org.eclipse.test_3.1.0/library.xml"/>
- <property name="extraVMargs" value="-Dorg.eclipse.jst.server.jonas.432=${jonas432Dir}"/>
-
- <property name="workspace" value="${basedir}/${plugin-name}"/>
-
- <!-- This target holds all initialization code that needs to be done for -->
- <!-- all tests that are to be run. Initialization for individual tests -->
- <!-- should be done within the body of the suite target. -->
- <target name="init">
- <tstamp/>
- <delete>
- <fileset dir="${eclipse-home}" includes="org*.xml"/>
- </delete>
- </target>
-
- <!-- This target defines the tests that need to be run. -->
- <target name="suite">
- <delete dir="${workspace}" quiet="true"/>
-
- <ant target="core-test" antfile="${library-file}" dir="${eclipse-home}">
- <property name="data-dir" value="${workspace}"/>
- <property name="plugin-name" value="${plugin-name}"/>
- <property name="classname" value="org.eclipse.wst.common.frameworks.tests.bvt.AutomatedBVT"/>
- <property name="extraVMargs" value="${extraVMargs}"/>
- </ant>
- </target>
-
- <!-- This target holds code to cleanup the testing environment after -->
- <!-- after all of the tests have been run. You can use this target to -->
- <!-- delete temporary files that have been created. -->
- <target name="cleanup">
- <delete dir="${workspace}" quiet="true"/>
- </target>
-
- <!-- This target runs the test suite. Any actions that need to happen -->
- <!-- after all the tests have been run should go here. -->
- <target name="run" depends="init,suite,cleanup">
- <ant target="collect" antfile="${library-file}" dir="${eclipse-home}">
- <property name="includes" value="org*.xml"/>
- <property name="output-file" value="${plugin-name}.xml"/>
- </ant>
- </target>
-
-</project>
-
-
-
diff --git a/tests/org.eclipse.wst.common.tests/testData/TestArtifactEdit.zip b/tests/org.eclipse.wst.common.tests/testData/TestArtifactEdit.zip
deleted file mode 100644
index 3ce561e..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/TestArtifactEdit.zip
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.wst.common.tests/testData/TestVirtualAPI.zip b/tests/org.eclipse.wst.common.tests/testData/TestVirtualAPI.zip
deleted file mode 100644
index e7633b0..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/TestVirtualAPI.zip
+++ /dev/null
Binary files differ
diff --git a/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml b/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml
deleted file mode 100644
index 7d83766..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/baseData_01.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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
deleted file mode 100644
index 179c62e..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_01.xml
+++ /dev/null
@@ -1,6 +0,0 @@
-<?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
deleted file mode 100644
index 8bff745..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/equalTo_01_case_02.xml
+++ /dev/null
@@ -1,15 +0,0 @@
-<?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
deleted file mode 100644
index 7d1040c..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_01.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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
deleted file mode 100644
index c6ea028..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_02.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?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
deleted file mode 100644
index 1f29c2e..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_03.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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
deleted file mode 100644
index 840bd03..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_04.xml
+++ /dev/null
@@ -1,18 +0,0 @@
-<?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
deleted file mode 100644
index ac6b8bf..0000000
--- a/tests/org.eclipse.wst.common.tests/testData/unequalTo_01_case_05.xml
+++ /dev/null
@@ -1,17 +0,0 @@
-<?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>