Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAxel Richard2015-06-16 10:30:45 -0400
committerAxel Richard2015-06-18 04:18:33 -0400
commit3d76dcc75feff47c236b88764f04e6a1db394639 (patch)
tree39045784da75ddd4e6ee38e76867467c9419c185 /plugins/org.eclipse.emf.compare.uml2.tests
parentf7825720f65b8ff9d6af446997b48e747bbebd67 (diff)
downloadorg.eclipse.emf.compare-3d76dcc75feff47c236b88764f04e6a1db394639.tar.gz
org.eclipse.emf.compare-3d76dcc75feff47c236b88764f04e6a1db394639.tar.xz
org.eclipse.emf.compare-3d76dcc75feff47c236b88764f04e6a1db394639.zip
[Tests] Add tests for new UML dangling Stereotype Application concept
Change-Id: I9ce91b974906b525b803e443b4252d8f3ead27aa Signed-off-by: Axel Richard <axel.richard@obeo.fr>
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/stereotypes/DanglingStereotypeApplicationTest.java224
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/DanglingStereotypeApplicationInputData.java95
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case1/left.uml11
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case1/right.uml12
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case2/left.uml12
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case2/right.uml12
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case3/left.uml13
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case3/right.uml12
-rw-r--r--plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/suite/AllTests.java4
9 files changed, 394 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/DanglingStereotypeApplicationTest.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/DanglingStereotypeApplicationTest.java
new file mode 100644
index 000000000..43fe110dc
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/DanglingStereotypeApplicationTest.java
@@ -0,0 +1,224 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.uml2.tests.stereotypes;
+
+import static com.google.common.collect.Iterables.filter;
+import static com.google.common.collect.Iterables.size;
+import static org.eclipse.emf.compare.utils.EMFComparePredicates.hasState;
+import static org.junit.Assert.assertEquals;
+
+import java.io.IOException;
+import java.util.Map;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.compare.Comparison;
+import org.eclipse.emf.compare.Diff;
+import org.eclipse.emf.compare.DifferenceState;
+import org.eclipse.emf.compare.ResourceAttachmentChange;
+import org.eclipse.emf.compare.uml2.internal.DanglingStereotypeApplication;
+import org.eclipse.emf.compare.uml2.profile.test.uml2comparetestprofile.UML2CompareTestProfilePackage;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLProfileTest;
+import org.eclipse.emf.compare.uml2.tests.stereotypes.data.dangling.DanglingStereotypeApplicationInputData;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.uml2.uml.UMLPlugin;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+public class DanglingStereotypeApplicationTest extends AbstractUMLProfileTest {
+
+ private DanglingStereotypeApplicationInputData input;
+
+ @BeforeClass
+ public static void fillRegistriesForStatic() {
+ if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
+ EPackage.Registry.INSTANCE.put(UML2CompareTestProfilePackage.eNS_URI,
+ UML2CompareTestProfilePackage.eINSTANCE); // registers
+ // against
+ // EPackage.Registry
+ // It is required to link the EPackage to the UML package of the UML Profile
+ Map<String, URI> ePackageNsURIToProfileLocationMap = UMLPlugin
+ .getEPackageNsURIToProfileLocationMap();
+ ePackageNsURIToProfileLocationMap
+ .put(UML2CompareTestProfilePackage.eNS_URI,
+ URI.createURI("pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw")); //$NON-NLS-1$
+ }
+ }
+
+ @AfterClass
+ public static void resetRegistriesForStatic() {
+ if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
+ UMLPlugin.getEPackageNsURIToProfileLocationMap().remove(UML2CompareTestProfilePackage.eNS_URI);
+ EPackage.Registry.INSTANCE.remove(UML2CompareTestProfilePackage.eNS_URI);
+ }
+ }
+
+ @Before
+ @Override
+ public void before() {
+ super.before();
+ input = new DanglingStereotypeApplicationInputData();
+ }
+
+ @Override
+ protected AbstractUMLInputData getInput() {
+ return input;
+ }
+
+ /**
+ * Case 1: Dangling stereotype with nothing on the other side.
+ *
+ * @throws IOException
+ */
+ @Test
+ public void testDetectDanglingstereotypeApplication_Case1() throws IOException {
+ Comparison comparison = compare(input.getCase1Left(), input.getCase1Right(), null);
+ // 1 ResourceAttachmentChange refining 1 DanglingStereotypeApplication (which is also a
+ // ResourceAttachmentChange)
+ assertEquals(2, size(comparison.getDifferences()));
+ Iterable<ResourceAttachmentChange> racs = filter(comparison.getDifferences(),
+ ResourceAttachmentChange.class);
+ assertEquals(2, size(racs));
+ Iterable<DanglingStereotypeApplication> danglings = filter(comparison.getDifferences(),
+ DanglingStereotypeApplication.class);
+ assertEquals(1, size(danglings));
+ }
+
+ /**
+ * Case 2: Dangling stereotype with class (without stereotype) on the other side
+ */
+ @Test
+ public void testDetectDanglingstereotypeApplication_Case2() throws IOException {
+ Comparison comparison = compare(input.getCase2Left(), input.getCase2Right(), null);
+ // 1 ResourceAttachmentChange refining 1 DanglingStereotypeApplication (which is also a
+ // ResourceAttachmentChange)
+ // 1 ReferenceChange (addition of a Class)
+ assertEquals(3, size(comparison.getDifferences()));
+ Iterable<ResourceAttachmentChange> racs = filter(comparison.getDifferences(),
+ ResourceAttachmentChange.class);
+ assertEquals(2, size(racs));
+ Iterable<DanglingStereotypeApplication> danglings = filter(comparison.getDifferences(),
+ DanglingStereotypeApplication.class);
+ assertEquals(1, size(danglings));
+ }
+
+ /**
+ * Case 3: Dangling stereotype with class (with stereotype) on the other side In this case, no
+ * DanglingStereotypeApplication should be detected.
+ */
+ @Test
+ public void testDetectDanglingstereotypeApplication_Case3() throws IOException {
+ Comparison comparison = compare(input.getCase3Left(), input.getCase3Right(), null);
+ Iterable<ResourceAttachmentChange> racs = filter(comparison.getDifferences(),
+ ResourceAttachmentChange.class);
+ assertEquals(0, size(racs));
+ Iterable<DanglingStereotypeApplication> danglings = filter(comparison.getDifferences(),
+ DanglingStereotypeApplication.class);
+ assertEquals(0, size(danglings));
+ }
+
+ /**
+ * Case 1: Dangling stereotype with nothing on the other side. A merge from left to right of the
+ * DanglingStereotypeApplication will lead to delete the dangling stereotype on the right model.
+ */
+ @Test
+ public void testMergeDanglingstereotypeApplication_Case1_LtR() throws IOException {
+ Resource left = input.getCase1Left();
+ Resource right = input.getCase1Right();
+ assertEquals(1, left.getContents().size());
+ assertEquals(2, right.getContents().size());
+ Comparison comparison = compare(left, right, null);
+ Iterable<DanglingStereotypeApplication> danglings = filter(comparison.getDifferences(),
+ DanglingStereotypeApplication.class);
+ for (Diff diff : danglings) {
+ getMergerRegistry().getHighestRankingMerger(diff).copyLeftToRight(diff, null);
+ }
+ assertEquals(1, left.getContents().size());
+ assertEquals(1, right.getContents().size());
+ Iterable<Diff> unresolved = filter(comparison.getDifferences(), hasState(DifferenceState.UNRESOLVED));
+ assertEquals(0, size(unresolved));
+ }
+
+ /**
+ * Case 1: Dangling stereotype with nothing on the other side.A merge from right to left of the
+ * DanglingStereotypeApplication will lead to have the dangling stereotype also on the left model.
+ */
+ @Test
+ public void testMergeDanglingstereotypeApplication_Case1_RtL() throws IOException {
+ Resource left = input.getCase1Left();
+ Resource right = input.getCase1Right();
+ assertEquals(1, left.getContents().size());
+ assertEquals(2, right.getContents().size());
+ Comparison comparison = compare(left, right, null);
+ Iterable<DanglingStereotypeApplication> danglings = filter(comparison.getDifferences(),
+ DanglingStereotypeApplication.class);
+ for (Diff diff : danglings) {
+ getMergerRegistry().getHighestRankingMerger(diff).copyRightToLeft(diff, null);
+ }
+ assertEquals(2, left.getContents().size());
+ assertEquals(2, right.getContents().size());
+ Iterable<Diff> unresolved = filter(comparison.getDifferences(), hasState(DifferenceState.UNRESOLVED));
+ assertEquals(0, size(unresolved));
+ }
+
+ /**
+ * Case 2: Dangling stereotype with class (without stereotype) on the other side. A merge from left to
+ * right of the DanglingStereotypeApplication will lead to delete the dangling stereotype on the right
+ * model.
+ */
+ @Test
+ public void testMergeDanglingstereotypeApplication_Case2_LtR() throws IOException {
+ Resource left = input.getCase2Left();
+ Resource right = input.getCase2Right();
+ assertEquals(1, left.getContents().size());
+ assertEquals(2, right.getContents().size());
+ Comparison comparison = compare(left, right, null);
+ Iterable<DanglingStereotypeApplication> danglings = filter(comparison.getDifferences(),
+ DanglingStereotypeApplication.class);
+ for (Diff diff : danglings) {
+ getMergerRegistry().getHighestRankingMerger(diff).copyLeftToRight(diff, null);
+ }
+ assertEquals(1, left.getContents().size());
+ assertEquals(1, right.getContents().size());
+ // The class is not merged.
+ Iterable<Diff> unresolved = filter(comparison.getDifferences(), hasState(DifferenceState.UNRESOLVED));
+ assertEquals(1, size(unresolved));
+ }
+
+ /**
+ * Case 2: Dangling stereotype with class (without stereotype) on the other side. A merge from right to
+ * left of the DanglingStereotypeApplication will lead to have the dangling stereotype also on the left
+ * model.
+ */
+ @Test
+ public void testMergeDanglingstereotypeApplication_Case2_RtL() throws IOException {
+ Resource left = input.getCase2Left();
+ Resource right = input.getCase2Right();
+ assertEquals(1, left.getContents().size());
+ assertEquals(2, right.getContents().size());
+ Comparison comparison = compare(left, right, null);
+ Iterable<DanglingStereotypeApplication> danglings = filter(comparison.getDifferences(),
+ DanglingStereotypeApplication.class);
+ for (Diff diff : danglings) {
+ getMergerRegistry().getHighestRankingMerger(diff).copyRightToLeft(diff, null);
+ }
+ assertEquals(2, left.getContents().size());
+ assertEquals(2, right.getContents().size());
+ // The class is not merged.
+ Iterable<Diff> unresolved = filter(comparison.getDifferences(), hasState(DifferenceState.UNRESOLVED));
+ assertEquals(1, size(unresolved));
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/DanglingStereotypeApplicationInputData.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/DanglingStereotypeApplicationInputData.java
new file mode 100644
index 000000000..447ce309d
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/DanglingStereotypeApplicationInputData.java
@@ -0,0 +1,95 @@
+/*******************************************************************************
+ * Copyright (c) 2015 Obeo.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Obeo - initial API and implementation
+ *******************************************************************************/
+package org.eclipse.emf.compare.uml2.tests.stereotypes.data.dangling;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.Collections;
+import java.util.Map;
+
+import org.eclipse.emf.common.EMFPlugin;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.compare.uml2.tests.AbstractUMLInputData;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.URIConverter;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.uml2.uml.resource.UMLResource;
+import org.eclipse.uml2.uml.resources.ResourcesPlugin;
+import org.eclipse.uml2.uml.resources.util.UMLResourcesUtil;
+
+public class DanglingStereotypeApplicationInputData extends AbstractUMLInputData {
+
+ public Resource getCase1Left() throws IOException {
+ return loadFromClassLoader("case1/left.uml"); //$NON-NLS-1$
+ }
+
+ public Resource getCase1Right() throws IOException {
+ return loadFromClassLoader("case1/right.uml"); //$NON-NLS-1$
+ }
+
+ public Resource getCase2Left() throws IOException {
+ return loadFromClassLoader("case2/left.uml"); //$NON-NLS-1$
+ }
+
+ public Resource getCase2Right() throws IOException {
+ return loadFromClassLoader("case2/right.uml"); //$NON-NLS-1$
+ }
+
+ public Resource getCase3Left() throws IOException {
+ return loadFromClassLoader("case3/left.uml"); //$NON-NLS-1$
+ }
+
+ public Resource getCase3Right() throws IOException {
+ return loadFromClassLoader("case3/right.uml"); //$NON-NLS-1$
+ }
+
+ @Override
+ protected Resource loadFromClassLoader(String string) throws IOException {
+
+ final URL fileURL = getClass().getResource(string);
+ final InputStream str = fileURL.openStream();
+ final URI uri = URI.createURI(fileURL.toString());
+
+ ResourceSet resourceSet = new ResourceSetImpl();
+ getSets().add(resourceSet);
+
+ // Standalone
+ if (!EMFPlugin.IS_ECLIPSE_RUNNING) {
+ UMLResourcesUtil.init(resourceSet);
+
+ // override wrong pathmap mapping in UMLResourcesUtil
+ final URL UMLJarredFileLocation = ResourcesPlugin.class.getResource("ResourcesPlugin.class");
+ String UMLJarPath = UMLJarredFileLocation.toString();
+ UMLJarPath = UMLJarPath.substring(0, UMLJarPath.indexOf('!'));
+
+ final Map<URI, URI> uriMap = URIConverter.URI_MAP;
+ uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), URI.createURI(UMLJarPath
+ + "!/libraries/"));
+ uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), URI.createURI(UMLJarPath
+ + "!/metamodels/"));
+ uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP), URI.createURI(UMLJarPath + "!/profiles/"));
+ }
+
+ Resource resource = resourceSet.createResource(uri);
+ try {
+ resource.load(str, Collections.emptyMap());
+ } catch (IOException e) {
+ // Do nothing. Let the models with errors to be load.
+ // See DanglingStereotypApplicationTest.
+ }
+ str.close();
+
+ return resource;
+ }
+
+}
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case1/left.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case1/left.uml
new file mode 100644
index 000000000..684c26003
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case1/left.uml
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:testProfile="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile">
+ <uml:Model xmi:id="_6rQaMGBlEeCwQ5tRW0zUZA" name="aModel">
+ <profileApplication xmi:id="_WsrGcPNPEeG0ipjyqWM1zA">
+ <eAnnotations xmi:id="_WsrGcfNPEeG0ipjyqWM1zA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw"/>
+ </profileApplication>
+ </uml:Model>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case1/right.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case1/right.uml
new file mode 100644
index 000000000..269eca478
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case1/right.uml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:testProfile="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile">
+ <uml:Model xmi:id="_6rQaMGBlEeCwQ5tRW0zUZA" name="aModel">
+ <profileApplication xmi:id="_WsrGcPNPEeG0ipjyqWM1zA">
+ <eAnnotations xmi:id="_WsrGcfNPEeG0ipjyqWM1zA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw"/>
+ </profileApplication>
+ </uml:Model>
+ <testProfile:ACliche xmi:id="_YeoMQPNPEeG0ipjyqWM1zA" base_Class="_OEBOkPNPEeG0ipjyqWM1zA"/>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case2/left.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case2/left.uml
new file mode 100644
index 000000000..523236a2a
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case2/left.uml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:testProfile="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile">
+ <uml:Model xmi:id="_6rQaMGBlEeCwQ5tRW0zUZA" name="aModel">
+ <packagedElement xmi:type="uml:Class" xmi:id="_OEBOkPNPEeG0ipjyqWM1zA" name="Test"/>
+ <profileApplication xmi:id="_WsrGcPNPEeG0ipjyqWM1zA">
+ <eAnnotations xmi:id="_WsrGcfNPEeG0ipjyqWM1zA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw"/>
+ </profileApplication>
+ </uml:Model>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case2/right.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case2/right.uml
new file mode 100644
index 000000000..269eca478
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case2/right.uml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:testProfile="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile">
+ <uml:Model xmi:id="_6rQaMGBlEeCwQ5tRW0zUZA" name="aModel">
+ <profileApplication xmi:id="_WsrGcPNPEeG0ipjyqWM1zA">
+ <eAnnotations xmi:id="_WsrGcfNPEeG0ipjyqWM1zA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw"/>
+ </profileApplication>
+ </uml:Model>
+ <testProfile:ACliche xmi:id="_YeoMQPNPEeG0ipjyqWM1zA" base_Class="_OEBOkPNPEeG0ipjyqWM1zA"/>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case3/left.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case3/left.uml
new file mode 100644
index 000000000..48e1c3fc3
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case3/left.uml
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:testProfile="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile">
+ <uml:Model xmi:id="_6rQaMGBlEeCwQ5tRW0zUZA" name="aModel">
+ <packagedElement xmi:type="uml:Class" xmi:id="_OEBOkPNPEeG0ipjyqWM1zA" name="Test"/>
+ <profileApplication xmi:id="_WsrGcPNPEeG0ipjyqWM1zA">
+ <eAnnotations xmi:id="_WsrGcfNPEeG0ipjyqWM1zA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw"/>
+ </profileApplication>
+ </uml:Model>
+ <testProfile:ACliche xmi:id="_YeoMQPNPEeG0ipjyqWM1zA" base_Class="_OEBOkPNPEeG0ipjyqWM1zA"/>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case3/right.uml b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case3/right.uml
new file mode 100644
index 000000000..269eca478
--- /dev/null
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/stereotypes/data/dangling/case3/right.uml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.1" xmlns:xmi="http://schema.omg.org/spec/XMI/2.1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:testProfile="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile">
+ <uml:Model xmi:id="_6rQaMGBlEeCwQ5tRW0zUZA" name="aModel">
+ <profileApplication xmi:id="_WsrGcPNPEeG0ipjyqWM1zA">
+ <eAnnotations xmi:id="_WsrGcfNPEeG0ipjyqWM1zA" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/emf/compare/uml2/1.0.0/testprofile#//uml2comparetestprofile"/>
+ </eAnnotations>
+ <appliedProfile href="pathmap://UML_COMPARE_TESTS_PROFILE/uml2.compare.testprofile.profile.uml#_hZFTgIwkEeC_FYHMbTTxXw"/>
+ </profileApplication>
+ </uml:Model>
+ <testProfile:ACliche xmi:id="_YeoMQPNPEeG0ipjyqWM1zA" base_Class="_OEBOkPNPEeG0ipjyqWM1zA"/>
+</xmi:XMI>
diff --git a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/suite/AllTests.java b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/suite/AllTests.java
index 44bf7997f..1d9a194ab 100644
--- a/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/suite/AllTests.java
+++ b/plugins/org.eclipse.emf.compare.uml2.tests/src/org/eclipse/emf/compare/uml2/tests/suite/AllTests.java
@@ -45,6 +45,7 @@ import org.eclipse.emf.compare.uml2.tests.opaque.OpaqueElementBodyChangeDiffTest
import org.eclipse.emf.compare.uml2.tests.opaque.OpaqueElementBodyChangeMergeTest;
import org.eclipse.emf.compare.uml2.tests.profiles.DynamicProfileTest;
import org.eclipse.emf.compare.uml2.tests.profiles.StaticProfileTest;
+import org.eclipse.emf.compare.uml2.tests.stereotypes.DanglingStereotypeApplicationTest;
import org.eclipse.emf.compare.uml2.tests.stereotypes.DynamicStereotypeTest;
import org.eclipse.emf.compare.uml2.tests.stereotypes.DynamicStereotypedElementChangeTests;
import org.eclipse.emf.compare.uml2.tests.stereotypes.StaticStereotypeTest;
@@ -72,7 +73,8 @@ import org.junit.runners.Suite.SuiteClasses;
DynamicStereotypedElementChangeTests.class, ImplicationsAssociationTest.class,
ImplicationsTransitionTest.class, ImplicationsInterfaceRealizationTest.class,
StaticStereotypedElementItemProviderTest.class, DynamicStereotypedElementItemProviderTest.class,
- OpaqueElementBodyChangeDiffTest.class, OpaqueElementBodyChangeMergeTest.class })
+ OpaqueElementBodyChangeDiffTest.class, OpaqueElementBodyChangeMergeTest.class,
+ DanglingStereotypeApplicationTest.class })
public class AllTests {
/**

Back to the top