Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCedric Notot2013-06-24 12:37:42 -0400
committerGerrit Code Review @ Eclipse.org2013-07-08 08:32:09 -0400
commite870f082aeaa5037511a9454516cca0af1c069b1 (patch)
tree7bd7f3d431e58908e9b7e59122512163e64e3cf2 /plugins/org.eclipse.emf.compare.uml2.tests
parent6b0a6155f6a6b89921c7f9ffb5ba01c41f86ad2e (diff)
downloadorg.eclipse.emf.compare-e870f082aeaa5037511a9454516cca0af1c069b1.tar.gz
org.eclipse.emf.compare-e870f082aeaa5037511a9454516cca0af1c069b1.tar.xz
org.eclipse.emf.compare-e870f082aeaa5037511a9454516cca0af1c069b1.zip
A macroscopic change for differences on UML DirectedRelationship.
Like changes on UML associations, a macroscopic change must be created for changes on DirectedRelationship elements. Without this macroscopic change, the add of an incoming reference to the DirectionRelationship (Generalization for example) will add the DirectionRelationship itself but not the potential outgoing references from it (Generalization#general for example) which are integral part of the related concept. So, the add of a graphical edge which represents a UML generalization will involve an inconsistency in the business UML model. That's why it is required to encapsulate all the differences related to a DirectionRelationship change in a macroscopic one. The requirement link will be automatically computed between this one and other ones. Bug: 406405 Change-Id: I6c624a913bcf993b666421ba8fae868e0b2ae753
Diffstat (limited to 'plugins/org.eclipse.emf.compare.uml2.tests')
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java11
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java12
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java12
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java12
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java8
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java12
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java6
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java6
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/implications/ImplicationsInterfaceRealizationTest.java24
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java12
11 files changed, 70 insertions, 53 deletions
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
index 514d085b7..69d25997f 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/AbstractTest.java
@@ -39,9 +39,11 @@ import org.eclipse.emf.compare.scope.DefaultComparisonScope;
import org.eclipse.emf.compare.scope.IComparisonScope;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
import org.eclipse.emf.compare.tests.postprocess.data.TestPostProcessor;
+import org.eclipse.emf.compare.uml2.internal.UMLDiff;
import org.eclipse.emf.compare.uml2.internal.merge.UMLMerger;
import org.eclipse.emf.compare.uml2.internal.postprocessor.UMLPostProcessor;
import org.eclipse.emf.compare.utils.ReferenceUtil;
+import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.resource.Resource;
@@ -144,6 +146,15 @@ public abstract class AbstractTest {
};
}
+ protected static Predicate<Diff> discriminantInstanceOf(final EClass clazz) {
+ return new Predicate<Diff>() {
+ public boolean apply(Diff input) {
+ return input instanceof UMLDiff && clazz.isInstance(((UMLDiff)input).getDiscriminant());
+ }
+
+ };
+ }
+
protected abstract AbstractInputData getInput();
protected void testMergeLeftToRight(Notifier left, Notifier right, Notifier origin) {
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java
index b5f4c9771..d0eebaa76 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java
@@ -21,7 +21,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.DependencyChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -124,14 +124,14 @@ public class AddAbstractionTest extends AbstractTest {
assertNotNull(addRefClass0InAbstraction);
// CHECK EXTENSION
- assertSame(Integer.valueOf(1), count(differences, instanceOf(DependencyChange.class)));
+ assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff addUMLDependency = null;
if (kind.equals(TestKind.ADD)) {
- addUMLDependency = Iterators.find(differences.iterator(), and(instanceOf(DependencyChange.class),
- ofKind(DifferenceKind.ADD)));
+ addUMLDependency = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.ADD)));
} else {
- addUMLDependency = Iterators.find(differences.iterator(), and(instanceOf(DependencyChange.class),
- ofKind(DifferenceKind.DELETE)));
+ addUMLDependency = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java
index b9580fe91..56ba3948e 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java
@@ -21,7 +21,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.DependencyChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -123,14 +123,14 @@ public class AddDependencyTest extends AbstractTest {
assertNotNull(addRefClass1InDependency);
// CHECK EXTENSION
- assertSame(Integer.valueOf(1), count(differences, instanceOf(DependencyChange.class)));
+ assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff addUMLDependency = null;
if (kind.equals(TestKind.ADD)) {
- addUMLDependency = Iterators.find(differences.iterator(), and(instanceOf(DependencyChange.class),
- ofKind(DifferenceKind.ADD)));
+ addUMLDependency = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.ADD)));
} else {
- addUMLDependency = Iterators.find(differences.iterator(), and(instanceOf(DependencyChange.class),
- ofKind(DifferenceKind.DELETE)));
+ addUMLDependency = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java
index c00f08ce4..f5125f0d4 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java
@@ -20,7 +20,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.InterfaceRealizationChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -135,14 +135,14 @@ public class AddInterfaceRealizationTest extends AbstractTest {
assertNotNull(addClientDependencyInClass0);
// CHECK EXTENSION
- assertSame(Integer.valueOf(1), count(differences, instanceOf(InterfaceRealizationChange.class)));
+ assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff addUMLDependency = null;
if (kind.equals(TestKind.ADD)) {
addUMLDependency = Iterators.find(differences.iterator(), and(
- instanceOf(InterfaceRealizationChange.class), ofKind(DifferenceKind.ADD)));
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.ADD)));
} else {
addUMLDependency = Iterators.find(differences.iterator(), and(
- instanceOf(InterfaceRealizationChange.class), ofKind(DifferenceKind.DELETE)));
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
assertSame(Integer.valueOf(5), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java
index 02cae718e..924b2b4ca 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java
@@ -21,7 +21,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.DependencyChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -124,14 +124,14 @@ public class AddRealizationTest extends AbstractTest {
assertNotNull(addRefClass1InDependency);
// CHECK EXTENSION
- assertSame(Integer.valueOf(1), count(differences, instanceOf(DependencyChange.class)));
+ assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff addUMLDependency = null;
if (kind.equals(TestKind.ADD)) {
- addUMLDependency = Iterators.find(differences.iterator(), and(instanceOf(DependencyChange.class),
- ofKind(DifferenceKind.ADD)));
+ addUMLDependency = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.ADD)));
} else {
- addUMLDependency = Iterators.find(differences.iterator(), and(instanceOf(DependencyChange.class),
- ofKind(DifferenceKind.DELETE)));
+ addUMLDependency = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java
index ef78100d5..d4e6fa8ee 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java
@@ -20,7 +20,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.SubstitutionChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -135,14 +135,14 @@ public class AddSubstitutionTest extends AbstractTest {
assertNotNull(addClientDependencyInClass0);
// CHECK EXTENSION
- assertSame(Integer.valueOf(1), count(differences, instanceOf(SubstitutionChange.class)));
+ assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff addUMLDependency = null;
if (kind.equals(TestKind.ADD)) {
addUMLDependency = Iterators.find(differences.iterator(), and(
- instanceOf(SubstitutionChange.class), ofKind(DifferenceKind.ADD)));
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.ADD)));
} else {
addUMLDependency = Iterators.find(differences.iterator(), and(
- instanceOf(SubstitutionChange.class), ofKind(DifferenceKind.DELETE)));
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
assertSame(Integer.valueOf(5), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java
index 09126bb13..f130220fe 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java
@@ -21,7 +21,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.DependencyChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -122,14 +122,14 @@ public class AddUsageTest extends AbstractTest {
assertNotNull(addRefClass1InDependency);
// CHECK EXTENSION
- assertSame(Integer.valueOf(1), count(differences, instanceOf(DependencyChange.class)));
+ assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff addUMLDependency = null;
if (kind.equals(TestKind.ADD)) {
- addUMLDependency = Iterators.find(differences.iterator(), and(instanceOf(DependencyChange.class),
- ofKind(DifferenceKind.ADD)));
+ addUMLDependency = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.ADD)));
} else {
- addUMLDependency = Iterators.find(differences.iterator(), and(instanceOf(DependencyChange.class),
- ofKind(DifferenceKind.DELETE)));
+ addUMLDependency = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java
index a4d6b4917..39e58aba4 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeDependencyTest.java
@@ -19,7 +19,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.DependencyChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -101,9 +101,9 @@ public class ChangeDependencyTest extends AbstractTest {
// CHECK EXTENSION
// No extension anymore
- assertSame(Integer.valueOf(0), count(differences, instanceOf(DependencyChange.class)));
+ assertSame(Integer.valueOf(0), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff changeUMLDependency = Iterators.find(differences.iterator(), and(
- instanceOf(DependencyChange.class), ofKind(DifferenceKind.CHANGE)), null);
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.CHANGE)), null);
assertNull(changeUMLDependency);
// assertNotNull(changeUMLDependency);
// assertSame(Integer.valueOf(1), Integer.valueOf(changeUMLDependency.getRefinedBy().size()));
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java
index d77acb79a..875910398 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/ChangeUsageTest.java
@@ -19,7 +19,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.DependencyChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -101,9 +101,9 @@ public class ChangeUsageTest extends AbstractTest {
// CHECK EXTENSION
// no extension any more
- assertSame(Integer.valueOf(0), count(differences, instanceOf(DependencyChange.class)));
+ assertSame(Integer.valueOf(0), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff changeUMLDependency = Iterators.find(differences.iterator(), and(
- instanceOf(DependencyChange.class), ofKind(DifferenceKind.CHANGE)), null);
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.CHANGE)), null);
assertNull(changeUMLDependency);
// assertNotNull(changeUMLDependency);
// assertSame(Integer.valueOf(1), Integer.valueOf(changeUMLDependency.getRefinedBy().size()));
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/implications/ImplicationsInterfaceRealizationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/implications/ImplicationsInterfaceRealizationTest.java
index ae93da81f..6a5e87128 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/implications/ImplicationsInterfaceRealizationTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/implications/ImplicationsInterfaceRealizationTest.java
@@ -1,5 +1,6 @@
package org.eclipse.emf.compare.uml2.tests.implications;
+import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
import static junit.framework.Assert.assertEquals;
import static junit.framework.Assert.assertNull;
@@ -19,11 +20,11 @@ import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.InterfaceRealizationChange;
-import org.eclipse.emf.compare.uml2.internal.SubstitutionChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.implications.data.ImplicationsInputData;
import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.uml2.uml.UMLPackage;
import org.junit.Test;
@SuppressWarnings("nls")
@@ -106,10 +107,12 @@ public class ImplicationsInterfaceRealizationTest extends AbstractTest {
addSupplierInSubstitutionDescription, null);
diffs.addClientDependencyInClass02 = Iterators.find(differences.iterator(),
addClientDependencyInClass0Description2, null);
- diffs.addUMLInterfaceRealization = Iterators.find(differences.iterator(),
- instanceOf(InterfaceRealizationChange.class), null);
- diffs.addUMLSubstitution = Iterators.find(differences.iterator(),
- instanceOf(SubstitutionChange.class), null);
+ diffs.addUMLInterfaceRealization = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class),
+ discriminantInstanceOf(UMLPackage.Literals.INTERFACE_REALIZATION)), null);
+ diffs.addUMLSubstitution = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class),
+ discriminantInstanceOf(UMLPackage.Literals.SUBSTITUTION)), null);
return diffs;
}
@@ -162,10 +165,11 @@ public class ImplicationsInterfaceRealizationTest extends AbstractTest {
}
private void checkMergeAddClientInInterfaceRealization(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 3, comparison.getDifferences().size());
+ assertEquals(NB_DIFFS - 4, comparison.getDifferences().size());
assertNull(diffs.addClientInInterfaceRealization);
assertNull(diffs.addInterfaceRealization);
assertNull(diffs.addClientDependencyInClass0);
+ assertNull(diffs.addUMLInterfaceRealization);
}
@Test
@@ -236,10 +240,11 @@ public class ImplicationsInterfaceRealizationTest extends AbstractTest {
}
private void checkMergeAddClientDependencyInClass0(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 3, comparison.getDifferences().size());
+ assertEquals(NB_DIFFS - 4, comparison.getDifferences().size());
assertNull(diffs.addClientDependencyInClass0);
assertNull(diffs.addClientInInterfaceRealization);
assertNull(diffs.addInterfaceRealization);
+ assertNull(diffs.addUMLInterfaceRealization);
}
@Test
@@ -310,10 +315,11 @@ public class ImplicationsInterfaceRealizationTest extends AbstractTest {
}
private void checkMergeAddInterfaceRealization(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 3, comparison.getDifferences().size());
+ assertEquals(NB_DIFFS - 4, comparison.getDifferences().size());
assertNull(diffs.addInterfaceRealization);
assertNull(diffs.addClientDependencyInClass0);
assertNull(diffs.addClientInInterfaceRealization);
+ assertNull(diffs.addUMLInterfaceRealization);
}
@Test
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java
index b05ff71fb..479c8c0e9 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/include/AddIncludeTest.java
@@ -20,7 +20,7 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.tests.framework.AbstractInputData;
-import org.eclipse.emf.compare.uml2.internal.IncludeChange;
+import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
import org.eclipse.emf.compare.uml2.tests.AbstractTest;
import org.eclipse.emf.compare.uml2.tests.include.data.IncludeInputData;
import org.eclipse.emf.ecore.resource.Resource;
@@ -106,14 +106,14 @@ public class AddIncludeTest extends AbstractTest {
assertNotNull(addRefExtendedCaseInExtend);
// CHECK EXTENSION
- assertSame(Integer.valueOf(1), count(differences, instanceOf(IncludeChange.class)));
+ assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
Diff addUMLExtend = null;
if (kind.equals(TestKind.ADD)) {
- addUMLExtend = Iterators.find(differences.iterator(), and(instanceOf(IncludeChange.class),
- ofKind(DifferenceKind.ADD)));
+ addUMLExtend = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.ADD)));
} else {
- addUMLExtend = Iterators.find(differences.iterator(), and(instanceOf(IncludeChange.class),
- ofKind(DifferenceKind.DELETE)));
+ addUMLExtend = Iterators.find(differences.iterator(), and(
+ instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLExtend);
assertSame(Integer.valueOf(2), Integer.valueOf(addUMLExtend.getRefinedBy().size()));

Back to the top