Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGabriel Pascual2015-02-02 04:15:55 -0500
committerRemi Schnekenburger2015-02-10 12:41:37 -0500
commitbcf3c737a2f35f9e97b6d6c70be4faefe7fbf96f (patch)
tree9bdaa632c0a139a6abbe9d4b13aba75fc40347ab
parentf149e947069464e83123d907481cad2a52a319af (diff)
downloadorg.eclipse.papyrus-bcf3c737a2f35f9e97b6d6c70be4faefe7fbf96f.tar.gz
org.eclipse.papyrus-bcf3c737a2f35f9e97b6d6c70be4faefe7fbf96f.tar.xz
org.eclipse.papyrus-bcf3c737a2f35f9e97b6d6c70be4faefe7fbf96f.zip
438511: Copy/paste should copy property values for applied stereotype
https://bugs.eclipse.org/bugs/show_bug.cgi?id=438511 - Fix the command for duplication of applied stereotype to get legacy properties values - Fix associated unit test Change-Id: I0d156d1a8be356749e07ddb83cb0f89f6181db92 Signed-off-by: Gabriel Pascual <gabriel.pascual@all4tec.net> (cherry picked from commit 83739b65fbf2b4758cd328b0142acaa439e1c6c0)
-rw-r--r--plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java19
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.notation42
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.uml13
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.di (renamed from tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.di)0
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.notation45
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.uml20
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.di2
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.notation80
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.uml112
-rw-r--r--tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/StereotypeCopyPasteModelExplorerTest.java100
10 files changed, 311 insertions, 122 deletions
diff --git a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java
index cf413c1c481..307dcb58b36 100644
--- a/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java
+++ b/plugins/uml/tools/org.eclipse.papyrus.uml.tools/src/org/eclipse/papyrus/uml/tools/commands/DuplicateStereotypeCommand.java
@@ -8,6 +8,7 @@
*
* Contributors:
* Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Gaabriel Pascual (ALL4TEC) gabriel.pascual@all4tec.net - bug 438511
*****************************************************************************/
package org.eclipse.papyrus.uml.tools.commands;
@@ -28,7 +29,7 @@ import org.eclipse.uml2.uml.util.UMLUtil;
* @author Benoit Maggi
*/
public class DuplicateStereotypeCommand extends RecordingCommand {
-
+
protected Element element;
protected EObject stereotypeApplication;
@@ -40,9 +41,9 @@ public class DuplicateStereotypeCommand extends RecordingCommand {
* Constructor.
*
* @param element
- * The UML Element on which the stereotype will be applied
+ * The UML Element on which the stereotype will be applied
* @param stereotype
- * The stereotypes to apply
+ * The stereotypes to apply
*/
public DuplicateStereotypeCommand(TransactionalEditingDomain domain, Element element, EObject stereotypeApplication) {
super(domain);
@@ -51,21 +52,21 @@ public class DuplicateStereotypeCommand extends RecordingCommand {
// reload the stereotype in the new Context-ResourceSet (Required because in org.eclipse.uml2.uml.internal.operations.PackageOperations
// L960 in getProfileApplication the test is using == instead of equals)
Stereotype stereotype = UMLUtil.getStereotype(stereotypeApplication);
- Stereotype stereotypeInTargetContext = EMFHelper.reloadIntoContext(stereotype, element);
+ Stereotype stereotypeInTargetContext = EMFHelper.reloadIntoContext(stereotype, element);
this.stereotypeInTargetContext = stereotypeInTargetContext;
}
public Stereotype getStereotypeInTargetContext() {
return stereotypeInTargetContext;
- }
-
+ }
+
@Override
protected void doExecute() {
EObject applyStereotype = element.applyStereotype(stereotypeInTargetContext);
- EList<EStructuralFeature> eStructuralFeatures = applyStereotype.eClass().getEStructuralFeatures();
- for(EStructuralFeature eStructuralFeature : eStructuralFeatures) {
+ EList<EStructuralFeature> eStructuralFeatures = applyStereotype.eClass().getEAllStructuralFeatures();
+ for (EStructuralFeature eStructuralFeature : eStructuralFeatures) {
String name = eStructuralFeature.getName();
- if(!name.startsWith(Extension.METACLASS_ROLE_PREFIX) && eStructuralFeature.isChangeable()) {
+ if (!name.startsWith(Extension.METACLASS_ROLE_PREFIX) && eStructuralFeature.isChangeable()) {
applyStereotype.eSet(eStructuralFeature, stereotypeApplication.eGet(eStructuralFeature));
}
}
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.notation b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.notation
deleted file mode 100644
index ded42180fb6..00000000000
--- a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.notation
+++ /dev/null
@@ -1,42 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
- <notation:Diagram xmi:id="_CcJ10AHyEeSRtoqJfclOXQ" type="PapyrusUMLClassDiagram" name="NewDiagram" measurementUnit="Pixel">
- <children xmi:type="notation:Shape" xmi:id="_C07iMAHyEeSRtoqJfclOXQ" type="2008">
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_HcNPUAHyEeSRtoqJfclOXQ" source="Stereotype_Annotation">
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HxUqEAH6EeSdD4OLwBjBKA" key="StereotypeWithQualifiedNameList" value=""/>
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HxUqEQH6EeSdD4OLwBjBKA" key="StereotypeList" value="SysML::Requirements::Requirement"/>
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HxUqEgH6EeSdD4OLwBjBKA" key="PropStereoDisplay" value="SysML::Requirements::Requirement.text,SysML::Requirements::Requirement.id"/>
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HxVRIAH6EeSdD4OLwBjBKA" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HxVRIQH6EeSdD4OLwBjBKA" key="StereotypePropertyLocation" value="Compartment"/>
- </eAnnotations>
- <children xmi:type="notation:DecorationNode" xmi:id="_C08JQAHyEeSRtoqJfclOXQ" type="5029"/>
- <children xmi:type="notation:BasicCompartment" xmi:id="_C08JQQHyEeSRtoqJfclOXQ" type="7017">
- <styles xmi:type="notation:TitleStyle" xmi:id="_C08JQgHyEeSRtoqJfclOXQ"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="_C08JQwHyEeSRtoqJfclOXQ"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="_C08JRAHyEeSRtoqJfclOXQ"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_C08JRQHyEeSRtoqJfclOXQ"/>
- </children>
- <children xmi:type="notation:BasicCompartment" xmi:id="_C08JRgHyEeSRtoqJfclOXQ" type="7018">
- <styles xmi:type="notation:TitleStyle" xmi:id="_C08JRwHyEeSRtoqJfclOXQ"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="_C08JSAHyEeSRtoqJfclOXQ"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="_C08JSQHyEeSRtoqJfclOXQ"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_C08JSgHyEeSRtoqJfclOXQ"/>
- </children>
- <children xmi:type="notation:BasicCompartment" xmi:id="_C08JSwHyEeSRtoqJfclOXQ" type="7019">
- <styles xmi:type="notation:TitleStyle" xmi:id="_C08JTAHyEeSRtoqJfclOXQ"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="_C08JTQHyEeSRtoqJfclOXQ"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="_C08JTgHyEeSRtoqJfclOXQ"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_C08JTwHyEeSRtoqJfclOXQ"/>
- </children>
- <element xmi:type="uml:Class" href="modelWithStereotype.uml#_C067IAHyEeSRtoqJfclOXQ"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_C07iMQHyEeSRtoqJfclOXQ" x="294" y="51"/>
- </children>
- <styles xmi:type="notation:StringValueStyle" xmi:id="_CcJ10QHyEeSRtoqJfclOXQ" name="diagram_compatibility_version" stringValue="1.0.0"/>
- <styles xmi:type="notation:DiagramStyle" xmi:id="_CcJ10gHyEeSRtoqJfclOXQ"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_CcJ10wHyEeSRtoqJfclOXQ">
- <owner xmi:type="uml:Model" href="modelWithStereotype.uml#_CcJOwAHyEeSRtoqJfclOXQ"/>
- </styles>
- <element xmi:type="uml:Model" href="modelWithStereotype.uml#_CcJOwAHyEeSRtoqJfclOXQ"/>
- </notation:Diagram>
- <css:ModelStyleSheets xmi:id="_H5cEQAH6EeSdD4OLwBjBKA"/>
-</xmi:XMI>
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.uml b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.uml
deleted file mode 100644
index 6a03393ba70..00000000000
--- a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.uml
+++ /dev/null
@@ -1,13 +0,0 @@
-<?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:Requirements="http://www.eclipse.org/papyrus/0.7.0/SysML/Requirements" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/papyrus/0.7.0/SysML/Requirements http://www.eclipse.org/papyrus/0.7.0/SysML#//requirements">
- <uml:Model xmi:id="_CcJOwAHyEeSRtoqJfclOXQ" name="model">
- <packagedElement xmi:type="uml:Class" xmi:id="_C067IAHyEeSRtoqJfclOXQ" name="Class1"/>
- <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_QHe5MAH5EeSdD4OLwBjBKA">
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_QICS0AH5EeSdD4OLwBjBKA" source="http://www.eclipse.org/uml2/2.0.0/UML">
- <references xmi:type="ecore:EPackage" href="http://www.eclipse.org/papyrus/0.7.0/SysML#//requirements"/>
- </eAnnotations>
- <appliedProfile xmi:type="uml:Profile" href="pathmap://SysML_PROFILES/SysML.profile.uml#_OOJC4LX8EduFmqQsrNB9lw"/>
- </profileApplication>
- </uml:Model>
- <Requirements:Requirement xmi:id="_Qz1o4AH5EeSdD4OLwBjBKA" text="description" id="1" base_Class="_C067IAHyEeSRtoqJfclOXQ"/>
-</xmi:XMI>
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.di b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.di
index bf9abab340f..bf9abab340f 100644
--- a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/modelWithStereotype.di
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.di
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.notation b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.notation
new file mode 100644
index 00000000000..d7c490b887d
--- /dev/null
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.notation
@@ -0,0 +1,45 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <notation:Diagram xmi:id="_Cl-EEKqyEeSuF9HUlMCIQw" type="PapyrusUMLClassDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_DsEJcKqyEeSuF9HUlMCIQw" type="2008">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_KcSgEKqyEeSuF9HUlMCIQw" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gD-kwKqzEeSuF9HUlMCIQw" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gD-kwaqzEeSuF9HUlMCIQw" key="StereotypeList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gD-kwqqzEeSuF9HUlMCIQw" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gD-kw6qzEeSuF9HUlMCIQw" key="PropStereoDisplay" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gD-kxKqzEeSuF9HUlMCIQw" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_DsKQEKqyEeSuF9HUlMCIQw" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_DsKQEaqyEeSuF9HUlMCIQw" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_DsKQEqqyEeSuF9HUlMCIQw" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_DsKQE6qyEeSuF9HUlMCIQw" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_DsKQFKqyEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_DsKQFaqyEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_DsKQFqqyEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DsKQF6qyEeSuF9HUlMCIQw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_DsKQGKqyEeSuF9HUlMCIQw" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_DsKQGaqyEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_DsKQGqqyEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_DsKQG6qyEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DsKQHKqyEeSuF9HUlMCIQw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_DsKQHaqyEeSuF9HUlMCIQw" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_DsKQHqqyEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_DsKQH6qyEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_DsKQIKqyEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DsKQIaqyEeSuF9HUlMCIQw"/>
+ </children>
+ <element xmi:type="uml:Class" href="ProfileApplication.uml#_Dr38MKqyEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DsEJcaqyEeSuF9HUlMCIQw" x="211" y="161" width="195" height="119"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_Cl-EEaqyEeSuF9HUlMCIQw" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_Cl-EEqqyEeSuF9HUlMCIQw"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_Cl-EE6qyEeSuF9HUlMCIQw">
+ <owner xmi:type="uml:Model" href="ProfileApplication.uml#_Cl39cKqyEeSuF9HUlMCIQw"/>
+ </styles>
+ <element xmi:type="uml:Model" href="ProfileApplication.uml#_Cl39cKqyEeSuF9HUlMCIQw"/>
+ </notation:Diagram>
+ <css:ModelStyleSheets xmi:id="_DOmKUKqyEeSuF9HUlMCIQw"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.uml b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.uml
new file mode 100644
index 00000000000..f20f1d5a11c
--- /dev/null
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileApplication.uml
@@ -0,0 +1,20 @@
+<?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:profile="http:///schemas/profile/_HkkPkKqzEeSuF9HUlMCIQw/2" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xsi:schemaLocation="http:///schemas/profile/_HkkPkKqzEeSuF9HUlMCIQw/2 ProfileWithStrereotype.profile.uml#_HkkPkaqzEeSuF9HUlMCIQw">
+ <uml:Model xmi:id="_Cl39cKqyEeSuF9HUlMCIQw" name="model">
+ <packagedElement xmi:type="uml:Class" xmi:id="_Dr38MKqyEeSuF9HUlMCIQw" name="theFirst"/>
+ <profileApplication xmi:type="uml:ProfileApplication" xmi:id="_JL-HsKqyEeSuF9HUlMCIQw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_gWScwKqzEeSuF9HUlMCIQw" source="PapyrusVersion">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gWScwaqzEeSuF9HUlMCIQw" key="Version" value="0.0.3"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gWScwqqzEeSuF9HUlMCIQw" key="Comment" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gWScw6qzEeSuF9HUlMCIQw" key="Copyright" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gWScxKqzEeSuF9HUlMCIQw" key="Date" value="2015-02-02"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_gWScxaqzEeSuF9HUlMCIQw" key="Author" value=""/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_JNg_0KqyEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <references xmi:type="ecore:EPackage" href="ProfileWithStrereotype.profile.uml#_HkkPkaqzEeSuF9HUlMCIQw"/>
+ </eAnnotations>
+ <appliedProfile xmi:type="uml:Profile" href="ProfileWithStrereotype.profile.uml#_NgFdsKqxEeSuF9HUlMCIQw"/>
+ </profileApplication>
+ </uml:Model>
+ <profile:First xmi:id="_KcMZcKqyEeSuF9HUlMCIQw" base_Class="_Dr38MKqyEeSuF9HUlMCIQw" parentProperty="child" childProperty="2.3"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.di b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.notation b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.notation
new file mode 100644
index 00000000000..cf9f4d269da
--- /dev/null
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.notation
@@ -0,0 +1,80 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NikJ8KqxEeSuF9HUlMCIQw" type="PapyrusUMLProfileDiagram" name="FirstOfAll" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_fwzcAKqxEeSuF9HUlMCIQw" type="1026">
+ <children xmi:type="notation:DecorationNode" xmi:id="_fxqXoKqxEeSuF9HUlMCIQw" type="1034"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_fxweQKqxEeSuF9HUlMCIQw" type="1071">
+ <children xmi:type="notation:Shape" xmi:id="_33ehEaqxEeSuF9HUlMCIQw" type="3002">
+ <element xmi:type="uml:Property" href="ProfileWithStrereotype.profile.uml#_33ehEKqxEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_33ehEqqxEeSuF9HUlMCIQw"/>
+ </children>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_fxweQaqxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_fxweQqqxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_fxweQ6qxEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fxweRKqxEeSuF9HUlMCIQw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_fxweRaqxEeSuF9HUlMCIQw" type="1019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_fxweRqqxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_fxweR6qxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_fxweSKqxEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fxweSaqxEeSuF9HUlMCIQw"/>
+ </children>
+ <element xmi:type="uml:Stereotype" href="ProfileWithStrereotype.profile.uml#_fwItoKqxEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_fwzcAaqxEeSuF9HUlMCIQw" x="353" y="316" width="190" height="111"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_oIxMgaqxEeSuF9HUlMCIQw" type="1026">
+ <children xmi:type="notation:DecorationNode" xmi:id="_oI3TIKqxEeSuF9HUlMCIQw" type="1034"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_oI3TIaqxEeSuF9HUlMCIQw" type="1071">
+ <children xmi:type="notation:Shape" xmi:id="_wA-e4KqxEeSuF9HUlMCIQw" type="3002">
+ <element xmi:type="uml:Property" href="ProfileWithStrereotype.profile.uml#_wATwgKqxEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_wA-e4aqxEeSuF9HUlMCIQw"/>
+ </children>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_oI3TIqqxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_oI3TI6qxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_oI3TJKqxEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_oI3TJaqxEeSuF9HUlMCIQw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_oI3TJqqxEeSuF9HUlMCIQw" type="1019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_oI3TJ6qxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_oI3TKKqxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_oI3TKaqxEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_oI3TKqqxEeSuF9HUlMCIQw"/>
+ </children>
+ <element xmi:type="uml:Stereotype" href="ProfileWithStrereotype.profile.uml#_oIxMgKqxEeSuF9HUlMCIQw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_oIxMgqqxEeSuF9HUlMCIQw" x="364" y="103" width="194" height="112"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_ttNsgKqxEeSuF9HUlMCIQw" type="1031">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ttNshKqxEeSuF9HUlMCIQw" source="Stereotype_Annotation">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ttNshaqxEeSuF9HUlMCIQw" key="StereotypeWithQualifiedNameList" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ttNshqqxEeSuF9HUlMCIQw" key="StereotypeList" value="StandardProfile::Metaclass"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ttNsh6qxEeSuF9HUlMCIQw" key="Stereotype_Presentation_Kind" value="HorizontalStereo"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ttNsiKqxEeSuF9HUlMCIQw" key="PropStereoDisplay" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ttNsiaqxEeSuF9HUlMCIQw" key="StereotypePropertyLocation" value="Compartment"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_ttNsgqqxEeSuF9HUlMCIQw" type="1084"/>
+ <element xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ttNsg6qxEeSuF9HUlMCIQw" x="414" y="17"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_NikJ8aqxEeSuF9HUlMCIQw" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_NikJ8qqxEeSuF9HUlMCIQw"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_NikJ86qxEeSuF9HUlMCIQw">
+ <owner xmi:type="uml:Profile" href="ProfileWithStrereotype.profile.uml#_NgFdsKqxEeSuF9HUlMCIQw"/>
+ </styles>
+ <element xmi:type="uml:Profile" href="ProfileWithStrereotype.profile.uml#_NgFdsKqxEeSuF9HUlMCIQw"/>
+ <edges xmi:type="notation:Connector" xmi:id="_p6KRoKqxEeSuF9HUlMCIQw" type="4002" source="_fwzcAKqxEeSuF9HUlMCIQw" target="_oIxMgaqxEeSuF9HUlMCIQw">
+ <children xmi:type="notation:DecorationNode" xmi:id="_p6KRo6qxEeSuF9HUlMCIQw" type="6007">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_p6KRpKqxEeSuF9HUlMCIQw" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_p6KRoaqxEeSuF9HUlMCIQw"/>
+ <element xmi:type="uml:Generalization" href="ProfileWithStrereotype.profile.uml#_p6ELAKqxEeSuF9HUlMCIQw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_p6KRoqqxEeSuF9HUlMCIQw" points="[37, -55, -82, 119]$[113, -163, -6, 11]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_qLU6IKqxEeSuF9HUlMCIQw" id="(0.5105263157894737,0.018018018018018018)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_p6We4KqxEeSuF9HUlMCIQw" id="(0.4381443298969072,0.9910714285714286)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_uatEoKqxEeSuF9HUlMCIQw" type="1013" source="_oIxMgaqxEeSuF9HUlMCIQw" target="_ttNsgKqxEeSuF9HUlMCIQw">
+ <styles xmi:type="notation:FontStyle" xmi:id="_uatEoaqxEeSuF9HUlMCIQw"/>
+ <element xmi:type="uml:Extension" href="ProfileWithStrereotype.profile.uml#_uam-AaqxEeSuF9HUlMCIQw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_uatEoqqxEeSuF9HUlMCIQw" points="[97, -25, -217, 53]$[302, -66, -12, 12]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2LWhAKqyEeSuF9HUlMCIQw" id="(0.4536082474226804,0.0)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ua5R4KqxEeSuF9HUlMCIQw" id="(0.38,1.0)"/>
+ </edges>
+</notation:Diagram>
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.uml b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.uml
new file mode 100644
index 00000000000..b3cfffff13b
--- /dev/null
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/resources/stereotypeCopyPasteMETest/ProfileWithStrereotype.profile.uml
@@ -0,0 +1,112 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Profile xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NgFdsKqxEeSuF9HUlMCIQw" name="profile" metaclassReference="_ttBfQKqxEeSuF9HUlMCIQw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_8P4EsKqxEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML">
+ <contents xmi:type="ecore:EPackage" xmi:id="_HkkPkaqzEeSuF9HUlMCIQw" name="profile" nsURI="http:///schemas/profile/_HkkPkKqzEeSuF9HUlMCIQw/2" nsPrefix="profile">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_HkkPkqqzEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/4.1.0/UML" references="_ApiMkaqyEeSuF9HUlMCIQw"/>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_HkkPoKqzEeSuF9HUlMCIQw" source="PapyrusVersion">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HkkPoaqzEeSuF9HUlMCIQw" key="Version" value="0.0.3"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HkkPoqqzEeSuF9HUlMCIQw" key="Comment" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HkkPo6qzEeSuF9HUlMCIQw" key="Copyright" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HkkPpKqzEeSuF9HUlMCIQw" key="Date" value="2015-02-02"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_HkkPpaqzEeSuF9HUlMCIQw" key="Author" value=""/>
+ </eAnnotations>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_HkkPk6qzEeSuF9HUlMCIQw" name="First" eSuperTypes="_HkkPmKqzEeSuF9HUlMCIQw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_HkkPlKqzEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_fwItoKqxEeSuF9HUlMCIQw"/>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_HkkPlaqzEeSuF9HUlMCIQw" name="childProperty" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Real"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_HkkPmKqzEeSuF9HUlMCIQw" name="Parent">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_HkkPmaqzEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_oIxMgKqxEeSuF9HUlMCIQw"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_HkkPmqqzEeSuF9HUlMCIQw" name="base_Class" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_HkkPnKqzEeSuF9HUlMCIQw" name="parentProperty" ordered="false" lowerBound="1" defaultValueLiteral="parent">
+ <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ </contents>
+ <contents xmi:type="ecore:EPackage" xmi:id="_ApiMkaqyEeSuF9HUlMCIQw" name="profile" nsURI="http:///schemas/profile/_ApiMkKqyEeSuF9HUlMCIQw/1" nsPrefix="profile">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ApiMkqqyEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/4.1.0/UML" references="_8P4EsaqxEeSuF9HUlMCIQw"/>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ApiMpqqyEeSuF9HUlMCIQw" source="PapyrusVersion">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ApiMp6qyEeSuF9HUlMCIQw" key="Version" value="0.0.2"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ApiMqKqyEeSuF9HUlMCIQw" key="Comment" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ApiMqaqyEeSuF9HUlMCIQw" key="Copyright" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ApiMqqqyEeSuF9HUlMCIQw" key="Date" value="2015-02-02"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_ApiMq6qyEeSuF9HUlMCIQw" key="Author" value=""/>
+ </eAnnotations>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_ApiMk6qyEeSuF9HUlMCIQw" name="Homme" eSuperTypes="_ApiMnaqyEeSuF9HUlMCIQw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ApiMlKqyEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_fwItoKqxEeSuF9HUlMCIQw"/>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_ApiMlaqyEeSuF9HUlMCIQw" name="ton" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Real"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_ApiMmKqyEeSuF9HUlMCIQw" name="Femme" eSuperTypes="_ApiMnaqyEeSuF9HUlMCIQw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ApiMmaqyEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML"/>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_ApiMmqqyEeSuF9HUlMCIQw" name="heart" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Real"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_ApiMnaqyEeSuF9HUlMCIQw" name="Human">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_ApiMnqqyEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_oIxMgKqxEeSuF9HUlMCIQw"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_ApiMn6qyEeSuF9HUlMCIQw" name="base_Class" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_ApiMoaqyEeSuF9HUlMCIQw" name="name" ordered="false" lowerBound="1" defaultValueLiteral="Femme">
+ <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ </contents>
+ <contents xmi:type="ecore:EPackage" xmi:id="_8P4EsaqxEeSuF9HUlMCIQw" name="profile" nsURI="http:///schemas/profile/_8Px-EKqxEeSuF9HUlMCIQw/0" nsPrefix="profile">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_8P4ExKqxEeSuF9HUlMCIQw" source="PapyrusVersion">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8P4ExaqxEeSuF9HUlMCIQw" key="Version" value="0.0.1"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8P4ExqqxEeSuF9HUlMCIQw" key="Comment" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8P4Ex6qxEeSuF9HUlMCIQw" key="Copyright" value=""/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8P4EyKqxEeSuF9HUlMCIQw" key="Date" value="2015-02-02"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_8P4EyaqxEeSuF9HUlMCIQw" key="Author" value=""/>
+ </eAnnotations>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_8P4EsqqxEeSuF9HUlMCIQw" name="Homme" eSuperTypes="_8P4Et6qxEeSuF9HUlMCIQw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_8P4Es6qxEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_fwItoKqxEeSuF9HUlMCIQw"/>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_8P4EtKqxEeSuF9HUlMCIQw" name="ton" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//Real"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_8P4Et6qxEeSuF9HUlMCIQw" name="Human">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_8P4EuKqxEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML" references="_oIxMgKqxEeSuF9HUlMCIQw"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_8P4EuaqxEeSuF9HUlMCIQw" name="base_Class" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/uml2/5.0.0/UML#//Class"/>
+ </eStructuralFeatures>
+ <eStructuralFeatures xmi:type="ecore:EAttribute" xmi:id="_8P4Eu6qxEeSuF9HUlMCIQw" name="name" ordered="false" lowerBound="1" defaultValueLiteral="Femme">
+ <eType xmi:type="ecore:EDataType" href="http://www.eclipse.org/uml2/5.0.0/Types#//String"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ <eClassifiers xmi:type="ecore:EClass" xmi:id="_8P4EvaqxEeSuF9HUlMCIQw" name="Femme" eSuperTypes="_8P4Et6qxEeSuF9HUlMCIQw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_8P4EvqqxEeSuF9HUlMCIQw" source="http://www.eclipse.org/uml2/2.0.0/UML"/>
+ <eStructuralFeatures xmi:type="ecore:EReference" xmi:id="_8P4Ev6qxEeSuF9HUlMCIQw" name="Attribute1" ordered="false" lowerBound="1">
+ <eType xmi:type="ecore:EClass" href="http://www.eclipse.org/emf/2002/Ecore#//EObject"/>
+ </eStructuralFeatures>
+ </eClassifiers>
+ </contents>
+ </eAnnotations>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_ttBfQKqxEeSuF9HUlMCIQw" alias="Class">
+ <importedElement xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </elementImport>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_fwItoKqxEeSuF9HUlMCIQw" name="First">
+ <generalization xmi:type="uml:Generalization" xmi:id="_p6ELAKqxEeSuF9HUlMCIQw" general="_oIxMgKqxEeSuF9HUlMCIQw"/>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_33ehEKqxEeSuF9HUlMCIQw" name="childProperty">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Real"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Stereotype" xmi:id="_oIxMgKqxEeSuF9HUlMCIQw" name="Parent">
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_uam-AKqxEeSuF9HUlMCIQw" name="base_Class" association="_uam-AaqxEeSuF9HUlMCIQw">
+ <type xmi:type="uml:Class" href="pathmap://UML_METAMODELS/UML.metamodel.uml#Class"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_wATwgKqxEeSuF9HUlMCIQw" name="parentProperty">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
+ <defaultValue xmi:type="uml:LiteralString" xmi:id="_2Bgd8KqxEeSuF9HUlMCIQw" value="parent"/>
+ </ownedAttribute>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Extension" xmi:id="_uam-AaqxEeSuF9HUlMCIQw" name="E_Parent_Class1" memberEnd="_uam-AqqxEeSuF9HUlMCIQw _uam-AKqxEeSuF9HUlMCIQw">
+ <ownedEnd xmi:type="uml:ExtensionEnd" xmi:id="_uam-AqqxEeSuF9HUlMCIQw" name="extension_Parent" type="_oIxMgKqxEeSuF9HUlMCIQw" aggregation="composite" association="_uam-AaqxEeSuF9HUlMCIQw"/>
+ </packagedElement>
+</uml:Profile>
diff --git a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/StereotypeCopyPasteModelExplorerTest.java b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/StereotypeCopyPasteModelExplorerTest.java
index d6ca19c8f1c..859d64e4bd2 100644
--- a/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/StereotypeCopyPasteModelExplorerTest.java
+++ b/tests/junit/plugins/uml/modelexplorer/org.eclipse.papyrus.uml.modelexplorer.tests/src/org/eclipse/papyrus/uml/modelexplorer/tests/paste/StereotypeCopyPasteModelExplorerTest.java
@@ -9,6 +9,7 @@
*
* Contributors:
* Benoit Maggi (CEA LIST) benoit.maggi@cea.fr - Initial API and implementation
+ * Gabriel Pascual (ALL4TEC gabriel.pascual@all4tec.net - bug 438511
*
*****************************************************************************/
package org.eclipse.papyrus.uml.modelexplorer.tests.paste;
@@ -20,68 +21,50 @@ import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.IHandler;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.jface.viewers.IStructuredSelection;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
import org.eclipse.papyrus.junit.utils.HandlerUtils;
-import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest;
-import org.eclipse.papyrus.uml.modelexplorer.tests.Activator;
+import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
import org.eclipse.papyrus.uml.tools.utils.NamedElementUtil;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
import org.eclipse.ui.ISelectionService;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;
import org.eclipse.uml2.uml.Model;
import org.eclipse.uml2.uml.Stereotype;
import org.junit.Assert;
-import org.junit.Before;
+import org.junit.Rule;
import org.junit.Test;
/**
- * Sample test for cut in model explorer
+ * Test for copy/past of stereotype in model explorer.
*
- * @author bmaggi
+ * @author Benoit Maggi
*/
-public class StereotypeCopyPasteModelExplorerTest extends AbstractEditorTest {
+@PluginResource("resources/stereotypeCopyPasteMETest/ProfileApplication.di")
+public class StereotypeCopyPasteModelExplorerTest extends AbstractPapyrusTest {
public static final String COPY_COMMAND_ID = "org.eclipse.ui.edit.copy"; //$NON-NLS-1$
public static final String PASTE_COMMAND_ID = "org.eclipse.ui.edit.paste"; //$NON-NLS-1$
- public static final String RESOURCES_PATH = "resources/"; //$NON-NLS-1$
+ public final static String STEREOTYPED_ELEMENT_NAME = "theFirst"; //$NON-NLS-1$
- public static final String MODEL_NAME = "modelWithStereotype"; //$NON-NLS-1$
+ @Rule
+ public final PapyrusEditorFixture editorFixture = new PapyrusEditorFixture();
- public static final String PROJECT_NAME = "modelWithStereotype"; //$NON-NLS-1$
+ // information on the stereotype
+ public final static String STEREOTYPE_QN = "profile::First"; //$NON-NLS-1$
- public final static String CLASS1_NAME = "Class1"; //$NON-NLS-1$
+ public final static String PARENT_STEREOTYPE_PROPERTY = "parentProperty"; //$NON-NLS-1$
- // information on the stereotype
- public final static String REQUIREMENT = "SysML::Requirements::Requirement"; //$NON-NLS-1$
-
- public final static String REQUIREMENT_TEXT = "text"; //$NON-NLS-1$
-
- public final static String REQUIREMENT_TEXT_VALUE = "description"; //$NON-NLS-1$
-
- public final static String REQUIREMENT_ID = "id"; //$NON-NLS-1$
-
- public final static String REQUIREMENT_ID_VALUE = "1"; //$NON-NLS-1$
-
-
-
- @Before
- public void initModelForCopyPasteTest() {
- try {
- initModel(PROJECT_NAME, MODEL_NAME, Activator.getDefault().getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
- } catch (Exception e) {
- Assert.fail(e.getMessage());
- }
- }
+ public final static String PARENT_STEREOTYPE_PROPERTY_VALUE = "child"; //$NON-NLS-1$
- @Override
- protected String getSourcePath() {
- return RESOURCES_PATH;
- }
+ public final static String STEREOTYPE_PROPERTY = "childProperty"; //$NON-NLS-1$
+
+ public final static Double STEREOTYPE_PROPERTY_VALUE = 2.3; //$NON-NLS-1$
-
-
/**
* Simple copy paste of a class1 with <<requirememt>> stereotype
*
@@ -89,35 +72,34 @@ public class StereotypeCopyPasteModelExplorerTest extends AbstractEditorTest {
*/
@Test
public void copyPasteofClass1Test() throws Exception {
- //get the rootModel
- Assert.assertNotNull("RootModel is null", getRootUMLModel()); //$NON-NLS-1$
- //get all semantic element that will handled
- Model model = (Model)getRootUMLModel();
+ // get the rootModel
+ Assert.assertNotNull("RootModel is null", editorFixture.getModel()); //$NON-NLS-1$
+ // get all semantic element that will handled
+ Model model = (Model) editorFixture.getModel();
IWorkbenchWindow activeWorkbenchWindow = PlatformUI.getWorkbench().getActiveWorkbenchWindow();
ISelectionService selectionService = activeWorkbenchWindow.getSelectionService();
- modelExplorerView = getModelExplorerView();
+ ModelExplorerView modelExplorerView = editorFixture.getModelExplorerView();
modelExplorerView.setFocus();
List<Object> elements = new ArrayList<Object>();
- elements.add(getRootUMLModel());
+ elements.add(model);
modelExplorerView.revealSemanticElement(elements);
- org.eclipse.uml2.uml.Class class1 = (org.eclipse.uml2.uml.Class)model.getPackagedElement(CLASS1_NAME);
-
+ org.eclipse.uml2.uml.Class class1 = (org.eclipse.uml2.uml.Class) model.getPackagedElement(STEREOTYPED_ELEMENT_NAME);
+
elements.clear();
elements.add(class1);
modelExplorerView.revealSemanticElement(elements);
- Object class1TreeObject = ((IStructuredSelection)selectionService.getSelection()).getFirstElement();
+ Object class1TreeObject = ((IStructuredSelection) selectionService.getSelection()).getFirstElement();
Assert.assertNotNull("Class1 TreeElement is null", class1TreeObject); //$NON-NLS-1$
IHandler copyHandler = HandlerUtils.getActiveHandlerFor(COPY_COMMAND_ID);
Assert.assertTrue("Copy not available", copyHandler.isEnabled()); //$NON-NLS-1$
copyHandler.execute(new ExecutionEvent());
- // select root
-
+ // select roo
elements.clear();
- elements.add(getRootUMLModel());
+ elements.add(model);
modelExplorerView.revealSemanticElement(elements);
// paste
@@ -125,17 +107,19 @@ public class StereotypeCopyPasteModelExplorerTest extends AbstractEditorTest {
Assert.assertTrue("Paste not available", pasteHandler.isEnabled()); //$NON-NLS-1$
pasteHandler.execute(new ExecutionEvent());
- // check that there is a Class1
- org.eclipse.uml2.uml.Class copyOfClass1 = (org.eclipse.uml2.uml.Class)model.getPackagedElement(NamedElementUtil.COPY_OF + "_" + CLASS1_NAME + "_1");
- Assert.assertNotNull("The copy is missing", copyOfClass1); //$NON-NLS-1$
-
- Stereotype stereotype = copyOfClass1.getAppliedStereotype(REQUIREMENT);
- EObject stereotypeApplication = copyOfClass1.getStereotypeApplication(stereotype);
- Assert.assertEquals("Wrong copied id", stereotypeApplication.eGet(stereotypeApplication.eClass().getEStructuralFeature(REQUIREMENT_ID)), REQUIREMENT_ID_VALUE);
- Assert.assertEquals("Wrong copied text", stereotypeApplication.eGet(stereotypeApplication.eClass().getEStructuralFeature(REQUIREMENT_TEXT)), REQUIREMENT_TEXT_VALUE);
-
+ // check that there is a Class1
+ org.eclipse.uml2.uml.Class copyOfElement = (org.eclipse.uml2.uml.Class) model.getPackagedElement(NamedElementUtil.COPY_OF + "_" + STEREOTYPED_ELEMENT_NAME + "_1");
+ Assert.assertNotNull("The copy is missing", copyOfElement); //$NON-NLS-1$
+
+ Stereotype stereotype = copyOfElement.getAppliedStereotype(STEREOTYPE_QN);
+ EObject stereotypeApplication = copyOfElement.getStereotypeApplication(stereotype);
+ Assert.assertEquals("Wrong copied property " + STEREOTYPE_PROPERTY, stereotypeApplication.eGet(stereotypeApplication.eClass().getEStructuralFeature(STEREOTYPE_PROPERTY)), STEREOTYPE_PROPERTY_VALUE);
+ Assert.assertEquals("Wrong copied property " + PARENT_STEREOTYPE_PROPERTY, stereotypeApplication.eGet(stereotypeApplication.eClass().getEStructuralFeature(PARENT_STEREOTYPE_PROPERTY)), PARENT_STEREOTYPE_PROPERTY_VALUE);
+
}
+
+
}

Back to the top