Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Richard2014-03-20 13:53:01 -0400
committerMikaƫl Barbero2014-03-27 13:40:08 -0400
commitd9aca9c1a60d3985eb20034ba07c76d6e227fc4a (patch)
tree726e6e52b34812bd2aa5ee0f17b44d5a1794aab9 /plugins/org.eclipse.emf.compare.uml2.tests
parentef78e5f14d9090f10505d8f5c714ca2699964c3b (diff)
downloadorg.eclipse.emf.compare-d9aca9c1a60d3985eb20034ba07c76d6e227fc4a.tar.gz
org.eclipse.emf.compare-d9aca9c1a60d3985eb20034ba07c76d6e227fc4a.tar.xz
org.eclipse.emf.compare-d9aca9c1a60d3985eb20034ba07c76d6e227fc4a.zip
Update Luna target file to M6
- also remove ecoretools from the maven luna profile - set bounds to o.e.e.c.diagram.ide.ui.ecoretools dependency to ecoretools [1,2) - remove the ecoretools plugin from the update site - remove UML2 and papyrus extensions for Kepler. Master is now requiring UML 5.0 Change-Id: I4b967471f3f021af34607cee1fc7f72fa3ae44aa
Diffstat (limited to 'plugins/org.eclipse.emf.compare.uml2.tests')
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF6
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddAbstractionTest.java43
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddDependencyTest.java47
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddInterfaceRealizationTest.java41
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddRealizationTest.java43
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddSubstitutionTest.java40
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/dependency/AddUsageTest.java43
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/implications/ImplicationsInterfaceRealizationTest.java302
8 files changed, 100 insertions, 465 deletions
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
index d6a060f46..af0335caf 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/META-INF/MANIFEST.MF
@@ -12,13 +12,13 @@ Export-Package: org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile
org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.util,
org.eclipse.emf.compare.uml2.tests
Require-Bundle: org.eclipse.core.runtime,
- org.eclipse.uml2.uml;bundle-version="4.0.0",
- org.eclipse.uml2.uml.resources;bundle-version="4.0.0",
+ org.eclipse.uml2.uml;bundle-version="5.0.0",
+ org.eclipse.uml2.uml.resources;bundle-version="5.0.0",
org.junit,
org.eclipse.emf.compare,
org.eclipse.emf.compare.uml2,
org.eclipse.emf.compare.tests;bundle-version="2.0.1",
- org.eclipse.uml2.uml.edit;bundle-version="4.0.0"
+ org.eclipse.uml2.uml.edit;bundle-version="5.0.0"
Bundle-ActivationPolicy: lazy
Import-Package: com.google.common.base;version="[11.0.0,15.0.0)",
com.google.common.collect;version="[11.0.0,15.0.0)"
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 e0abc1b0e..02db99fb3 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
@@ -2,14 +2,16 @@ package org.eclipse.emf.compare.uml2.tests.dependency;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.added;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.addedToReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removed;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removedFromReference;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
@@ -21,8 +23,8 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
-import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
import org.junit.Test;
@@ -84,26 +86,22 @@ public class AddAbstractionTest extends AbstractUMLTest {
private void testAB1(TestKind kind, final Comparison comparison) {
final List<Diff> differences = comparison.getDifferences();
- // We should have no less and no more than 5 differences
- assertSame(Integer.valueOf(5), Integer.valueOf(differences.size()));
+ // We should have no less and no more than 4 differences
+ // Was 5 with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertEquals(4, differences.size());
Predicate<? super Diff> addAbstractionDescription = null;
- Predicate<? super Diff> addRefAbstractionInClass1Description = null;
Predicate<? super Diff> addRefClass1InAbstractionDescription = null;
Predicate<? super Diff> addRefClass0InAbstractionDescription = null;
if (kind.equals(TestKind.DELETE)) {
addAbstractionDescription = removed("model.Abstraction0"); //$NON-NLS-1$
- addRefAbstractionInClass1Description = removedFromReference("model.Class1", "clientDependency",
- "model.Abstraction0");
addRefClass1InAbstractionDescription = removedFromReference("model.Abstraction0", "client",
"model.Class1");
addRefClass0InAbstractionDescription = removedFromReference("model.Abstraction0", "supplier",
"model.Class0");
} else {
addAbstractionDescription = added("model.Abstraction0"); //$NON-NLS-1$
- addRefAbstractionInClass1Description = addedToReference("model.Class1", "clientDependency",
- "model.Abstraction0");
addRefClass1InAbstractionDescription = addedToReference("model.Abstraction0", "client",
"model.Class1");
addRefClass0InAbstractionDescription = addedToReference("model.Abstraction0", "supplier",
@@ -111,15 +109,12 @@ public class AddAbstractionTest extends AbstractUMLTest {
}
final Diff addAbstraction = Iterators.find(differences.iterator(), addAbstractionDescription);
- final Diff addRefAbstractionInClass1 = Iterators.find(differences.iterator(),
- addRefAbstractionInClass1Description);
final Diff addRefClass1InAbstraction = Iterators.find(differences.iterator(),
addRefClass1InAbstractionDescription);
final Diff addRefClass0InAbstraction = Iterators.find(differences.iterator(),
addRefClass0InAbstractionDescription);
assertNotNull(addAbstraction);
- assertNotNull(addRefAbstractionInClass1);
assertNotNull(addRefClass1InAbstraction);
assertNotNull(addRefClass0InAbstraction);
@@ -134,11 +129,10 @@ public class AddAbstractionTest extends AbstractUMLTest {
instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
- assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
+ assertSame(Integer.valueOf(3), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
assertTrue(addUMLDependency.getRefinedBy().contains(addRefClass1InAbstraction));
assertTrue(addUMLDependency.getRefinedBy().contains(addRefClass0InAbstraction));
assertTrue(addUMLDependency.getRefinedBy().contains(addAbstraction));
- assertTrue(addUMLDependency.getRefinedBy().contains(addRefAbstractionInClass1));
// CHECK REQUIREMENT
if (kind.equals(TestKind.ADD)) {
@@ -148,9 +142,6 @@ public class AddAbstractionTest extends AbstractUMLTest {
assertSame(Integer.valueOf(1), Integer.valueOf(addRefClass0InAbstraction.getRequires().size()));
assertTrue(addRefClass0InAbstraction.getRequires().contains(addAbstraction));
- assertSame(Integer.valueOf(1), Integer.valueOf(addRefAbstractionInClass1.getRequires().size()));
- assertTrue(addRefAbstractionInClass1.getRequires().contains(addAbstraction));
-
assertSame(Integer.valueOf(0), Integer.valueOf(addAbstraction.getRequires().size()));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
} else {
@@ -158,24 +149,16 @@ public class AddAbstractionTest extends AbstractUMLTest {
assertSame(Integer.valueOf(0), Integer.valueOf(addRefClass0InAbstraction.getRequires().size()));
- assertSame(Integer.valueOf(0), Integer.valueOf(addRefAbstractionInClass1.getRequires().size()));
-
- assertSame(Integer.valueOf(3), Integer.valueOf(addAbstraction.getRequires().size()));
+ assertSame(Integer.valueOf(2), Integer.valueOf(addAbstraction.getRequires().size()));
assertTrue(addAbstraction.getRequires().contains(addRefClass1InAbstraction));
assertTrue(addAbstraction.getRequires().contains(addRefClass0InAbstraction));
- assertTrue(addAbstraction.getRequires().contains(addRefAbstractionInClass1));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
}
// CHECK EQUIVALENCE
- assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getEquivalences().size()));
-
- assertNotNull(addRefClass1InAbstraction.getEquivalence());
- assertSame(Integer.valueOf(2), Integer.valueOf(addRefClass1InAbstraction.getEquivalence()
- .getDifferences().size()));
- assertTrue(addRefClass1InAbstraction.getEquivalence().getDifferences().contains(
- addRefAbstractionInClass1));
+ assertEquals(0, comparison.getEquivalences().size());
+ assertNull(addRefClass1InAbstraction.getEquivalence());
testIntersections(comparison);
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 da878b530..00ed56db6 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
@@ -2,14 +2,16 @@ package org.eclipse.emf.compare.uml2.tests.dependency;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.added;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.addedToReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removed;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removedFromReference;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
@@ -21,8 +23,8 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
-import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
import org.junit.Test;
@@ -83,26 +85,22 @@ public class AddDependencyTest extends AbstractUMLTest {
protected void testAB1(TestKind kind, final Comparison comparison) {
final List<Diff> differences = comparison.getDifferences();
- // We should have no less and no more than 5 differences
- assertSame(Integer.valueOf(5), Integer.valueOf(differences.size()));
+ // We should have no less and no more than 4 differences
+ // Was 5 with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertEquals(4, differences.size());
Predicate<? super Diff> addDependencyDescription = null;
- Predicate<? super Diff> addRefDependencyInClass0Description = null;
Predicate<? super Diff> addRefClass1InDependencyDescription = null;
Predicate<? super Diff> addRefClass0InDependencyDescription = null;
if (kind.equals(TestKind.DELETE)) {
addDependencyDescription = removed("model.Dependency0"); //$NON-NLS-1$
- addRefDependencyInClass0Description = removedFromReference("model.Class0", "clientDependency",
- "model.Dependency0");
addRefClass0InDependencyDescription = removedFromReference("model.Dependency0", "client",
"model.Class0");
addRefClass1InDependencyDescription = removedFromReference("model.Dependency0", "supplier",
"model.Class1");
} else {
addDependencyDescription = added("model.Dependency0"); //$NON-NLS-1$
- addRefDependencyInClass0Description = addedToReference("model.Class0", "clientDependency",
- "model.Dependency0");
addRefClass0InDependencyDescription = addedToReference("model.Dependency0", "client",
"model.Class0");
addRefClass1InDependencyDescription = addedToReference("model.Dependency0", "supplier",
@@ -110,15 +108,12 @@ public class AddDependencyTest extends AbstractUMLTest {
}
final Diff addDependency = Iterators.find(differences.iterator(), addDependencyDescription);
- final Diff addRefDependencyInClass0 = Iterators.find(differences.iterator(),
- addRefDependencyInClass0Description);
final Diff addRefClass0InDependency = Iterators.find(differences.iterator(),
addRefClass0InDependencyDescription);
final Diff addRefClass1InDependency = Iterators.find(differences.iterator(),
addRefClass1InDependencyDescription);
assertNotNull(addDependency);
- assertNotNull(addRefDependencyInClass0);
assertNotNull(addRefClass0InDependency);
assertNotNull(addRefClass1InDependency);
@@ -133,11 +128,10 @@ public class AddDependencyTest extends AbstractUMLTest {
instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
- assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
+ assertSame(Integer.valueOf(3), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
assertTrue(addUMLDependency.getRefinedBy().contains(addRefClass0InDependency));
assertTrue(addUMLDependency.getRefinedBy().contains(addRefClass1InDependency));
assertTrue(addUMLDependency.getRefinedBy().contains(addDependency));
- assertTrue(addUMLDependency.getRefinedBy().contains(addRefDependencyInClass0));
// CHECK REQUIREMENT
if (kind.equals(TestKind.ADD)) {
@@ -147,9 +141,6 @@ public class AddDependencyTest extends AbstractUMLTest {
assertSame(Integer.valueOf(1), Integer.valueOf(addRefClass1InDependency.getRequires().size()));
assertTrue(addRefClass1InDependency.getRequires().contains(addDependency));
- assertSame(Integer.valueOf(1), Integer.valueOf(addRefDependencyInClass0.getRequires().size()));
- assertTrue(addRefDependencyInClass0.getRequires().contains(addDependency));
-
assertSame(Integer.valueOf(0), Integer.valueOf(addDependency.getRequires().size()));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
} else {
@@ -157,24 +148,22 @@ public class AddDependencyTest extends AbstractUMLTest {
assertSame(Integer.valueOf(0), Integer.valueOf(addRefClass1InDependency.getRequires().size()));
- assertSame(Integer.valueOf(0), Integer.valueOf(addRefDependencyInClass0.getRequires().size()));
-
- assertSame(Integer.valueOf(3), Integer.valueOf(addDependency.getRequires().size()));
+ // Was 3 with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertSame(Integer.valueOf(2), Integer.valueOf(addDependency.getRequires().size()));
assertTrue(addDependency.getRequires().contains(addRefClass0InDependency));
assertTrue(addDependency.getRequires().contains(addRefClass1InDependency));
- assertTrue(addDependency.getRequires().contains(addRefDependencyInClass0));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
}
// CHECK EQUIVALENCE
- assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getEquivalences().size()));
+ // Was 1 with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertEquals(0, comparison.getEquivalences().size());
- assertNotNull(addRefClass0InDependency.getEquivalence());
- assertSame(Integer.valueOf(2), Integer.valueOf(addRefClass0InDependency.getEquivalence()
- .getDifferences().size()));
- assertTrue(addRefClass0InDependency.getEquivalence().getDifferences().contains(
- addRefDependencyInClass0));
+ // Was not null with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertNull(addRefClass0InDependency.getEquivalence());
+ // assertSame(Integer.valueOf(2), Integer.valueOf(addRefClass0InDependency.getEquivalence()
+ // .getDifferences().size()));
testIntersections(comparison);
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 35eac4c93..64096728d 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
@@ -2,13 +2,15 @@ package org.eclipse.emf.compare.uml2.tests.dependency;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.addedToReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.changedReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removedFromReference;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
@@ -20,8 +22,8 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
-import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
import org.junit.Test;
@@ -82,14 +84,14 @@ public class AddInterfaceRealizationTest extends AbstractUMLTest {
private void testAB1(TestKind kind, final Comparison comparison) {
final List<Diff> differences = comparison.getDifferences();
- // We should have no less and no more than 6 differences
- assertSame(Integer.valueOf(6), Integer.valueOf(differences.size()));
+ // We should have no less and no more than 5 differences
+ // Was 6 with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertEquals(5, differences.size());
Predicate<? super Diff> addInterfaceRealizationDescription = null;
Predicate<? super Diff> addClientInInterfaceRealizationDescription = null;
Predicate<? super Diff> addSupplierInInterfaceRealizationDescription = null;
Predicate<? super Diff> addContractInInterfaceRealizationDescription = null;
- Predicate<? super Diff> addClientDependencyInClass0Description = null;
if (kind.equals(TestKind.DELETE)) {
//addInterfaceRealizationDescription = removed("model.Class0.InterfaceRealization0"); //$NON-NLS-1$
@@ -101,8 +103,6 @@ public class AddInterfaceRealizationTest extends AbstractUMLTest {
"model.Class0.InterfaceRealization0", "supplier", "model.Interface0");
addContractInInterfaceRealizationDescription = changedReference(
"model.Class0.InterfaceRealization0", "contract", "model.Interface0", null);
- addClientDependencyInClass0Description = removedFromReference("model.Class0", "clientDependency",
- "model.Class0.InterfaceRealization0");
} else {
//addInterfaceRealizationDescription = added("model.Class0.InterfaceRealization0"); //$NON-NLS-1$
addInterfaceRealizationDescription = addedToReference(
@@ -113,8 +113,6 @@ public class AddInterfaceRealizationTest extends AbstractUMLTest {
"model.Class0.InterfaceRealization0", "supplier", "model.Interface0");
addContractInInterfaceRealizationDescription = changedReference(
"model.Class0.InterfaceRealization0", "contract", null, "model.Interface0");
- addClientDependencyInClass0Description = addedToReference("model.Class0", "clientDependency",
- "model.Class0.InterfaceRealization0");
}
final Diff addInterfaceRealization = Iterators.find(differences.iterator(),
@@ -125,14 +123,11 @@ public class AddInterfaceRealizationTest extends AbstractUMLTest {
addSupplierInInterfaceRealizationDescription);
final Diff addContractInInterfaceRealization = Iterators.find(differences.iterator(),
addContractInInterfaceRealizationDescription);
- final Diff addClientDependencyInClass0 = Iterators.find(differences.iterator(),
- addClientDependencyInClass0Description);
assertNotNull(addInterfaceRealization);
assertNotNull(addClientInInterfaceRealization);
assertNotNull(addSupplierInInterfaceRealization);
assertNotNull(addContractInInterfaceRealization);
- assertNotNull(addClientDependencyInClass0);
// CHECK EXTENSION
assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
@@ -145,12 +140,11 @@ public class AddInterfaceRealizationTest extends AbstractUMLTest {
instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
- assertSame(Integer.valueOf(5), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
+ assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
assertTrue(addUMLDependency.getRefinedBy().contains(addInterfaceRealization));
assertTrue(addUMLDependency.getRefinedBy().contains(addClientInInterfaceRealization));
assertTrue(addUMLDependency.getRefinedBy().contains(addSupplierInInterfaceRealization));
assertTrue(addUMLDependency.getRefinedBy().contains(addContractInInterfaceRealization));
- assertTrue(addUMLDependency.getRefinedBy().contains(addClientDependencyInClass0));
// CHECK REQUIREMENT
if (kind.equals(TestKind.ADD)) {
@@ -174,25 +168,18 @@ public class AddInterfaceRealizationTest extends AbstractUMLTest {
assertSame(Integer.valueOf(0), Integer.valueOf(addContractInInterfaceRealization.getRequires()
.size()));
- assertSame(Integer.valueOf(4), Integer.valueOf(addInterfaceRealization.getRequires().size()));
+ assertSame(Integer.valueOf(3), Integer.valueOf(addInterfaceRealization.getRequires().size()));
assertTrue(addInterfaceRealization.getRequires().contains(addClientInInterfaceRealization));
assertTrue(addInterfaceRealization.getRequires().contains(addSupplierInInterfaceRealization));
assertTrue(addInterfaceRealization.getRequires().contains(addContractInInterfaceRealization));
- assertTrue(addInterfaceRealization.getRequires().contains(addClientDependencyInClass0));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
}
// CHECK EQUIVALENCE
- assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getEquivalences().size()));
-
- assertNotNull(addClientInInterfaceRealization.getEquivalence());
- assertSame(Integer.valueOf(2), Integer.valueOf(addClientInInterfaceRealization.getEquivalence()
- .getDifferences().size()));
- assertTrue(addClientInInterfaceRealization.getEquivalence().getDifferences().contains(
- addClientInInterfaceRealization));
- assertTrue(addClientInInterfaceRealization.getEquivalence().getDifferences().contains(
- addClientDependencyInClass0));
+ assertEquals(0, comparison.getEquivalences().size());
+
+ assertNull(addClientInInterfaceRealization.getEquivalence());
testIntersections(comparison);
}
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 b0f646656..ebba6b537 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
@@ -2,14 +2,16 @@ package org.eclipse.emf.compare.uml2.tests.dependency;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.added;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.addedToReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removed;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removedFromReference;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
@@ -21,8 +23,8 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
-import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
import org.junit.Test;
@@ -84,26 +86,22 @@ public class AddRealizationTest extends AbstractUMLTest {
private void testAB1(TestKind kind, final Comparison comparison) {
final List<Diff> differences = comparison.getDifferences();
- // We should have no less and no more than 5 differences
- assertSame(Integer.valueOf(5), Integer.valueOf(differences.size()));
+ // We should have no less and no more than 4 differences
+ // Was 5 with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertEquals(4, differences.size());
Predicate<? super Diff> addRealizationDescription = null;
- Predicate<? super Diff> addRefRealizationInClass0Description = null;
Predicate<? super Diff> addRefClass1InRealizationDescription = null;
Predicate<? super Diff> addRefClass0InRealizationDescription = null;
if (kind.equals(TestKind.DELETE)) {
addRealizationDescription = removed("model.Realization0"); //$NON-NLS-1$
- addRefRealizationInClass0Description = removedFromReference("model.Class0", "clientDependency",
- "model.Realization0");
addRefClass0InRealizationDescription = removedFromReference("model.Realization0", "client",
"model.Class0");
addRefClass1InRealizationDescription = removedFromReference("model.Realization0", "supplier",
"model.Class1");
} else {
addRealizationDescription = added("model.Realization0"); //$NON-NLS-1$
- addRefRealizationInClass0Description = addedToReference("model.Class0", "clientDependency",
- "model.Realization0");
addRefClass0InRealizationDescription = addedToReference("model.Realization0", "client",
"model.Class0");
addRefClass1InRealizationDescription = addedToReference("model.Realization0", "supplier",
@@ -111,15 +109,12 @@ public class AddRealizationTest extends AbstractUMLTest {
}
final Diff addDependency = Iterators.find(differences.iterator(), addRealizationDescription);
- final Diff addRefDependencyInClass0 = Iterators.find(differences.iterator(),
- addRefRealizationInClass0Description);
final Diff addRefClass0InDependency = Iterators.find(differences.iterator(),
addRefClass0InRealizationDescription);
final Diff addRefClass1InDependency = Iterators.find(differences.iterator(),
addRefClass1InRealizationDescription);
assertNotNull(addDependency);
- assertNotNull(addRefDependencyInClass0);
assertNotNull(addRefClass0InDependency);
assertNotNull(addRefClass1InDependency);
@@ -134,11 +129,10 @@ public class AddRealizationTest extends AbstractUMLTest {
instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
- assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
+ assertSame(Integer.valueOf(3), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
assertTrue(addUMLDependency.getRefinedBy().contains(addRefClass0InDependency));
assertTrue(addUMLDependency.getRefinedBy().contains(addRefClass1InDependency));
assertTrue(addUMLDependency.getRefinedBy().contains(addDependency));
- assertTrue(addUMLDependency.getRefinedBy().contains(addRefDependencyInClass0));
// CHECK REQUIREMENT
if (kind.equals(TestKind.ADD)) {
@@ -148,9 +142,6 @@ public class AddRealizationTest extends AbstractUMLTest {
assertSame(Integer.valueOf(1), Integer.valueOf(addRefClass1InDependency.getRequires().size()));
assertTrue(addRefClass1InDependency.getRequires().contains(addDependency));
- assertSame(Integer.valueOf(1), Integer.valueOf(addRefDependencyInClass0.getRequires().size()));
- assertTrue(addRefDependencyInClass0.getRequires().contains(addDependency));
-
assertSame(Integer.valueOf(0), Integer.valueOf(addDependency.getRequires().size()));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
} else {
@@ -158,24 +149,16 @@ public class AddRealizationTest extends AbstractUMLTest {
assertSame(Integer.valueOf(0), Integer.valueOf(addRefClass1InDependency.getRequires().size()));
- assertSame(Integer.valueOf(0), Integer.valueOf(addRefDependencyInClass0.getRequires().size()));
-
- assertSame(Integer.valueOf(3), Integer.valueOf(addDependency.getRequires().size()));
+ assertSame(Integer.valueOf(2), Integer.valueOf(addDependency.getRequires().size()));
assertTrue(addDependency.getRequires().contains(addRefClass0InDependency));
assertTrue(addDependency.getRequires().contains(addRefClass1InDependency));
- assertTrue(addDependency.getRequires().contains(addRefDependencyInClass0));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
}
// CHECK EQUIVALENCE
- assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getEquivalences().size()));
-
- assertNotNull(addRefClass0InDependency.getEquivalence());
- assertSame(Integer.valueOf(2), Integer.valueOf(addRefClass0InDependency.getEquivalence()
- .getDifferences().size()));
- assertTrue(addRefClass0InDependency.getEquivalence().getDifferences().contains(
- addRefDependencyInClass0));
+ assertEquals(0, comparison.getEquivalences().size());
+ assertNull(addRefClass0InDependency.getEquivalence());
testIntersections(comparison);
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 47ea9ee87..62da2f0e2 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
@@ -2,13 +2,15 @@ package org.eclipse.emf.compare.uml2.tests.dependency;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.addedToReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.changedReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removedFromReference;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
@@ -20,8 +22,8 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
-import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
import org.junit.Test;
@@ -84,14 +86,14 @@ public class AddSubstitutionTest extends AbstractUMLTest {
private void testAB1(TestKind kind, final Comparison comparison) {
final List<Diff> differences = comparison.getDifferences();
- // We should have no less and no more than 6 differences
- assertSame(Integer.valueOf(6), Integer.valueOf(differences.size()));
+ // We should have no less and no more than 5 differences
+ // Was 6 with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertEquals(5, differences.size());
Predicate<? super Diff> addInterfaceRealizationDescription = null;
Predicate<? super Diff> addClientInInterfaceRealizationDescription = null;
Predicate<? super Diff> addSupplierInInterfaceRealizationDescription = null;
Predicate<? super Diff> addContractInInterfaceRealizationDescription = null;
- Predicate<? super Diff> addClientDependencyInClass0Description = null;
if (kind.equals(TestKind.DELETE)) {
addInterfaceRealizationDescription = removedFromReference("model.Class0", "substitution",
@@ -102,8 +104,6 @@ public class AddSubstitutionTest extends AbstractUMLTest {
"supplier", "model.Class1");
addContractInInterfaceRealizationDescription = changedReference("model.Class0.Substitution0",
"contract", "model.Class1", null);
- addClientDependencyInClass0Description = removedFromReference("model.Class0", "clientDependency",
- "model.Class0.Substitution0");
} else {
addInterfaceRealizationDescription = addedToReference(
"model.Class0", "substitution", "model.Class0.Substitution0"); //$NON-NLS-1$
@@ -113,8 +113,6 @@ public class AddSubstitutionTest extends AbstractUMLTest {
"supplier", "model.Class1");
addContractInInterfaceRealizationDescription = changedReference("model.Class0.Substitution0",
"contract", null, "model.Class1");
- addClientDependencyInClass0Description = addedToReference("model.Class0", "clientDependency",
- "model.Class0.Substitution0");
}
final Diff addInterfaceRealization = Iterators.find(differences.iterator(),
@@ -125,14 +123,11 @@ public class AddSubstitutionTest extends AbstractUMLTest {
addSupplierInInterfaceRealizationDescription);
final Diff addContractInInterfaceRealization = Iterators.find(differences.iterator(),
addContractInInterfaceRealizationDescription);
- final Diff addClientDependencyInClass0 = Iterators.find(differences.iterator(),
- addClientDependencyInClass0Description);
assertNotNull(addInterfaceRealization);
assertNotNull(addClientInInterfaceRealization);
assertNotNull(addSupplierInInterfaceRealization);
assertNotNull(addContractInInterfaceRealization);
- assertNotNull(addClientDependencyInClass0);
// CHECK EXTENSION
assertSame(Integer.valueOf(1), count(differences, instanceOf(DirectedRelationshipChange.class)));
@@ -145,12 +140,11 @@ public class AddSubstitutionTest extends AbstractUMLTest {
instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
- assertSame(Integer.valueOf(5), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
+ assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
assertTrue(addUMLDependency.getRefinedBy().contains(addClientInInterfaceRealization));
assertTrue(addUMLDependency.getRefinedBy().contains(addSupplierInInterfaceRealization));
assertTrue(addUMLDependency.getRefinedBy().contains(addContractInInterfaceRealization));
assertTrue(addUMLDependency.getRefinedBy().contains(addInterfaceRealization));
- assertTrue(addUMLDependency.getRefinedBy().contains(addClientDependencyInClass0));
// CHECK REQUIREMENT
if (kind.equals(TestKind.ADD)) {
@@ -174,25 +168,17 @@ public class AddSubstitutionTest extends AbstractUMLTest {
assertSame(Integer.valueOf(0), Integer.valueOf(addContractInInterfaceRealization.getRequires()
.size()));
- assertSame(Integer.valueOf(4), Integer.valueOf(addInterfaceRealization.getRequires().size()));
+ assertSame(Integer.valueOf(3), Integer.valueOf(addInterfaceRealization.getRequires().size()));
assertTrue(addInterfaceRealization.getRequires().contains(addClientInInterfaceRealization));
assertTrue(addInterfaceRealization.getRequires().contains(addSupplierInInterfaceRealization));
assertTrue(addInterfaceRealization.getRequires().contains(addContractInInterfaceRealization));
- assertTrue(addInterfaceRealization.getRequires().contains(addClientDependencyInClass0));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
}
// CHECK EQUIVALENCE
- assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getEquivalences().size()));
-
- assertNotNull(addClientInInterfaceRealization.getEquivalence());
- assertSame(Integer.valueOf(2), Integer.valueOf(addClientInInterfaceRealization.getEquivalence()
- .getDifferences().size()));
- assertTrue(addClientInInterfaceRealization.getEquivalence().getDifferences().contains(
- addClientInInterfaceRealization));
- assertTrue(addClientInInterfaceRealization.getEquivalence().getDifferences().contains(
- addClientDependencyInClass0));
+ assertSame(Integer.valueOf(0), Integer.valueOf(comparison.getEquivalences().size()));
+ assertNull(addClientInInterfaceRealization.getEquivalence());
testIntersections(comparison);
}
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 b9d66b1a4..88ae7042f 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
@@ -2,14 +2,16 @@ package org.eclipse.emf.compare.uml2.tests.dependency;
import static com.google.common.base.Predicates.and;
import static com.google.common.base.Predicates.instanceOf;
-import static junit.framework.Assert.assertNotNull;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.added;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.addedToReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.ofKind;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removed;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removedFromReference;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertSame;
+import static org.junit.Assert.assertTrue;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
@@ -21,8 +23,8 @@ import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.DifferenceKind;
import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
-import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.dependency.data.DependencyInputData;
import org.eclipse.emf.ecore.resource.Resource;
import org.junit.Test;
@@ -84,40 +86,33 @@ public class AddUsageTest extends AbstractUMLTest {
protected void testAB1(TestKind kind, final Comparison comparison) {
final List<Diff> differences = comparison.getDifferences();
- // We should have no less and no more than 5 differences
- assertSame(Integer.valueOf(5), Integer.valueOf(differences.size()));
+ // We should have no less and no more than 4 differences
+ // Was 5 with UML 4.0 but NamedElement::clientDependency has been made derived in UML 5.0
+ assertEquals(4, differences.size());
Predicate<? super Diff> addDependencyDescription = null;
- Predicate<? super Diff> addRefDependencyInClass0Description = null;
Predicate<? super Diff> addRefClass1InDependencyDescription = null;
Predicate<? super Diff> addRefClass0InDependencyDescription = null;
if (kind.equals(TestKind.DELETE)) {
addDependencyDescription = removed("model.Usage0"); //$NON-NLS-1$
- addRefDependencyInClass0Description = removedFromReference("model.Class0", "clientDependency",
- "model.Usage0");
addRefClass0InDependencyDescription = removedFromReference("model.Usage0", "client",
"model.Class0");
addRefClass1InDependencyDescription = removedFromReference("model.Usage0", "supplier",
"model.Class1");
} else {
addDependencyDescription = added("model.Usage0"); //$NON-NLS-1$
- addRefDependencyInClass0Description = addedToReference("model.Class0", "clientDependency",
- "model.Usage0");
addRefClass0InDependencyDescription = addedToReference("model.Usage0", "client", "model.Class0");
addRefClass1InDependencyDescription = addedToReference("model.Usage0", "supplier", "model.Class1");
}
final Diff addDependency = Iterators.find(differences.iterator(), addDependencyDescription);
- final Diff addRefDependencyInClass0 = Iterators.find(differences.iterator(),
- addRefDependencyInClass0Description);
final Diff addRefClass0InDependency = Iterators.find(differences.iterator(),
addRefClass0InDependencyDescription);
final Diff addRefClass1InDependency = Iterators.find(differences.iterator(),
addRefClass1InDependencyDescription);
assertNotNull(addDependency);
- assertNotNull(addRefDependencyInClass0);
assertNotNull(addRefClass0InDependency);
assertNotNull(addRefClass1InDependency);
@@ -132,11 +127,10 @@ public class AddUsageTest extends AbstractUMLTest {
instanceOf(DirectedRelationshipChange.class), ofKind(DifferenceKind.DELETE)));
}
assertNotNull(addUMLDependency);
- assertSame(Integer.valueOf(4), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
+ assertSame(Integer.valueOf(3), Integer.valueOf(addUMLDependency.getRefinedBy().size()));
assertTrue(addUMLDependency.getRefinedBy().contains(addRefClass0InDependency));
assertTrue(addUMLDependency.getRefinedBy().contains(addRefClass1InDependency));
assertTrue(addUMLDependency.getRefinedBy().contains(addDependency));
- assertTrue(addUMLDependency.getRefinedBy().contains(addRefDependencyInClass0));
// CHECK REQUIREMENT
if (kind.equals(TestKind.ADD)) {
@@ -146,9 +140,6 @@ public class AddUsageTest extends AbstractUMLTest {
assertSame(Integer.valueOf(1), Integer.valueOf(addRefClass1InDependency.getRequires().size()));
assertTrue(addRefClass1InDependency.getRequires().contains(addDependency));
- assertSame(Integer.valueOf(1), Integer.valueOf(addRefDependencyInClass0.getRequires().size()));
- assertTrue(addRefDependencyInClass0.getRequires().contains(addDependency));
-
assertSame(Integer.valueOf(0), Integer.valueOf(addDependency.getRequires().size()));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
} else {
@@ -156,24 +147,16 @@ public class AddUsageTest extends AbstractUMLTest {
assertSame(Integer.valueOf(0), Integer.valueOf(addRefClass1InDependency.getRequires().size()));
- assertSame(Integer.valueOf(0), Integer.valueOf(addRefDependencyInClass0.getRequires().size()));
-
- assertSame(Integer.valueOf(3), Integer.valueOf(addDependency.getRequires().size()));
+ assertSame(Integer.valueOf(2), Integer.valueOf(addDependency.getRequires().size()));
assertTrue(addDependency.getRequires().contains(addRefClass0InDependency));
assertTrue(addDependency.getRequires().contains(addRefClass1InDependency));
- assertTrue(addDependency.getRequires().contains(addRefDependencyInClass0));
assertSame(Integer.valueOf(0), Integer.valueOf(addUMLDependency.getRequires().size()));
}
// CHECK EQUIVALENCE
- assertSame(Integer.valueOf(1), Integer.valueOf(comparison.getEquivalences().size()));
-
- assertNotNull(addRefClass0InDependency.getEquivalence());
- assertSame(Integer.valueOf(2), Integer.valueOf(addRefClass0InDependency.getEquivalence()
- .getDifferences().size()));
- assertTrue(addRefClass0InDependency.getEquivalence().getDifferences().contains(
- addRefDependencyInClass0));
+ assertEquals(0, comparison.getEquivalences().size());
+ assertNull(addRefClass0InDependency.getEquivalence());
testIntersections(comparison);
}
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 dec729d99..0a808a474 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
@@ -2,13 +2,11 @@ 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;
-import static junit.framework.Assert.assertSame;
-import static junit.framework.Assert.assertTrue;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.addedToReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.changedReference;
import static org.eclipse.emf.compare.utils.EMFComparePredicates.removedFromReference;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNull;
import com.google.common.base.Predicate;
import com.google.common.collect.Iterators;
@@ -20,8 +18,8 @@ import org.eclipse.emf.common.util.BasicMonitor;
import org.eclipse.emf.compare.Comparison;
import org.eclipse.emf.compare.Diff;
import org.eclipse.emf.compare.uml2.internal.DirectedRelationshipChange;
-import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLTest;
import org.eclipse.emf.compare.uml2.tests.implications.data.ImplicationsInputData;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.uml2.uml.UMLPackage;
@@ -30,7 +28,7 @@ import org.junit.Test;
@SuppressWarnings("nls")
public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
- private static final int NB_DIFFS = 11;
+ private static final int NB_DIFFS = 9;
private ImplicationsInputData input = new ImplicationsInputData();
@@ -41,11 +39,9 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
Predicate<? super Diff> addClientInInterfaceRealizationDescription = null;
Predicate<? super Diff> addSupplierInInterfaceRealizationDescription = null;
Predicate<? super Diff> addContractInInterfaceRealizationDescription = null;
- Predicate<? super Diff> addClientDependencyInClass0Description = null;
Predicate<? super Diff> addSubstitutionDescription = null;
Predicate<? super Diff> addClientInSubstitutionDescription = null;
Predicate<? super Diff> addSupplierInSubstitutionDescription = null;
- Predicate<? super Diff> addClientDependencyInClass0Description2 = null;
Predicate<? super Diff> addUMLInterfaceRealizationDescription = null;
Predicate<? super Diff> addUMLSubstitutionDescription = null;
@@ -58,16 +54,12 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
"model.Class0.InterfaceRealization0", "supplier", "model.Interface0");
addContractInInterfaceRealizationDescription = changedReference(
"model.Class0.InterfaceRealization0", "contract", "model.Interface0", null);
- addClientDependencyInClass0Description = removedFromReference("model.Class0", "clientDependency",
- "model.Class0.InterfaceRealization0");
addSubstitutionDescription = removedFromReference("model.Class0", "substitution",
"model.Class0.substitution1");
addClientInSubstitutionDescription = removedFromReference("model.Class0.substitution1", "client",
"model.Class0");
addSupplierInSubstitutionDescription = removedFromReference("model.Class0.substitution1",
"supplier", "model.Interface0");
- addClientDependencyInClass0Description2 = removedFromReference("model.Class0",
- "clientDependency", "model.Class0.substitution1");
} else {
addInterfaceRealizationDescription = addedToReference(
"model.Class0", "interfaceRealization", "model.Class0.InterfaceRealization0"); //$NON-NLS-1$
@@ -77,16 +69,12 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
"model.Class0.InterfaceRealization0", "supplier", "model.Interface0");
addContractInInterfaceRealizationDescription = changedReference(
"model.Class0.InterfaceRealization0", "contract", null, "model.Interface0");
- addClientDependencyInClass0Description = addedToReference("model.Class0", "clientDependency",
- "model.Class0.InterfaceRealization0");
addSubstitutionDescription = addedToReference("model.Class0", "substitution",
"model.Class0.substitution1");
addClientInSubstitutionDescription = addedToReference("model.Class0.substitution1", "client",
"model.Class0");
addSupplierInSubstitutionDescription = addedToReference("model.Class0.substitution1", "supplier",
"model.Interface0");
- addClientDependencyInClass0Description2 = addedToReference("model.Class0", "clientDependency",
- "model.Class0.substitution1");
}
DiffsOfInterest diffs = new DiffsOfInterest();
@@ -98,15 +86,11 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
addSupplierInInterfaceRealizationDescription, null);
diffs.addContractInInterfaceRealization = Iterators.find(differences.iterator(),
addContractInInterfaceRealizationDescription, null);
- diffs.addClientDependencyInClass0 = Iterators.find(differences.iterator(),
- addClientDependencyInClass0Description, null);
diffs.addSubstitution = Iterators.find(differences.iterator(), addSubstitutionDescription, null);
diffs.addClientInSubstitution = Iterators.find(differences.iterator(),
addClientInSubstitutionDescription, null);
diffs.addSupplierInSubstitution = Iterators.find(differences.iterator(),
addSupplierInSubstitutionDescription, null);
- diffs.addClientDependencyInClass02 = Iterators.find(differences.iterator(),
- addClientDependencyInClass0Description2, null);
diffs.addUMLInterfaceRealization = Iterators.find(differences.iterator(), and(
instanceOf(DirectedRelationshipChange.class),
discriminantInstanceOf(UMLPackage.Literals.INTERFACE_REALIZATION)), null);
@@ -165,10 +149,9 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
}
private void checkMergeAddClientInInterfaceRealization(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 4, comparison.getDifferences().size());
+ assertEquals(NB_DIFFS - 3, comparison.getDifferences().size());
assertNull(diffs.addClientInInterfaceRealization);
assertNull(diffs.addInterfaceRealization);
- assertNull(diffs.addClientDependencyInClass0);
assertNull(diffs.addUMLInterfaceRealization);
}
@@ -211,83 +194,7 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
}
private void checkMergeDeleteClientInInterfaceRealization(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 6, comparison.getDifferences().size());
- assertNull(diffs.addClientInInterfaceRealization);
- assertNull(diffs.addClientDependencyInClass0);
- assertNull(diffs.addInterfaceRealization);
- assertNull(diffs.addSupplierInInterfaceRealization);
- assertNull(diffs.addContractInInterfaceRealization);
- assertNull(diffs.addUMLInterfaceRealization);
- }
-
- @Test
- public void testA10MergeLtR2UseCase() throws IOException {
- final Resource left = input.getA3Left();
- final Resource right = input.getA3Right();
-
- Comparison comparison = compare(left, right);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.ADD);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyLeftToRight(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.ADD);
-
- checkMergeAddClientDependencyInClass0(comparison, diffs);
- }
-
- private void checkMergeAddClientDependencyInClass0(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 4, comparison.getDifferences().size());
- assertNull(diffs.addClientDependencyInClass0);
- assertNull(diffs.addClientInInterfaceRealization);
- assertNull(diffs.addInterfaceRealization);
- assertNull(diffs.addUMLInterfaceRealization);
- }
-
- @Test
- public void testA10MergeLtR2UseCase3way1() throws IOException {
- final Resource left = input.getA3Left();
- final Resource right = input.getA3Right();
-
- Comparison comparison = compare(left, right, right);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.ADD);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyLeftToRight(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.ADD);
-
- checkMergeAddClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
- public void testA10MergeLtR2UseCase3way2() throws IOException {
- final Resource left = input.getA3Right();
- final Resource right = input.getA3Left();
-
- Comparison comparison = compare(left, right, left);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.ADD);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyLeftToRight(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.ADD);
-
- checkMergeDeleteClientDependencyInClass0(comparison, diffs);
- }
-
- private void checkMergeDeleteClientDependencyInClass0(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 6, comparison.getDifferences().size());
- assertNull(diffs.addClientDependencyInClass0);
+ assertEquals(NB_DIFFS - 5, comparison.getDifferences().size());
assertNull(diffs.addClientInInterfaceRealization);
assertNull(diffs.addInterfaceRealization);
assertNull(diffs.addSupplierInInterfaceRealization);
@@ -315,9 +222,8 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
}
private void checkMergeAddInterfaceRealization(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 4, comparison.getDifferences().size());
+ assertEquals(NB_DIFFS - 3, comparison.getDifferences().size());
assertNull(diffs.addInterfaceRealization);
- assertNull(diffs.addClientDependencyInClass0);
assertNull(diffs.addClientInInterfaceRealization);
assertNull(diffs.addUMLInterfaceRealization);
}
@@ -361,12 +267,11 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
}
private void checkMergeDeleteInterfaceRealization(Comparison comparison, DiffsOfInterest diffs) {
- assertEquals(NB_DIFFS - 6, comparison.getDifferences().size());
+ assertEquals(NB_DIFFS - 5, comparison.getDifferences().size());
assertNull(diffs.addInterfaceRealization);
assertNull(diffs.addClientInInterfaceRealization);
assertNull(diffs.addSupplierInInterfaceRealization);
assertNull(diffs.addContractInInterfaceRealization);
- assertNull(diffs.addClientDependencyInClass0);
assertNull(diffs.addUMLInterfaceRealization);
}
@@ -428,63 +333,6 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
}
@Test
- public void testA10MergeRtL2UseCase() throws IOException {
- final Resource left = input.getA3Left();
- final Resource right = input.getA3Right();
-
- Comparison comparison = compare(left, right);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.ADD);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyRightToLeft(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.ADD);
-
- checkMergeDeleteClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
- public void testA10MergeRtL2UseCase3way1() throws IOException {
- final Resource left = input.getA3Left();
- final Resource right = input.getA3Right();
-
- Comparison comparison = compare(left, right, right);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.ADD);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyRightToLeft(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.ADD);
-
- checkMergeDeleteClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
- public void testA10MergeRtL2UseCase3way2() throws IOException {
- final Resource left = input.getA3Right();
- final Resource right = input.getA3Left();
-
- Comparison comparison = compare(left, right, left);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.ADD);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyRightToLeft(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.ADD);
-
- checkMergeAddClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
public void testA10MergeRtL3UseCase() throws IOException {
final Resource left = input.getA3Left();
final Resource right = input.getA3Right();
@@ -628,63 +476,6 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
}
@Test
- public void testA11MergeLtR2UseCase() throws IOException {
- final Resource left = input.getA3Right();
- final Resource right = input.getA3Left();
-
- Comparison comparison = compare(left, right);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.DELETE);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyLeftToRight(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.DELETE);
-
- checkMergeDeleteClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
- public void testA11MergeLtR2UseCase3way1() throws IOException {
- final Resource left = input.getA3Right();
- final Resource right = input.getA3Left();
-
- Comparison comparison = compare(left, right, right);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.DELETE);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyLeftToRight(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.DELETE);
-
- checkMergeDeleteClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
- public void testA11MergeLtR2UseCase3way2() throws IOException {
- final Resource left = input.getA3Left();
- final Resource right = input.getA3Right();
-
- Comparison comparison = compare(left, right, left);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.DELETE);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyLeftToRight(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.DELETE);
-
- checkMergeAddClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
public void testA11MergeLtR3UseCase() throws IOException {
final Resource left = input.getA3Right();
final Resource right = input.getA3Left();
@@ -799,63 +590,6 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
}
@Test
- public void testA11MergeRtL2UseCase() throws IOException {
- final Resource left = input.getA3Right();
- final Resource right = input.getA3Left();
-
- Comparison comparison = compare(left, right);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.DELETE);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyRightToLeft(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.DELETE);
-
- checkMergeAddClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
- public void testA11MergeRtL2UseCase3way1() throws IOException {
- final Resource left = input.getA3Right();
- final Resource right = input.getA3Left();
-
- Comparison comparison = compare(left, right, right);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.DELETE);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyRightToLeft(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.DELETE);
-
- checkMergeAddClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
- public void testA11MergeRtL2UseCase3way2() throws IOException {
- final Resource left = input.getA3Left();
- final Resource right = input.getA3Right();
-
- Comparison comparison = compare(left, right, left);
-
- DiffsOfInterest diffs = getDiffs(comparison, TestKind.DELETE);
-
- // ** MERGE **
- getMergerRegistry().getHighestRankingMerger(diffs.addClientDependencyInClass0).copyRightToLeft(
- diffs.addClientDependencyInClass0, new BasicMonitor());
-
- comparison = compare(left, right);
- diffs = getDiffs(comparison, TestKind.DELETE);
-
- checkMergeDeleteClientDependencyInClass0(comparison, diffs);
- }
-
- @Test
public void testA11MergeRtL3UseCase() throws IOException {
final Resource left = input.getA3Right();
final Resource right = input.getA3Left();
@@ -915,22 +649,16 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
private void testAB1(TestKind kind, final Comparison comparison) {
final List<Diff> differences = comparison.getDifferences();
- assertSame(Integer.valueOf(NB_DIFFS), Integer.valueOf(differences.size()));
+ assertEquals(NB_DIFFS, differences.size());
DiffsOfInterest diffs = getDiffs(comparison, kind);
if (kind.equals(TestKind.DELETE)) {
- assertEquals(1, diffs.addClientDependencyInClass0.getImplies().size());
- assertTrue(diffs.addClientDependencyInClass0.getImplies().contains(diffs.addInterfaceRealization));
-
- assertEquals(1, diffs.addClientDependencyInClass02.getImplies().size());
- assertTrue(diffs.addClientDependencyInClass02.getImplies().contains(diffs.addSubstitution));
+ // there were tests for UML4, no longer valid for 5.0 with clientDependency being
+ // marked as derived.
} else {
- assertEquals(1, diffs.addInterfaceRealization.getImplies().size());
- assertTrue(diffs.addInterfaceRealization.getImplies().contains(diffs.addClientDependencyInClass0));
-
- assertEquals(1, diffs.addSubstitution.getImplies().size());
- assertTrue(diffs.addSubstitution.getImplies().contains(diffs.addClientDependencyInClass02));
+ assertEquals(0, diffs.addInterfaceRealization.getImplies().size());
+ assertEquals(0, diffs.addSubstitution.getImplies().size());
}
assertEquals(0, diffs.addClientInInterfaceRealization.getImplies().size());
assertEquals(0, diffs.addClientInSubstitution.getImplies().size());
@@ -951,16 +679,12 @@ public class ImplicationsInterfaceRealizationTest extends AbstractUMLTest {
public Diff addContractInInterfaceRealization;
- public Diff addClientDependencyInClass0;
-
public Diff addSubstitution;
public Diff addClientInSubstitution;
public Diff addSupplierInSubstitution;
- public Diff addClientDependencyInClass02;
-
public Diff addUMLInterfaceRealization;
public Diff addUMLSubstitution;

Back to the top