First drop of refactoring test plugin
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.classpath b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.classpath
new file mode 100644
index 0000000..64c5e31
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+	<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+	<classpathentry kind="src" path="src"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.project b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.project
new file mode 100644
index 0000000..eb71558
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>org.eclipse.tigerstripe.workbench.refactor.test</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/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000..c91fd46
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+#Wed Jul 23 11:26:18 BST 2008
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/META-INF/MANIFEST.MF b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/META-INF/MANIFEST.MF
new file mode 100644
index 0000000..d5b4065
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/META-INF/MANIFEST.MF
@@ -0,0 +1,21 @@
+Bundle-ManifestVersion: 2
+Bundle-ActivationPolicy: lazy
+Bundle-Name: Refactor Test Plug-in
+Bundle-Version: 1.0.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.tigerstripe.workebnch.ui.visualeditor.test,
+ org.eclipse.tigerstripe.workbench.ui.base.test,
+ org.junit,
+ com.windowtester.runtime,
+ com.windowtester.swt.runtime,
+ com.windowtester.swing.runtime,
+ com.instantiations.eclipse.debug,
+ org.eclipse.jface,
+ com.instantiations.common.core,
+ com.instantiations.eclipse.util,
+ org.eclipse.swt
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-SymbolicName: org.eclipse.tigerstripe.workbench.refactor.test
+Manifest-Version: 1.0
+Bundle-Activator: org.eclipse.tigerstripe.refactor.test.Activator
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/build.properties b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/build.properties
new file mode 100644
index 0000000..34d2e4d
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+               .
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/changes/ModifyAttributeDetails.java b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/changes/ModifyAttributeDetails.java
new file mode 100644
index 0000000..be2e0d9
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/changes/ModifyAttributeDetails.java
@@ -0,0 +1,10 @@
+package org.eclipse.tigerstripe.refactor.changes;
+
+import com.windowtester.runtime.swt.UITestCaseSWT;
+
+public class ModifyAttributeDetails extends UITestCaseSWT {
+
+	
+	// This test case modifies the details of an attribute and checks the 
+	// revised settings appear in appropriate places.
+}
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/changes/UpdateComponents.java b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/changes/UpdateComponents.java
new file mode 100644
index 0000000..3c6fcc7
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/changes/UpdateComponents.java
@@ -0,0 +1,132 @@
+package org.eclipse.tigerstripe.refactor.changes;
+
+import java.util.ArrayList;
+
+import org.eclipse.tigerstripe.ui.visualeditor.test.finders.LocatorFactory;
+import org.eclipse.tigerstripe.ui.visualeditor.test.suite.DiagramConstants;
+import org.eclipse.tigerstripe.workbench.ui.base.test.suite.TestingConstants;
+import org.eclipse.tigerstripe.workbench.ui.base.test.utils.GuiUtils;
+
+import com.windowtester.runtime.IUIContext;
+import com.windowtester.runtime.swt.UITestCaseSWT;
+import com.windowtester.runtime.swt.locator.CTabItemLocator;
+import com.windowtester.runtime.swt.locator.LabeledTextLocator;
+import com.windowtester.runtime.swt.locator.eclipse.ContributedToolItemLocator;
+
+public class UpdateComponents extends UITestCaseSWT {
+
+	String entityName = TestingConstants.ENTITY_NAMES[2];
+	String enumerationName = TestingConstants.ENUMERATION_NAMES[2];
+	
+	
+	String pathRoot = TestingConstants.NEW_MODEL_PROJECT_NAME+"/src/"+
+					  TestingConstants.DEFAULT_ARTIFACT_PACKAGE+"."+
+					  TestingConstants.DIAGRAM_PACKAGE+
+					  "/";
+	
+	/**
+	 * Main test method.
+	 */
+	public void testUpdateComponents() throws Exception {
+		IUIContext ui = getUI();
+		// Open the diagram
+		GuiUtils.openExplorerItem(ui, pathRoot+DiagramConstants.CREATE_DIAGRAM);
+		checkAttribute(ui);
+		checkMethod(ui);
+		
+	}
+	
+	public void checkAttribute(IUIContext ui) throws Exception{
+		// Start as THIS MUST PRE_EXIST
+		String attributeName = DiagramConstants.ATTRIBUTE_NAMES[0];
+		// change to
+		String newAttributeName = DiagramConstants.ATTRIBUTE_NAMES[1];
+		// Open the artifact/go to the attribute
+		GuiUtils.openExplorerItem(ui, pathRoot+entityName+"/"+attributeName+":"+"String");
+		
+		// Change it
+		LabeledTextLocator name = new LabeledTextLocator("Name: ");
+		GuiUtils.clearText(ui, name);
+		ui.click(name);
+		
+		ui.enterText(newAttributeName);
+		// Save Everything
+		ui.click(new ContributedToolItemLocator("org.eclipse.ui.file.save"));
+		ui.click(new CTabItemLocator("*PaletteCreate.wvd"));
+		ui.click(new ContributedToolItemLocator("org.eclipse.ui.file.save"));
+		
+		// now look for the changed Item on the diagram
+		
+		ArrayList<String> items = new ArrayList<String>();
+		String attributeText = LocatorFactory.getInstance().getFieldString(ui,entityName,newAttributeName);
+		assertNotNull("Did not find renamed attribute on diagram.", attributeText);
+		
+		// Should also look at diagrams that were closed when we did the modification
+		
+		// remember to close it afterwards
+		
+	}
+
+	public void checkMethod(IUIContext ui) throws Exception{
+		// Start as THIS MUST PRE_EXIST
+		String methodName = DiagramConstants.METHOD_NAMES[0];
+		// change to
+		String newMethodName = DiagramConstants.METHOD_NAMES[1];
+		// Open the artifact/go to the attribute
+		GuiUtils.openExplorerItem(ui, pathRoot+entityName+"/"+methodName+"():void");
+		
+		// Change it
+		LabeledTextLocator name = new LabeledTextLocator("Name: ");
+		GuiUtils.clearText(ui, name);
+		ui.click(name);
+		
+		ui.enterText(newMethodName);
+		// Save Everything
+		ui.click(new ContributedToolItemLocator("org.eclipse.ui.file.save"));
+		ui.click(new CTabItemLocator("*PaletteCreate.wvd"));
+		ui.click(new ContributedToolItemLocator("org.eclipse.ui.file.save"));
+		
+		// now look for the changed Item on the diagram
+		
+		ArrayList<String> items = new ArrayList<String>();
+		String methodText = LocatorFactory.getInstance().getMethodString(ui,entityName,newMethodName);
+		assertNotNull("Did not find renamed method on diagram.", methodText);
+		
+		// Should also look at diagrams that were closed when we did the modification
+		
+		// remember to close it afterwards
+		
+	}
+	
+	public void checkLiteral(IUIContext ui) throws Exception{
+		// Start as THIS MUST PRE_EXIST
+		String literalName = DiagramConstants.LITERAL_NAMES[0];
+		// change to
+		String newliteralName = DiagramConstants.LITERAL_NAMES[1];
+		// Open the artifact/go to the attribute
+		GuiUtils.openExplorerItem(ui, pathRoot+enumerationName+"/"+literalName+"=0");
+		
+		// Change it
+		LabeledTextLocator name = new LabeledTextLocator("Name: ");
+		GuiUtils.clearText(ui, name);
+		ui.click(name);
+		
+		ui.enterText(newliteralName);
+		// Save Everything
+		ui.click(new ContributedToolItemLocator("org.eclipse.ui.file.save"));
+		ui.click(new CTabItemLocator("*PaletteCreate.wvd"));
+		ui.click(new ContributedToolItemLocator("org.eclipse.ui.file.save"));
+		
+		// now look for the changed Item on the diagram
+		
+		ArrayList<String> items = new ArrayList<String>();
+		String literalText = LocatorFactory.getInstance().getLiteralString(ui,entityName,newliteralName);
+		assertNotNull("Did not find renamed literal on diagram.", literalText);
+		
+		// Should also look at diagrams that were closed when we did the modification
+		
+		// remember to close it afterwards
+		
+	}
+	
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/suite/RefactorTestSuite.java b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/suite/RefactorTestSuite.java
new file mode 100644
index 0000000..35eedc1
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/suite/RefactorTestSuite.java
@@ -0,0 +1,39 @@
+package org.eclipse.tigerstripe.refactor.suite;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+import org.eclipse.tigerstripe.refactor.changes.UpdateComponents;
+import org.eclipse.tigerstripe.ui.visualeditor.test.diagram.CreateDiagram;
+import org.eclipse.tigerstripe.ui.visualeditor.test.diagram.EditorBasedUpdates;
+import org.eclipse.tigerstripe.ui.visualeditor.test.project.CreatePackage;
+import org.eclipse.tigerstripe.workbench.ui.base.test.project.NewProject;
+
+public class RefactorTestSuite extends TestCase {
+	
+	public static Test suite()
+    {
+	TestSuite suite = new TestSuite(); 
+    suite.addTestSuite(SimpleCleanWorkspace.class);
+    
+    // Most of the following could be replaced by an XML Load process
+    
+    // creates a new Project - do this so we are in the TS perspective
+    suite.addTestSuite(NewProject.class);
+    // Add a package to locate the diagram
+    suite.addTestSuite(CreatePackage.class);
+    
+    // The CreateDiagram is a place for Creating Artifacts!
+    suite.addTestSuite(CreateDiagram.class);
+    suite.addTestSuite(EditorBasedUpdates.class);
+    
+    // Up to HERE
+    
+    // This is the good stuff...
+    suite.addTestSuite(UpdateComponents.class);
+    
+    
+    return suite;
+    }
+}
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/suite/SimpleCleanWorkspace.java b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/suite/SimpleCleanWorkspace.java
new file mode 100644
index 0000000..057a34a
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/suite/SimpleCleanWorkspace.java
@@ -0,0 +1,47 @@
+package org.eclipse.tigerstripe.refactor.suite;
+
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IWorkbench;
+import org.eclipse.ui.IWorkbenchWindow;
+import org.eclipse.ui.PlatformUI;
+
+import com.windowtester.runtime.IUIContext;
+import com.windowtester.runtime.locator.XYLocator;
+import com.windowtester.runtime.swt.UITestCaseSWT;
+import com.windowtester.runtime.swt.condition.shell.ShellDisposedCondition;
+import com.windowtester.runtime.swt.condition.shell.ShellShowingCondition;
+import com.windowtester.runtime.swt.locator.ButtonLocator;
+import com.windowtester.runtime.swt.locator.CTabItemLocator;
+import com.windowtester.runtime.swt.locator.LabeledTextLocator;
+import com.windowtester.runtime.swt.locator.MenuItemLocator;
+import com.windowtester.runtime.swt.locator.TableItemLocator;
+
+public class SimpleCleanWorkspace extends UITestCaseSWT {
+
+	static void maximizeWorkbench() {
+        Display.getDefault().syncExec(new Runnable()
+        {
+            public void run()
+            {
+                IWorkbench workbench = PlatformUI.getWorkbench();
+                IWorkbenchWindow window = workbench.getActiveWorkbenchWindow();
+                window.getShell().setMaximized(true);
+            }
+        });
+}
+
+	
+	
+	/**
+	 * Main test method.
+	 */
+	public void testCleanWorkspace() throws Exception {
+		maximizeWorkbench();
+		IUIContext ui = getUI();
+		ui.close(new CTabItemLocator("Welcome"));
+
+		
+	}
+	
+	
+}
\ No newline at end of file
diff --git a/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/test/Activator.java b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/test/Activator.java
new file mode 100644
index 0000000..9ce221a
--- /dev/null
+++ b/plugins/org.eclipse.tigerstripe.workbench.refactor.test/src/org/eclipse/tigerstripe/refactor/test/Activator.java
@@ -0,0 +1,50 @@
+package org.eclipse.tigerstripe.refactor.test;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+	// The plug-in ID
+	public static final String PLUGIN_ID = "org.eclipse.tigerstripe.refactor.test";
+
+	// The shared instance
+	private static Activator plugin;
+	
+	/**
+	 * The constructor
+	 */
+	public Activator() {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+	 */
+	public void start(BundleContext context) throws Exception {
+		super.start(context);
+		plugin = this;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+	 */
+	public void stop(BundleContext context) throws Exception {
+		plugin = null;
+		super.stop(context);
+	}
+
+	/**
+	 * Returns the shared instance
+	 *
+	 * @return the shared instance
+	 */
+	public static Activator getDefault() {
+		return plugin;
+	}
+
+}