Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Constant2012-08-22 15:08:58 +0000
committerOlivier Constant2012-08-22 15:08:58 +0000
commitf62d5c3d69ad2502cccc2ecb779d39b23375bd05 (patch)
tree66d2be43e6d44929a32da71862e49ddb207eba51 /tests/org.eclipse.emf.diffmerge.tests.wt.elements
parent5d0ee9c6640ab3e8367a3ad279e534247679a117 (diff)
downloadorg.eclipse.emf.diffmerge.core-f62d5c3d69ad2502cccc2ecb779d39b23375bd05.tar.gz
org.eclipse.emf.diffmerge.core-f62d5c3d69ad2502cccc2ecb779d39b23375bd05.tar.xz
org.eclipse.emf.diffmerge.core-f62d5c3d69ad2502cccc2ecb779d39b23375bd05.zip
Series of tests, completed.
Diffstat (limited to 'tests/org.eclipse.emf.diffmerge.tests.wt.elements')
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/Graph.java52
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/HierarchyAddition.java91
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditions.java57
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditionsMandatory.java89
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditionsNested.java67
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/MandatoryRefChange.java66
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/MovedInAdded.java83
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/NestedReferencedAddition.java53
-rw-r--r--tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/NestedReferencedAdditionOpposites.java53
9 files changed, 611 insertions, 0 deletions
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/Graph.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/Graph.java
new file mode 100644
index 00000000..68057e6c
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/Graph.java
@@ -0,0 +1,52 @@
+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;
+
+
+/**
+ * Basic differences on a graph model
+ */
+public class Graph extends DiffMergeTestCase {
+
+ /**
+ * 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)))));
+ closeEditors();
+ }
+
+} \ 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/HierarchyAddition.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/HierarchyAddition.java
new file mode 100644
index 00000000..7b8b12a0
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/HierarchyAddition.java
@@ -0,0 +1,91 @@
+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;
+
+
+/**
+ * Merge addition/deletion in a hierarchy (container-child dependency).
+ * Persistence check.
+ */
+public class HierarchyAddition extends DiffMergeTestCase {
+
+ /**
+ * 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"));
+ checkPersistence();
+ closeEditors();
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.tests.wt.elements.DiffMergeTestCase#persistenceChecks(com.windowtester.runtime.IUIContext)
+ */
+ @Override
+ protected void persistenceChecks(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
diff --git a/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditions.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditions.java
new file mode 100644
index 00000000..9927c58e
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditions.java
@@ -0,0 +1,57 @@
+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.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;
+
+
+/**
+ * Deletion of an element referenced by elements present and absent in the opposite scope.
+ * Persistence check.
+ */
+public class InterReferencedAdditions extends DiffMergeTestCase {
+
+ /**
+ * Main test method.
+ */
+ public void testInterReferencedAdditions() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Root (3)/Element E2", 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 ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellShowingCondition("Merge Operation"));
+ ui.click(new ButtonLocator("OK"));
+ ui.wait(new ShellDisposedCondition("Merge Operation"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ checkPersistence();
+ closeEditors();
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.tests.wt.elements.DiffMergeTestCase#persistenceChecks(com.windowtester.runtime.IUIContext)
+ */
+ @Override
+ protected void persistenceChecks(IUIContext ui) throws Exception {
+ ui.click(new TreeItemLocator("Root (1)/Element E3", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ }
+
+} \ 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/InterReferencedAdditionsMandatory.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditionsMandatory.java
new file mode 100644
index 00000000..210d3d12
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditionsMandatory.java
@@ -0,0 +1,89 @@
+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;
+
+
+/**
+ * Addition/deletion of a chain of elements due to a mandatory reference.
+ */
+public class InterReferencedAdditionsMandatory extends DiffMergeTestCase {
+
+ /**
+ * Main test method.
+ */
+ public void testInterReferencedAdditionsMandatory() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Root (5)/Node N1", 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 ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellShowingCondition("Merge Operation"));
+ ui.click(new TreeItemLocator("Node N1/Deletion", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Group.class, "Required changes"))));
+ ui.click(new TreeItemLocator("Referencing Node RN1/Deletion",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new TreeItemLocator("Referencing Node RN2/Deletion",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new TreeItemLocator("Referencing Node RN3/Deletion",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new TreeItemLocator("Referencing Node RN4/Deletion",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new ButtonLocator("Cancel"));
+ ui.wait(new ShellDisposedCondition("Merge Operation"));
+ ui.click(new TreeItemLocator("Root (5)/Referencing Node RN4",
+ 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(
+ "Referencing Node RN4/Addition into Root (via 'content')",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Required changes"))));
+ ui.click(new TreeItemLocator("Node N1/Addition into Root (via 'content')",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new TreeItemLocator(
+ "Referencing Node RN1/Addition into Root (via 'content')",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new TreeItemLocator(
+ "Referencing Node RN2/Addition into Root (via 'content')",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new TreeItemLocator(
+ "Referencing Node RN3/Addition into Root (via 'content')",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Implied changes"))));
+ ui.click(new ButtonLocator("OK"));
+ closeEditors();
+ }
+
+} \ 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/InterReferencedAdditionsNested.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditionsNested.java
new file mode 100644
index 00000000..2d0484c5
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/InterReferencedAdditionsNested.java
@@ -0,0 +1,67 @@
+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;
+
+
+/**
+ * Same as InterReferencedAdditions, except that the element deleted is nested.
+ * Persistence check.
+ */
+public class InterReferencedAdditionsNested extends DiffMergeTestCase {
+
+ /**
+ * Main test method.
+ */
+ public void testInterReferencedAdditionsNested() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Root (4)/Element E4 (1)/Element E2",
+ 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 ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellShowingCondition("Merge Operation"));
+ ui.click(new TreeItemLocator("Element E2/Deletion", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Group.class, "Required changes"))));
+ ui.click(new TreeItemLocator(
+ "Element E1/Reference 'singleRef': deletion of Element E2",
+ 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"));
+ checkPersistence();
+ closeEditors();
+ }
+
+ /**
+ * @see org.eclipse.emf.diffmerge.tests.wt.elements.DiffMergeTestCase#persistenceChecks(com.windowtester.runtime.IUIContext)
+ */
+ @Override
+ protected void persistenceChecks(IUIContext ui) throws Exception {
+ ui.click(new TreeItemLocator("Root (2)/Element E3", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (2)/Element E4", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ }
+
+} \ 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/MandatoryRefChange.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/MandatoryRefChange.java
new file mode 100644
index 00000000..abc13f68
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/MandatoryRefChange.java
@@ -0,0 +1,66 @@
+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.TableItemLocator;
+import com.windowtester.runtime.swt.locator.TreeItemLocator;
+
+
+/**
+ * Multiple reference changes resulting from the deletion of a reference value.
+ * Persistence check.
+ */
+public class MandatoryRefChange extends DiffMergeTestCase {
+
+ /**
+ * Main test method.
+ */
+ public void testMandatoryRefChange() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Root (3)/Node C (1)", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Composite.class, 0,
+ new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TableItemLocator("Edge Z (in Root)"));
+ ui.click(new SWTWidgetLocator(ToolItem.class, "", 2, new SWTWidgetLocator(
+ ToolBar.class, new SWTWidgetLocator(Composite.class,
+ new SWTWidgetLocator(Composite.class, 2, new SWTWidgetLocator(
+ SashForm.class))))));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ ui.wait(new ShellShowingCondition("Merge Operation"));
+ ui.click(new TreeItemLocator(
+ "Node C/Reference 'incoming': deletion of Edge Z",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Required changes"))));
+ ui.click(new TreeItemLocator(
+ "Edge Z/Reference 'target': addition of Node B", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Group.class, "Implied changes"))));
+ ui.click(new TreeItemLocator(
+ "Edge Z/Reference 'target': deletion of Node C", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Group.class, "Implied changes"))));
+ ui.click(new TreeItemLocator(
+ "Node B/Reference 'incoming': addition of Edge Z",
+ 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"));
+ closeCompareEditor(true);
+ checkModelIsValid(true);
+ checkModelIsValid(false);
+ checkIdentical();
+ closeEditors();
+ }
+
+} \ 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/MovedInAdded.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/MovedInAdded.java
new file mode 100644
index 00000000..ce3920b6
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/MovedInAdded.java
@@ -0,0 +1,83 @@
+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.TableItemLocator;
+import com.windowtester.runtime.swt.locator.TreeItemLocator;
+
+
+/**
+ * Element moved in an added element.
+ * Persistence check.
+ */
+public class MovedInAdded extends DiffMergeTestCase {
+
+ /**
+ * Main test method.
+ */
+ public void testMovedInAdded() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Root (3)/Element A (2)/Element B (2)",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Composite.class,
+ 0, new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TreeItemLocator("Root (3)/Element A (2)",
+ 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 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 A/Addition into Root (via 'content')", new SWTWidgetLocator(
+ Tree.class, new SWTWidgetLocator(Group.class, "Required changes"))));
+ ui.click(new TreeItemLocator(
+ "Element B/Move into Element A (via 'manyContent')",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Group.class,
+ "Required changes"))));
+ ui.click(new TreeItemLocator("Element B/Move out of Root (from 'content')",
+ 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 (1)/Element A (1)/Element B (1)",
+ new SWTWidgetLocator(Tree.class, new SWTWidgetLocator(Composite.class,
+ 0, new SWTWidgetLocator(SashForm.class)))));
+ ui.click(new TableItemLocator("value"));
+ ui.click(new TableItemLocator("1"));
+ 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 ShellShowingCondition("Merge Operation"));
+ ui.click(new ButtonLocator("OK"));
+ ui.wait(new ShellDisposedCondition("Merge Operation"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ closeCompareEditor(true);
+ checkModelIsValid(true);
+ checkModelIsValid(false);
+ checkIdentical();
+ closeEditors();
+ }
+
+} \ 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/NestedReferencedAddition.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/NestedReferencedAddition.java
new file mode 100644
index 00000000..60543093
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/NestedReferencedAddition.java
@@ -0,0 +1,53 @@
+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.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;
+
+
+/**
+ * Addition of reference to added nested element.
+ * Persistence check.
+ */
+public class NestedReferencedAddition extends DiffMergeTestCase {
+
+ /**
+ * Main test method.
+ */
+ public void testNestedReferenceAddition() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Element ROOT (3)", 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 ShellShowingCondition("Merge Operation"));
+ 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 ButtonLocator("OK"));
+ ui.wait(new ShellDisposedCondition("Merge Operation"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ closeCompareEditor(true);
+ checkModelIsValid(true);
+ checkModelIsValid(false);
+ checkIdentical();
+ closeEditors();
+ }
+
+} \ 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/NestedReferencedAdditionOpposites.java b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/NestedReferencedAdditionOpposites.java
new file mode 100644
index 00000000..45c94763
--- /dev/null
+++ b/tests/org.eclipse.emf.diffmerge.tests.wt.elements/src/org/eclipse/emf/diffmerge/tests/wt/elements/cases/NestedReferencedAdditionOpposites.java
@@ -0,0 +1,53 @@
+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.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;
+
+
+/**
+ * Addition of reference with eOpposite to added nested element.
+ * Persistence check.
+ */
+public class NestedReferencedAdditionOpposites extends DiffMergeTestCase {
+
+ /**
+ * Main test method.
+ */
+ public void testNestedReferenceAddition() throws Exception {
+ IUIContext ui = getUI();
+ compareInFolder(true);
+ ui.click(new TreeItemLocator("Element ROOT (3)", 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 ShellShowingCondition("Merge Operation"));
+ 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 ButtonLocator("OK"));
+ ui.wait(new ShellDisposedCondition("Merge Operation"));
+ ui.wait(new ShellDisposedCondition("Progress Information"));
+ closeCompareEditor(true);
+ checkModelIsValid(true);
+ checkModelIsValid(false);
+ checkIdentical();
+ closeEditors();
+ }
+
+} \ No newline at end of file

Back to the top