Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Constant2012-08-22 12:31:38 +0000
committerOlivier Constant2012-08-22 12:31:38 +0000
commit2697446190ca15017df9e898bc6a62807af1b5e3 (patch)
tree3312cc11ec00d75644f9ce1276ddec33dcd6cebe /tests/org.eclipse.emf.diffmerge.tests.wt.elements
parent26bfdbbebe068b50db9c38032212bc25b28508b1 (diff)
downloadorg.eclipse.emf.diffmerge.core-2697446190ca15017df9e898bc6a62807af1b5e3.tar.gz
org.eclipse.emf.diffmerge.core-2697446190ca15017df9e898bc6a62807af1b5e3.tar.xz
org.eclipse.emf.diffmerge.core-2697446190ca15017df9e898bc6a62807af1b5e3.zip
Added workspace cleanup
Diffstat (limited to 'tests/org.eclipse.emf.diffmerge.tests.wt.elements')
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/EDM-WT-Tests.launch39
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/META-INF/MANIFEST.MF1
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/Activator.java6
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/DiffMergeTestCase.java182
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/TestUtil.java27
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/GraphTest.java56
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/HierarchyAdditionTest.java94
7 files changed, 402 insertions, 3 deletions
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/EDM-WT-Tests.launch b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/EDM-WT-Tests.launch
new file mode 100644
index 00000000..986856cc
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/EDM-WT-Tests.launch
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc:org.eclipse.emf.diffmerge.tests.workspace/testWk}"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="2"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.emf.diffmerge.tests.wt.elements/src&lt;org.eclipse.emf.diffmerge.tests.wt.elements.cases"/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit3"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value=""/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog -clean"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.emf.diffmerge.tests.wt.elements"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/META-INF/MANIFEST.MF b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/META-INF/MANIFEST.MF
index 7101f6f5..94e9604d 100644
--- a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/META-INF/MANIFEST.MF
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/META-INF/MANIFEST.MF
@@ -3,6 +3,7 @@ Bundle-RequiredExecutionEnvironment: JavaSE-1.6
Manifest-Version: 1.0
Bundle-Activator: org.eclipse.emf.diffmerge.tests.wt.elements.Activator
Require-Bundle: org.eclipse.core.runtime,
+ org.eclipse.ui,
org.junit,
com.windowtester.runtime,
com.windowtester.swt.runtime,
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/Activator.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/Activator.java
index faa83e05..0ea603fc 100644
--- a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/Activator.java
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/Activator.java
@@ -6,11 +6,11 @@ import org.osgi.framework.BundleContext;
public class Activator implements BundleActivator {
private static BundleContext context;
-
+
static BundleContext getContext() {
return context;
}
-
+
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
@@ -18,7 +18,7 @@ public class Activator implements BundleActivator {
public void start(BundleContext bundleContext) throws Exception {
Activator.context = bundleContext;
}
-
+
/*
* (non-Javadoc)
* @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/DiffMergeTestCase.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/DiffMergeTestCase.java
new file mode 100644
index 00000000..d1f56647
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/DiffMergeTestCase.java
@@ -0,0 +1,182 @@
+package org.eclipse.emf.diffmerge.tests.wt.elements;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IFolder;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.IProjectDescription;
+import org.eclipse.core.resources.IWorkspace;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.IPath;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.ui.IPerspectiveDescriptor;
+import org.eclipse.ui.PlatformUI;
+
+import com.windowtester.runtime.IUIContext;
+import com.windowtester.runtime.WT;
+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.TreeItemLocator;
+import com.windowtester.runtime.swt.locator.eclipse.ViewLocator;
+import com.windowtester.runtime.swt.locator.eclipse.WorkbenchLocator;
+
+
+/**
+ * A common superclass for tests on diff/merge
+ */
+public abstract class DiffMergeTestCase extends UITestCaseSWT {
+
+ private static final String PREDEFINED_PROJECT_NAME = "PredefinedExamples";
+ private static final String CURRENT_PROJECT_NAME = "Example";
+ private static boolean _initialized = false;
+ private static IProject __predefinedProject, __currentProject;
+ private static final String MODEL1 = "Ex1.elements";
+ private static final String MODEL2 = "Ex2.elements";
+ private static final char SEP = '/';
+
+
+ /**
+ * Apply the checks that must hold before and after save
+ * @throws Exception
+ */
+ protected void checkPersistency() throws Exception {
+ IUIContext ui = getUI();
+ persistencyChecks(ui);
+ saveAndRecompareInFolder();
+ persistencyChecks(ui);
+ }
+
+ /**
+ * Close the firstly found compare editor
+ * @param dirty whether the editor is expected to be dirty
+ * @throws Exception
+ */
+ protected void closeCompareEditor(boolean dirty) throws Exception {
+ IUIContext ui = getUI();
+ final String editorName = (dirty? "*": "") + "Compare";
+ ui.contextClick(new CTabItemLocator(editorName), "Close");
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ if (dirty) {
+ ui.wait(new ShellShowingCondition("Save Resource"));
+ ui.click(new ButtonLocator("&Yes"));
+ ui.wait(new ShellDisposedCondition("Save Resource"));
+ }
+ }
+
+ /**
+ * Compare the 2 models at the current path
+ * @param restore whether the saved version of the files should be restored first
+ * @throws Exception
+ */
+ protected void compareInFolder(boolean restore) throws Exception {
+ IUIContext ui = getUI();
+ if (restore)
+ restoreSavedModels(getModelPath());
+ final String current1 = CURRENT_PROJECT_NAME + SEP + MODEL1;
+ final String current2 = CURRENT_PROJECT_NAME + SEP + MODEL2;
+ ui.click(new TreeItemLocator(current1,
+ new ViewLocator("org.eclipse.jdt.ui.PackageExplorer")));
+ ui.click(1, new TreeItemLocator(current2,
+ new ViewLocator("org.eclipse.jdt.ui.PackageExplorer")), WT.CTRL);
+ ui.contextClick(new TreeItemLocator(current1,
+ new ViewLocator("org.eclipse.jdt.ui.PackageExplorer")),
+ "Compare With/Each Other as models");
+ ui.wait(new ShellShowingCondition("EMF Diff/Merge"));
+ ui.click(new ButtonLocator("&Finish"));
+ ui.wait(new ShellDisposedCondition("EMF Diff/Merge"));
+ }
+
+ /**
+ * Return the path to the models to be compared
+ * @return a non-null path in the examples folder, e.g., "FolderName"
+ */
+ protected abstract String getModelPath();
+
+ /**
+ * Define the checks that must hold before and after save
+ * @param ui a non-null UI context
+ * @throws Exception
+ */
+ protected void persistencyChecks(IUIContext ui) throws Exception {
+ // Override if checkPersistency() is used
+ }
+
+ /**
+ * Restore the models saved for comparison at the given path
+ * @param path a non-null workspace path, e.g., "ProjectName/FolderName"
+ * @throws Exception
+ */
+ private void restoreSavedModels(String path) throws Exception {
+ // Destination files
+ IFile file1 = __currentProject.getFile(MODEL1);
+ if (file1.exists())
+ file1.delete(true, null);
+ IFile file2 = __currentProject.getFile(MODEL2);
+ if (file2.exists())
+ file2.delete(true, null);
+ // Origin files
+ IFolder folder = __predefinedProject.getFolder(path);
+ IFile predefinedFile1 = folder.getFile(MODEL1);
+ if (predefinedFile1.exists())
+ predefinedFile1.copy(file1.getFullPath(), true, null);
+ IFile predefinedFile2 = folder.getFile(MODEL2);
+ if (predefinedFile2.exists())
+ predefinedFile2.copy(file2.getFullPath(), true, null);
+ }
+
+ /**
+ * Save and close the current comparison and re-open it at the given path
+ * @param ui a non-null WindowTester UI context
+ * @param path a non-null workspace path, e.g., "ProjectName/FolderName"
+ * @throws Exception
+ */
+ protected void saveAndRecompareInFolder() throws Exception {
+ closeCompareEditor(true);
+ compareInFolder(false);
+ }
+
+ /* @see junit.framework.TestCase#setUp()
+ */
+ protected void setUp() throws Exception {
+ super.setUp();
+ IUIContext ui = getUI();
+ ui.ensureThat(new WorkbenchLocator().hasFocus());
+ ui.ensureThat(ViewLocator.forName("Welcome").isClosed());
+ if (!_initialized)
+ setupWorkspace();
+ }
+
+ /**
+ * Setup the workspace
+ * @throws Exception
+ */
+ private void setupWorkspace() throws Exception {
+ IProgressMonitor monitor = new NullProgressMonitor();
+ IWorkspace wk = ResourcesPlugin.getWorkspace();
+ // Current test project
+ __currentProject = ResourcesPlugin.getWorkspace().getRoot().getProject(CURRENT_PROJECT_NAME);
+ __currentProject.create(monitor);
+ __currentProject.open(monitor);
+ // Predefined test project
+ IPath wkPath = wk.getRoot().getLocation();
+ IPath containingFolder = wkPath.uptoSegment(wkPath.segmentCount()-1);
+ IPath predefinedTestProjectPath = containingFolder.append(PREDEFINED_PROJECT_NAME);
+ IProjectDescription description = wk.loadProjectDescription(predefinedTestProjectPath.append(".project"));
+ __predefinedProject = ResourcesPlugin.getWorkspace().getRoot().getProject(PREDEFINED_PROJECT_NAME);
+ __predefinedProject.create(description, monitor);
+ __predefinedProject.open(monitor);
+ PlatformUI.getWorkbench().getDisplay().syncExec(new Runnable() {
+ @Override
+ public void run() {
+ IPerspectiveDescriptor perspective =
+ PlatformUI.getWorkbench().getPerspectiveRegistry().findPerspectiveWithId("org.eclipse.pde.ui.PDEPerspective");
+ PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().setPerspective(perspective);
+ }
+ });
+ _initialized = true;
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/TestUtil.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/TestUtil.java
new file mode 100644
index 00000000..57a71a49
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/TestUtil.java
@@ -0,0 +1,27 @@
+package org.eclipse.emf.diffmerge.tests.wt.elements;
+
+import com.windowtester.runtime.IUIContext;
+import com.windowtester.runtime.swt.condition.shell.ShellDisposedCondition;
+import com.windowtester.runtime.swt.locator.ShellLocator;
+
+
+/**
+ * A utility class for tests
+ */
+public class TestUtil {
+
+ private TestUtil() {}
+
+
+ /**
+ * Wait for the shell to be closed
+ * @param ui a non-null WindowTester UI context
+ * @throws Exception
+ */
+ public static void waitForClosing(IUIContext ui) throws Exception {
+ ui.ensureThat(new ShellLocator(
+ "Plug-in Development - Compare - Eclipse Platform").isClosed());
+ ui.wait(new ShellDisposedCondition("Eclipse Platform"));
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/GraphTest.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/GraphTest.java
new file mode 100644
index 00000000..d0b9529d
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/GraphTest.java
@@ -0,0 +1,56 @@
+package org.eclipse.emf.diffmerge.tests.wt.elements.cases;
+
+import org.eclipse.emf.diffmerge.tests.wt.elements.DiffMergeTestCase;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Tree;
+
+import com.windowtester.runtime.IUIContext;
+import com.windowtester.runtime.swt.locator.SWTWidgetLocator;
+import com.windowtester.runtime.swt.locator.TreeItemLocator;
+
+public class GraphTest extends DiffMergeTestCase {
+
+ /**
+ * @see org.eclipse.emf.diffmerge.tests.wt.elements.DiffMergeTestCase#getModelPath()
+ */
+ @Override
+ protected String getModelPath() {
+ return "Graph";
+ }
+
+ /**
+ * Main test method.
+ */
+ public void testGraph() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Root (8)/Edge N3-to-NB-Container",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Composite.class,
+ 0, new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (8)/Node N2 (4)", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (8)", new SWTWidgetLocator(Tree.class,
+ new SWTWidgetLocator(Composite.class, 0, new SWTWidgetLocator(
+ SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (8)/Node N2 (4)/Node N22 (2)",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Composite.class,
+ 0, new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (8)/Node N2 (4)/Node N22 (2)/Node N221",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Composite.class,
+ 0, new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator(
+ "Root (8)/Node N2 (4)/Node N22 (2)/Edge N221-to-N3",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Composite.class,
+ 0, new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (8)/Node N3 (2)", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (8)/Referencing Node ToN221", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ closeCompareEditor(false);
+ }
+
+} \ No newline at end of file
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/HierarchyAdditionTest.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/HierarchyAdditionTest.java
new file mode 100644
index 00000000..68882bfb
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/HierarchyAdditionTest.java
@@ -0,0 +1,94 @@
+package org.eclipse.emf.diffmerge.tests.wt.elements.cases;
+
+import org.eclipse.emf.diffmerge.tests.wt.elements.DiffMergeTestCase;
+import org.eclipse.swt.custom.SashForm;
+import org.eclipse.swt.widgets.Composite;
+import org.eclipse.swt.widgets.Group;
+import org.eclipse.swt.widgets.ToolBar;
+import org.eclipse.swt.widgets.ToolItem;
+import org.eclipse.swt.widgets.Tree;
+
+import com.windowtester.runtime.IUIContext;
+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.SWTWidgetLocator;
+import com.windowtester.runtime.swt.locator.TreeItemLocator;
+
+public class HierarchyAdditionTest extends DiffMergeTestCase {
+
+ /**
+ * @see org.eclipse.emf.diffmerge.tests.wt.elements.DiffMergeTestCase#getModelPath()
+ */
+ @Override
+ protected String getModelPath() {
+ return "HierarchyAddition";
+ }
+
+ /**
+ * Main test method.
+ */
+ public void testHierarchyAddition() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Root (8)/Element B (7)/Element D (2)",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Composite.class,
+ 0, new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new SWTWidgetLocator(ToolItem.class, "", 2, new SWTWidgetLocator(
+ ToolBar.class, new SWTWidgetLocator(Composite.class,
+ new SWTWidgetLocator(Composite.class, 1, new SWTWidgetLocator(
+ SashForm.class))))));
+ ui.wait(new ShellShowingCondition("Merge Operation"));
+ ui.click(new ButtonLocator("Include differences in children"));
+ ui.click(new ButtonLocator("OK"));
+ ui.wait(new ShellDisposedCondition("Merge Operation"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellShowingCondition("Merge Operation"));
+ ui.click(new TreeItemLocator("Element E/Deletion", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Group.class, "Implied changes"))));
+ ui.click(new TreeItemLocator("Element F/Deletion", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Group.class, "Implied changes"))));
+ ui.click(new ButtonLocator("OK"));
+ ui.wait(new ShellDisposedCondition("Merge Operation"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.click(new TreeItemLocator(
+ "Root (5)/Element B (4)/Element G (2)/Element H", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new SWTWidgetLocator(ToolItem.class, "", 0, new SWTWidgetLocator(
+ ToolBar.class, new SWTWidgetLocator(Composite.class,
+ new SWTWidgetLocator(Composite.class, 1, new SWTWidgetLocator(
+ SashForm.class))))));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellShowingCondition("Merge Operation"));
+ ui.click(new TreeItemLocator(
+ "Element B/Addition into Root (via 'content')", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Group.class, "Implied changes"))));
+ ui.click(new TreeItemLocator(
+ "Element G/Addition into Element B (via 'manyContent')",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new ButtonLocator("OK"));
+ ui.wait(new ShellDisposedCondition("Merge Operation"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ checkPersistency();
+ closeCompareEditor(false);
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.tests.wt.elements.DiffMergeTestCase#persistencyChecks(com.windowtester.runtime.IUIContext)
+ */
+ @Override
+ protected void persistencyChecks(IUIContext ui) throws Exception {
+ ui.click(new TreeItemLocator(
+ "Root (2)/Element B (2)/Element G (1)/Element I", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (2)/Element B (2)/Element C",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Composite.class,
+ 0, new SWTWidgetLocator(SashForm.class)))));
+ }
+
+} \ No newline at end of file

Back to the top