Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.di (renamed from tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.di)0
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.notation (renamed from tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.notation)74
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.uml (renamed from tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.uml)17
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/AllTests.java3
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/TestUnapplyProfile2Comment.java130
5 files changed, 137 insertions, 87 deletions
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.di b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.di
index e8ef6dcf466..e8ef6dcf466 100644
--- a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.di
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.di
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.notation
index c9aed6c7086..1da261440ca 100644
--- a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.notation
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.notation
@@ -84,47 +84,6 @@
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_26bZ4PiYEeSxko_tWvdMlw" source="PapyrusCSSForceValue">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_26bZ4fiYEeSxko_tWvdMlw" key="visible" value="true"/>
</eAnnotations>
- <children xmi:type="notation:BasicCompartment" xmi:id="_26UFIPiYEeSxko_tWvdMlw" type="StereotypeCompartment">
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_26cA8PiYEeSxko_tWvdMlw" source="PapyrusCSSForceValue">
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_26cA8fiYEeSxko_tWvdMlw" key="visible" value="true"/>
- </eAnnotations>
- <children xmi:type="notation:DecorationNode" xmi:id="_26UFJPiYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_dcMxQGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_26UFJfiYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_26UFJviYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_meyzIGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_26UFJ_iYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_26UFKPiYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_wshLYGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_26UFKfiYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_26UsMPiYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_1ta5cGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_26UsMfiYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_26UsMviYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_71vikGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_26UsM_iYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_26UsNPiYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_BfRW4GkeEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_26UsNfiYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_26UsNviYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_Lb0QgGz4EeGEKeJyQaxg3g"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_26UsN_iYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_26UsOPiYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_jAiq8G38EeGag98Jn1kDVw"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_26UsOfiYEeSxko_tWvdMlw"/>
- </children>
- <styles xmi:type="notation:TitleStyle" xmi:id="_26UFIfiYEeSxko_tWvdMlw" showTitle="true"/>
- <styles xmi:type="notation:StringValueStyle" xmi:id="_26UFIviYEeSxko_tWvdMlw" name="stereotype" stringValue="testProfile::Stereotype1"/>
- <element xmi:type="uml:Stereotype" href="pathmap://Test_PROFILES/testProfile.profile.uml#_WJYD4GkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_26UFI_iYEeSxko_tWvdMlw"/>
- </children>
<styles xmi:type="notation:TitleStyle" xmi:id="_26S3AfiYEeSxko_tWvdMlw" showTitle="true"/>
<styles xmi:type="notation:EObjectValueStyle" xmi:id="_26S3A_iYEeSxko_tWvdMlw" name="BASE_ELEMENT">
<eObjectValue xmi:type="uml:Class" href="UnapplyProfile.uml#_BPjGgBwgEeKYb8ts8yUAsw"/>
@@ -136,39 +95,6 @@
<eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3ATYYPiYEeSxko_tWvdMlw" source="PapyrusCSSForceValue">
<details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_3ATYYfiYEeSxko_tWvdMlw" key="visible" value="true"/>
</eAnnotations>
- <children xmi:type="notation:BasicCompartment" xmi:id="_3APG8PiYEeSxko_tWvdMlw" type="StereotypeCompartment">
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3AT_cPiYEeSxko_tWvdMlw" source="PapyrusCSSForceValue">
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_3AT_cfiYEeSxko_tWvdMlw" key="visible" value="true"/>
- </eAnnotations>
- <children xmi:type="notation:DecorationNode" xmi:id="_3APuAPiYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_dcMxQGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_3APuAfiYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_3APuAviYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_meyzIGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_3APuA_iYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_3APuBPiYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_wshLYGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_3APuBfiYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_3APuBviYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_1ta5cGkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_3APuB_iYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_3AQVEviYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_Lb0QgGz4EeGEKeJyQaxg3g"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_3AQVE_iYEeSxko_tWvdMlw"/>
- </children>
- <children xmi:type="notation:DecorationNode" xmi:id="_3AQVFPiYEeSxko_tWvdMlw" type="StereotypeProperty">
- <element xmi:type="uml:Property" href="pathmap://Test_PROFILES/testProfile.profile.uml#_jAiq8G38EeGag98Jn1kDVw"/>
- <layoutConstraint xmi:type="notation:Location" xmi:id="_3AQVFfiYEeSxko_tWvdMlw"/>
- </children>
- <styles xmi:type="notation:TitleStyle" xmi:id="_3APG8fiYEeSxko_tWvdMlw" showTitle="true"/>
- <styles xmi:type="notation:StringValueStyle" xmi:id="_3APG8viYEeSxko_tWvdMlw" name="stereotype" stringValue="testProfile::Stereotype1"/>
- <element xmi:type="uml:Stereotype" href="pathmap://Test_PROFILES/testProfile.profile.uml#_WJYD4GkdEeGGJOTenKBKAg"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3APG8_iYEeSxko_tWvdMlw"/>
- </children>
<styles xmi:type="notation:TitleStyle" xmi:id="_3AOf4fiYEeSxko_tWvdMlw" showTitle="true"/>
<styles xmi:type="notation:EObjectValueStyle" xmi:id="_3AOf4_iYEeSxko_tWvdMlw" name="BASE_ELEMENT">
<eObjectValue xmi:type="uml:Dependency" href="UnapplyProfile.uml#_FcrOQBwgEeKYb8ts8yUAsw"/>
diff --git a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.uml
index 918ac1a2966..962eb0e087b 100644
--- a/tests/recipes/plugins/uml/org.eclipse.papyrus.uml.appliedstereotypecommend.recipetest/resources/deletion/UnapplyProfile.uml
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/resource/UnapplyProfile.uml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:testProfile="http:///schemas/testProfile/_dg9pAM0tEeKjW9KkdY00_w/4" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/testProfile/_dg9pAM0tEeKjW9KkdY00_w/4 pathmap://Test_PROFILES/testProfile.profile.uml#_dqAQQM0tEeKjW9KkdY00_w">
+<xmi:XMI xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:testProfile="http:///schemas/testProfile/_dg9pAM0tEeKjW9KkdY00_w/4" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/testProfile/_dg9pAM0tEeKjW9KkdY00_w/4 testProfile.profile.uml#_dqAQQM0tEeKjW9KkdY00_w">
<uml:Model xmi:id="_6wmGEBwfEeKYb8ts8yUAsw" name="model">
<ownedComment xmi:type="uml:Comment" xmi:id="_Mfd7kBwgEeKYb8ts8yUAsw">
<body>Unapply Profile. The comments have to disappear.</body>
@@ -7,18 +7,11 @@
<packagedElement xmi:type="uml:Class" xmi:id="_BPjGgBwgEeKYb8ts8yUAsw" name="StereotypedClass"/>
<packagedElement xmi:type="uml:Class" xmi:id="_EmOucBwgEeKYb8ts8yUAsw" name="Class1"/>
<packagedElement xmi:type="uml:Dependency" xmi:id="_FcrOQBwgEeKYb8ts8yUAsw" name="StereotypedLink" client="_EmOucBwgEeKYb8ts8yUAsw" supplier="_BPjGgBwgEeKYb8ts8yUAsw"/>
- <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_ARp64BwgEeKYb8ts8yUAsw">
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_3Y_lMPiYEeSxko_tWvdMlw" source="PapyrusVersion">
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_3Y_lMfiYEeSxko_tWvdMlw" key="Version" value="0.0.5"/>
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_3Y_lMviYEeSxko_tWvdMlw" key="Comment" value="update profile for multi evaluation"/>
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_3Y_lM_iYEeSxko_tWvdMlw" key="Copyright" value="CEA LIST"/>
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_3Y_lNPiYEeSxko_tWvdMlw" key="Date" value="2013-06-04"/>
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_3Y_lNfiYEeSxko_tWvdMlw" key="Author" value="P. Tessier"/>
+ <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_w-kqgBv6EeWCXpPpR63ucQ">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_w-l4oBv6EeWCXpPpR63ucQ" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="testProfile.profile.uml#_dqAQQM0tEeKjW9KkdY00_w"/>
</eAnnotations>
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_AR810BwgEeKYb8ts8yUAsw" source="http://www.eclipse.org/uml2/2.0.0/UML">
- <references xmi:type="ecore:EPackage" href="pathmap://Test_PROFILES/testProfile.profile.uml#_dqAQQM0tEeKjW9KkdY00_w"/>
- </eAnnotations>
- <appliedProfile xmi:type="uml:Profile" href="pathmap://Test_PROFILES/testProfile.profile.uml#_UVrRoGkdEeGGJOTenKBKAg"/>
+ <appliedProfile xmi:type="uml:Profile" href="testProfile.profile.uml#_UVrRoGkdEeGGJOTenKBKAg"/>
</profileApplication>
</uml:Model>
<testProfile:Stereotype1 xmi:id="_J8_-0BwgEeKYb8ts8yUAsw" base_Element="_BPjGgBwgEeKYb8ts8yUAsw"/>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/AllTests.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/AllTests.java
index 87caa861400..80136951362 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/AllTests.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/AllTests.java
@@ -26,7 +26,8 @@ import org.junit.runners.Suite.SuiteClasses;
TestProfileApplication.class,
TestStereotypeApplication.class,
TestLayoutWithStereotype.class,
-TestUnapplyProfile2ClosedDiagComment.class
+TestUnapplyProfile2ClosedDiagComment.class,
+TestUnapplyProfile2Comment.class
})
public class AllTests {
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/TestUnapplyProfile2Comment.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/TestUnapplyProfile2Comment.java
new file mode 100644
index 00000000000..c1ac178e700
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.stereotypeproperty.tests/src/org/eclipse/papyrus/uml/diagram/stereotypeproperty/TestUnapplyProfile2Comment.java
@@ -0,0 +1,130 @@
+/*****************************************************************************
+ * Copyright (c) 2015 CEA LIST and others.
+ *
+ * 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:
+ * CEA LIST - Initial API and implementation
+ * Francois Le Fevre francois.le-fevre@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.stereotypeproperty;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.papyrus.uml.diagram.stereotype.edition.editpart.AppliedStereotypeEmptyEditPart;
+import org.eclipse.papyrus.uml.tools.commands.UnapplyProfileCommand;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Profile;
+import org.junit.Rule;
+import org.junit.Test;
+
+
+/**
+ * Unapply Profile. The comments have to disappear.
+ */
+@PluginResource({TestUnapplyProfile2Comment.MODEL_DI })
+public class TestUnapplyProfile2Comment extends AbstractPapyrusTestCase {
+
+ final static String MODEL_DI = "resource/UnapplyProfile.di"; //$NON-NLS-1$
+
+ final static String STEREOTYPEDCLASS = "StereotypedClass"; //$NON-NLS-1$
+ final static String CLASS1 = "Class1"; //$NON-NLS-1$
+ final static String STEREOTYPEDLINK = "StereotypedLink"; //$NON-NLS-1$
+
+ final static String PROFILE = "testProfile"; //$NON-NLS-1$
+
+ private IMultiDiagramEditor editor;
+
+ @Rule
+ public final PapyrusEditorFixture fixture = new PapyrusEditorFixture();
+
+
+ @Test
+ @ActiveDiagram("ClassDiagram")
+ public void testUnApplyStereotypeApplication() {
+
+ editor = fixture.getEditor(MODEL_DI);
+ fixture.openDiagram("ClassDiagram"); //$NON-NLS-1$
+
+ //Check initial model
+ NamedElement stereotypedClass = fixture.getModel().getOwnedMember(STEREOTYPEDCLASS);
+ EditPart stereotypedClassEditPart = fixture.findEditPart(stereotypedClass);
+ for(Object o : stereotypedClassEditPart.getChildren()){
+ if(o instanceof AppliedStereotypeEmptyEditPart){
+ assertTrue(STEREOTYPEDCLASS+" do not refer to any AppliedStereotypeEmptyEditPart comment", true); //$NON-NLS-1$
+ }
+ }
+ //List of EditPart
+ //ClassNameEditPart
+ //ClassAttributeCompartmentEditPart
+ //ClassOperationCompartmentEditPart
+ //ClassNestedclassifierCompartemtnEditPart
+ //ClassFloatingNameEditPart
+ //AppliedStereotypeEmptyEditPart
+ assertEquals(STEREOTYPEDCLASS + " has not the right number of children", 6, stereotypedClassEditPart.getChildren().size()); //$NON-NLS-1$
+
+ NamedElement stereotypedLink = fixture.getModel().getOwnedMember(STEREOTYPEDLINK);
+ EditPart stereotypedLinkEditPart = fixture.findEditPart(stereotypedLink);
+ for(Object o : stereotypedLinkEditPart.getChildren()){
+ if(o instanceof AppliedStereotypeEmptyEditPart){
+ assertTrue(STEREOTYPEDLINK+" do not refer to any AppliedStereotypeEmptyEditPart comment", true); //$NON-NLS-1$
+ }
+ }
+ //List of EditPart
+ //DependencyNameEditPart
+ //AppliedStereotypeDependencyEditPart
+ //AppliedStereotypeEmptyEditPart
+ assertEquals(STEREOTYPEDLINK + " has not the right number of children", 3, stereotypedLinkEditPart.getChildren().size()); //$NON-NLS-1$
+
+ //Remove the stereotypes
+
+ TransactionalEditingDomain domain = fixture.getEditingDomain(editor);
+ EList<Profile> profiles= fixture.getModel().getAllAppliedProfiles();
+ for(Profile profile : profiles){
+ if(PROFILE.compareTo(profile.getName())==0){
+ fixture.execute(new UnapplyProfileCommand(fixture.getModel(), profile, domain));
+ }
+ }
+
+ //check the final model
+ //List of EditPart
+ //ClassNameEditPart
+ //ClassAttributeCompartmentEditPart
+ //ClassOperationCompartmentEditPart
+ //ClassNestedclassifierCompartemtnEditPart
+ //ClassFloatingNameEditPart
+ //AppliedStereotypeEmptyEditPart --> should be removed
+ assertEquals(STEREOTYPEDCLASS + " has not the right number of children", 5, stereotypedClassEditPart.getChildren().size()); //$NON-NLS-1$
+ for(Object ee : stereotypedClassEditPart.getChildren()){
+ EditPart a = (EditPart)ee;
+ if(a instanceof AppliedStereotypeEmptyEditPart){
+ assertTrue(STEREOTYPEDCLASS+" still refer to a AppliedStereotypeEmptyEditPart comment", false); //$NON-NLS-1$
+ }
+ }
+ //List of EditPart
+ //DependencyNameEditPart
+ //AppliedStereotypeDependencyEditPart
+ //AppliedStereotypeEmptyEditPart --> should be removed
+ assertEquals(STEREOTYPEDLINK + " has not the right number of children", 2, stereotypedLinkEditPart.getChildren().size()); //$NON-NLS-1$
+ for(Object ee : stereotypedLinkEditPart.getChildren()){
+ EditPart a = (EditPart)ee;
+ if(a instanceof AppliedStereotypeEmptyEditPart){
+ assertTrue(STEREOTYPEDLINK+" still refer to a AppliedStereotypeEmptyEditPart comment", false); //$NON-NLS-1$
+ }
+ }
+ }
+
+
+}

Back to the top