aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCamille Letavernier2018-06-25 09:34:35 -0400
committerNicolas FAUVERGUE2018-07-06 04:11:08 -0400
commitf0522b22ea76aafaeaac206765fd9e51a4a499d3 (patch)
tree46d8e74f2dd1eec7451a9ded9ea445e25e792372
parentab2727e4253b6bb8f4dbb9303ff62c882ee28b17 (diff)
downloadorg.eclipse.papyrus-f0522b22ea76aafaeaac206765fd9e51a4a499d3.zip
org.eclipse.papyrus-f0522b22ea76aafaeaac206765fd9e51a4a499d3.tar.gz
org.eclipse.papyrus-f0522b22ea76aafaeaac206765fd9e51a4a499d3.tar.xz
Bug 533697: [Sequence Diagram] InteractionOperand shall be reordered
pressing a combination key in the CombinedFragment https://bugs.eclipse.org/bugs/show_bug.cgi?id=533697 - Add tests Change-Id: I30f669606a2af8b6d3b6464a363ecfee6581c8c7 Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.di2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.notation203
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.uml53
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/AbstractOperandsTest.java165
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/BugTests.java1
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsReorder.java229
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsSemanticCoverage.java142
7 files changed, 654 insertions, 141 deletions
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.di b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.di
new file mode 100644
index 0000000..8c549ee
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<architecture:ArchitectureDescription xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:architecture="http://www.eclipse.org/papyrus/infra/core/architecture" contextId="org.eclipse.papyrus.infra.services.edit.TypeContext"/>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.notation
new file mode 100644
index 0000000..33e24ee
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.notation
@@ -0,0 +1,203 @@
+<?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:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/gmfdiag/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <notation:Diagram xmi:id="_z9tNEHh2EeiJjZHqAYNFLA" type="PapyrusUMLSequenceDiagram" name="Reorder" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_z9tNEXh2EeiJjZHqAYNFLA" type="Interaction_Shape">
+ <children xmi:type="notation:DecorationNode" xmi:id="_z9tNEnh2EeiJjZHqAYNFLA" type="Interaction_NameLabel"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_z9tNE3h2EeiJjZHqAYNFLA" type="Interaction_SubfragmentCompartment">
+ <children xmi:type="notation:Shape" xmi:id="_1xh7IHh2EeiJjZHqAYNFLA" type="CombinedFragment_Shape">
+ <children xmi:type="notation:BasicCompartment" xmi:id="_1xh7Inh2EeiJjZHqAYNFLA" type="CombinedFragment_SubfragmentCompartment">
+ <children xmi:type="notation:Shape" xmi:id="_1xh7Jnh2EeiJjZHqAYNFLA" type="InteractionOperand_Shape">
+ <children xmi:type="notation:DecorationNode" xmi:id="_1xh7KHh2EeiJjZHqAYNFLA" type="InteractionOperand_Guard">
+ <element xmi:type="uml:InteractionConstraint" href="bug533697-reorderOperands.uml#_1xb0gXh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1xh7KXh2EeiJjZHqAYNFLA" x="5" y="5"/>
+ </children>
+ <element xmi:type="uml:InteractionOperand" href="bug533697-reorderOperands.uml#_1xb0gHh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1xh7J3h2EeiJjZHqAYNFLA" width="441" height="59"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_3TjukHh2EeiJjZHqAYNFLA" type="InteractionOperand_Shape">
+ <children xmi:type="notation:DecorationNode" xmi:id="_3Tjuknh2EeiJjZHqAYNFLA" type="InteractionOperand_Guard">
+ <element xmi:type="uml:InteractionConstraint" href="bug533697-reorderOperands.uml#_3TZWgHh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3Tjuk3h2EeiJjZHqAYNFLA" x="5" y="5"/>
+ </children>
+ <element xmi:type="uml:InteractionOperand" href="bug533697-reorderOperands.uml#_3TYIYHh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3TjukXh2EeiJjZHqAYNFLA" y="59" width="441" height="115"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_3eMRQHh2EeiJjZHqAYNFLA" type="InteractionOperand_Shape">
+ <children xmi:type="notation:DecorationNode" xmi:id="_3eM4UXh2EeiJjZHqAYNFLA" type="InteractionOperand_Guard">
+ <element xmi:type="uml:InteractionConstraint" href="bug533697-reorderOperands.uml#_3d_c8Hh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3eM4Unh2EeiJjZHqAYNFLA" x="5" y="5"/>
+ </children>
+ <element xmi:type="uml:InteractionOperand" href="bug533697-reorderOperands.uml#_3d-O0Hh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3eM4UHh2EeiJjZHqAYNFLA" y="174" width="441" height="156"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_3pI9AHh2EeiJjZHqAYNFLA" type="InteractionOperand_Shape">
+ <children xmi:type="notation:DecorationNode" xmi:id="_3pJkEHh2EeiJjZHqAYNFLA" type="InteractionOperand_Guard">
+ <element xmi:type="uml:InteractionConstraint" href="bug533697-reorderOperands.uml#_3o994Hh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3pJkEXh2EeiJjZHqAYNFLA" x="5" y="5"/>
+ </children>
+ <element xmi:type="uml:InteractionOperand" href="bug533697-reorderOperands.uml#_3o9W0Hh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_3pI9AXh2EeiJjZHqAYNFLA" y="330" width="441" height="212"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_1xh7I3h2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_1xh7JHh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1xh7JXh2EeiJjZHqAYNFLA"/>
+ </children>
+ <element xmi:type="uml:CombinedFragment" href="bug533697-reorderOperands.uml#_1xZYQHh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1xh7IXh2EeiJjZHqAYNFLA" x="27" y="58" width="441" height="561"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_w62qoHh3EeiJjZHqAYNFLA" type="CombinedFragment_Shape">
+ <children xmi:type="notation:BasicCompartment" xmi:id="_w63RsHh3EeiJjZHqAYNFLA" type="CombinedFragment_SubfragmentCompartment">
+ <children xmi:type="notation:Shape" xmi:id="_w63RtHh3EeiJjZHqAYNFLA" type="InteractionOperand_Shape">
+ <children xmi:type="notation:DecorationNode" xmi:id="_w63Rtnh3EeiJjZHqAYNFLA" type="InteractionOperand_Guard">
+ <element xmi:type="uml:InteractionConstraint" href="bug533697-reorderOperands.uml#_w6mzAXh3EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_w63Rt3h3EeiJjZHqAYNFLA" x="5" y="5"/>
+ </children>
+ <element xmi:type="uml:InteractionOperand" href="bug533697-reorderOperands.uml#_w6mzAHh3EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_w63RtXh3EeiJjZHqAYNFLA" width="260" height="243"/>
+ </children>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_w63RsXh3EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_w63Rsnh3EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_w63Rs3h3EeiJjZHqAYNFLA"/>
+ </children>
+ <element xmi:type="uml:CombinedFragment" href="bug533697-reorderOperands.uml#_w6lk4Hh3EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_w62qoXh3EeiJjZHqAYNFLA" x="561" y="61" width="260" height="262"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_05nbsHh2EeiJjZHqAYNFLA" type="Lifeline_Shape">
+ <children xmi:type="notation:DecorationNode" xmi:id="_05oCwHh2EeiJjZHqAYNFLA" type="Lifeline_NameLabel"/>
+ <element xmi:type="uml:Lifeline" href="bug533697-reorderOperands.uml#_05anYHh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_05nbsXh2EeiJjZHqAYNFLA" x="74" y="10"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_1IOfcHh2EeiJjZHqAYNFLA" type="Lifeline_Shape">
+ <children xmi:type="notation:DecorationNode" xmi:id="_1IOfcnh2EeiJjZHqAYNFLA" type="Lifeline_NameLabel"/>
+ <element xmi:type="uml:Lifeline" href="bug533697-reorderOperands.uml#_1IKOAHh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_1IOfcXh2EeiJjZHqAYNFLA" x="285" y="10"/>
+ </children>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_z9tNFHh2EeiJjZHqAYNFLA"/>
+ </children>
+ <element xmi:type="uml:Interaction" href="bug533697-reorderOperands.uml#_zRWdYHh2EeiJjZHqAYNFLA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_z9tNFXh2EeiJjZHqAYNFLA"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_z9tNFnh2EeiJjZHqAYNFLA" name="diagram_compatibility_version" stringValue="1.4.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_z9tNF3h2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="style:PapyrusDiagramStyle" xmi:id="_z9tNGHh2EeiJjZHqAYNFLA" diagramKindId="org.eclipse.papyrus.uml.diagram.sequence">
+ <owner xmi:type="uml:Model" href="bug533697-reorderOperands.uml#_yFZAkHh2EeiJjZHqAYNFLA"/>
+ </styles>
+ <styles xmi:type="notation:BooleanValueStyle" xmi:id="__PZjwHh2EeiJjZHqAYNFLA" name="rulergrid.viewgrid"/>
+ <styles xmi:type="notation:BooleanValueStyle" xmi:id="__SgiIHh2EeiJjZHqAYNFLA" name="rulergrid.snaptogrid"/>
+ <styles xmi:type="notation:EObjectListValueStyle" xmi:id="_4tAtcHh5EeiJjZHqAYNFLA" name="css_stylesheets" eObjectListValue="_4s9DEHh5EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Interaction" href="bug533697-reorderOperands.uml#_zRWdYHh2EeiJjZHqAYNFLA"/>
+ <edges xmi:type="notation:Connector" xmi:id="_2pW7AHh2EeiJjZHqAYNFLA" type="Message_AsynchEdge" source="_05nbsHh2EeiJjZHqAYNFLA" target="_1IOfcHh2EeiJjZHqAYNFLA">
+ <children xmi:type="notation:DecorationNode" xmi:id="_2pW7A3h2EeiJjZHqAYNFLA" type="Message_AsynchNameLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_2pW7BHh2EeiJjZHqAYNFLA" x="1" y="-13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_2pXiEHh2EeiJjZHqAYNFLA" type="Message_AsynchStereotypeLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_2pXiEXh2EeiJjZHqAYNFLA" x="1" y="-33"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_2pW7AXh2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_2pXiEnh2EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Message" href="bug533697-reorderOperands.uml#_2pLU0Hh2EeiJjZHqAYNFLA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_2pW7Anh2EeiJjZHqAYNFLA" points="[0, 0, -240, 0]$[240, 0, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2ppO4Hh2EeiJjZHqAYNFLA" id="(0.5,0.14142857142857143)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_2pp18Hh2EeiJjZHqAYNFLA" id="(0.5,0.14142857142857143)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_5uuwgHh2EeiJjZHqAYNFLA" type="Message_AsynchEdge" source="_05nbsHh2EeiJjZHqAYNFLA" target="_1IOfcHh2EeiJjZHqAYNFLA">
+ <children xmi:type="notation:DecorationNode" xmi:id="_5uuwg3h2EeiJjZHqAYNFLA" type="Message_AsynchNameLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_5uuwhHh2EeiJjZHqAYNFLA" x="1" y="-13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_5uuwhXh2EeiJjZHqAYNFLA" type="Message_AsynchStereotypeLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_5uuwhnh2EeiJjZHqAYNFLA" x="1" y="-33"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_5uuwgXh2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_5uvXkHh2EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Message" href="bug533697-reorderOperands.uml#_5uh8MHh2EeiJjZHqAYNFLA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_5uuwgnh2EeiJjZHqAYNFLA" points="[0, 0, -240, 0]$[240, 0, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_5u-BEHh2EeiJjZHqAYNFLA" id="(0.5,0.23714285714285716)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_5u-BEXh2EeiJjZHqAYNFLA" id="(0.5,0.23714285714285716)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_6APXQHh2EeiJjZHqAYNFLA" type="Message_AsynchEdge" source="_1IOfcHh2EeiJjZHqAYNFLA" target="_05nbsHh2EeiJjZHqAYNFLA">
+ <children xmi:type="notation:DecorationNode" xmi:id="_6APXQ3h2EeiJjZHqAYNFLA" type="Message_AsynchNameLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_6APXRHh2EeiJjZHqAYNFLA" x="1" y="-13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_6APXRXh2EeiJjZHqAYNFLA" type="Message_AsynchStereotypeLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_6APXRnh2EeiJjZHqAYNFLA" x="1" y="-33"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_6APXQXh2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_6APXR3h2EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Message" href="bug533697-reorderOperands.uml#_6AICgHh2EeiJjZHqAYNFLA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_6APXQnh2EeiJjZHqAYNFLA" points="[0, 0, 240, 0]$[-240, 0, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6AfO4Hh2EeiJjZHqAYNFLA" id="(0.5,0.29)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_6AfO4Xh2EeiJjZHqAYNFLA" id="(0.5,0.29)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_8N8k8Hh2EeiJjZHqAYNFLA" type="Message_AsynchEdge" source="_1IOfcHh2EeiJjZHqAYNFLA" target="_05nbsHh2EeiJjZHqAYNFLA">
+ <children xmi:type="notation:DecorationNode" xmi:id="_8N8k83h2EeiJjZHqAYNFLA" type="Message_AsynchNameLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8N8k9Hh2EeiJjZHqAYNFLA" x="1" y="-13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_8N8k9Xh2EeiJjZHqAYNFLA" type="Message_AsynchStereotypeLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8N8k9nh2EeiJjZHqAYNFLA" x="1" y="-33"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_8N8k8Xh2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_8N8k93h2EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Message" href="bug533697-reorderOperands.uml#_8NstUHh2EeiJjZHqAYNFLA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_8N8k8nh2EeiJjZHqAYNFLA" points="[0, 0, 240, 0]$[-240, 0, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8OORwHh2EeiJjZHqAYNFLA" id="(0.5,0.42714285714285716)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8OORwXh2EeiJjZHqAYNFLA" id="(0.5,0.42714285714285716)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_8dh5EHh2EeiJjZHqAYNFLA" type="Message_AsynchEdge" source="_05nbsHh2EeiJjZHqAYNFLA" target="_1IOfcHh2EeiJjZHqAYNFLA">
+ <children xmi:type="notation:DecorationNode" xmi:id="_8digIHh2EeiJjZHqAYNFLA" type="Message_AsynchNameLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8digIXh2EeiJjZHqAYNFLA" x="1" y="-13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_8digInh2EeiJjZHqAYNFLA" type="Message_AsynchStereotypeLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8digI3h2EeiJjZHqAYNFLA" x="1" y="-33"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_8dh5EXh2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_8digJHh2EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Message" href="bug533697-reorderOperands.uml#_8dRaYHh2EeiJjZHqAYNFLA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_8dh5Enh2EeiJjZHqAYNFLA" points="[0, 0, -240, 0]$[240, 0, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8d2CIHh2EeiJjZHqAYNFLA" id="(0.5,0.5228571428571429)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8d2CIXh2EeiJjZHqAYNFLA" id="(0.5,0.5228571428571429)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_8znd0Hh2EeiJjZHqAYNFLA" type="Message_AsynchEdge" source="_1IOfcHh2EeiJjZHqAYNFLA" target="_05nbsHh2EeiJjZHqAYNFLA">
+ <children xmi:type="notation:DecorationNode" xmi:id="_8znd03h2EeiJjZHqAYNFLA" type="Message_AsynchNameLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8znd1Hh2EeiJjZHqAYNFLA" x="1" y="-13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_8znd1Xh2EeiJjZHqAYNFLA" type="Message_AsynchStereotypeLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_8znd1nh2EeiJjZHqAYNFLA" x="1" y="-33"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_8znd0Xh2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_8znd13h2EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Message" href="bug533697-reorderOperands.uml#_8zVxAHh2EeiJjZHqAYNFLA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_8znd0nh2EeiJjZHqAYNFLA" points="[0, 0, 240, 0]$[-240, 0, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8z5KoHh2EeiJjZHqAYNFLA" id="(0.5,0.6071428571428571)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_8z5KoXh2EeiJjZHqAYNFLA" id="(0.5,0.6071428571428571)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_9Y7xYHh2EeiJjZHqAYNFLA" type="Message_AsynchEdge" source="_1IOfcHh2EeiJjZHqAYNFLA" target="_05nbsHh2EeiJjZHqAYNFLA">
+ <children xmi:type="notation:DecorationNode" xmi:id="_9Y7xY3h2EeiJjZHqAYNFLA" type="Message_AsynchNameLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_9Y8YcHh2EeiJjZHqAYNFLA" x="1" y="-13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_9Y8YcXh2EeiJjZHqAYNFLA" type="Message_AsynchStereotypeLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_9Y8Ycnh2EeiJjZHqAYNFLA" x="1" y="-33"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_9Y7xYXh2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_9Y8Yc3h2EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Message" href="bug533697-reorderOperands.uml#_9Yo2cHh2EeiJjZHqAYNFLA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_9Y7xYnh2EeiJjZHqAYNFLA" points="[0, 0, 240, 0]$[-240, 0, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_9ZPTYHh2EeiJjZHqAYNFLA" id="(0.5,0.7328571428571429)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_9ZPTYXh2EeiJjZHqAYNFLA" id="(0.5,0.7328571428571429)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_9oXUgHh2EeiJjZHqAYNFLA" type="Message_AsynchEdge" source="_05nbsHh2EeiJjZHqAYNFLA" target="_1IOfcHh2EeiJjZHqAYNFLA">
+ <children xmi:type="notation:DecorationNode" xmi:id="_9oXUg3h2EeiJjZHqAYNFLA" type="Message_AsynchNameLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_9oXUhHh2EeiJjZHqAYNFLA" x="1" y="-13"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_9oXUhXh2EeiJjZHqAYNFLA" type="Message_AsynchStereotypeLabel">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_9oXUhnh2EeiJjZHqAYNFLA" x="1" y="-33"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_9oXUgXh2EeiJjZHqAYNFLA"/>
+ <styles xmi:type="notation:LineStyle" xmi:id="_9oXUh3h2EeiJjZHqAYNFLA"/>
+ <element xmi:type="uml:Message" href="bug533697-reorderOperands.uml#_9oM8cHh2EeiJjZHqAYNFLA"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_9oXUgnh2EeiJjZHqAYNFLA" points="[0, 0, -240, 0]$[240, 0, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_9onzMHh2EeiJjZHqAYNFLA" id="(0.5,0.8257142857142857)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_9onzMXh2EeiJjZHqAYNFLA" id="(0.5,0.8257142857142857)"/>
+ </edges>
+ </notation:Diagram>
+ <css:StyleSheetReference xmi:id="_4s9DEHh5EeiJjZHqAYNFLA" path="/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/style.css"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.uml
new file mode 100644
index 0000000..4b363d4
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/resource/bugs/bug533697-reorderOperands.uml
@@ -0,0 +1,53 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_yFZAkHh2EeiJjZHqAYNFLA" name="bug533697-reorderOperands">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_yOSd4Hh2EeiJjZHqAYNFLA">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Interaction" xmi:id="_zRWdYHh2EeiJjZHqAYNFLA" name="Interaction2">
+ <lifeline xmi:type="uml:Lifeline" xmi:id="_05anYHh2EeiJjZHqAYNFLA" name="Lifeline1" coveredBy="_1xb0gHh2EeiJjZHqAYNFLA _3TYIYHh2EeiJjZHqAYNFLA _3d-O0Hh2EeiJjZHqAYNFLA _3o9W0Hh2EeiJjZHqAYNFLA _2pOYIHh2EeiJjZHqAYNFLA _5uijQHh2EeiJjZHqAYNFLA _6AIpkXh2EeiJjZHqAYNFLA _8Nt7cHh2EeiJjZHqAYNFLA _8dSBcHh2EeiJjZHqAYNFLA _8zW_IHh2EeiJjZHqAYNFLA _9YqEkHh2EeiJjZHqAYNFLA _9oNjgHh2EeiJjZHqAYNFLA"/>
+ <lifeline xmi:type="uml:Lifeline" xmi:id="_1IKOAHh2EeiJjZHqAYNFLA" name="Lifeline2" coveredBy="_1xb0gHh2EeiJjZHqAYNFLA _3TYIYHh2EeiJjZHqAYNFLA _3d-O0Hh2EeiJjZHqAYNFLA _3o9W0Hh2EeiJjZHqAYNFLA _2pO_MHh2EeiJjZHqAYNFLA _5ujKUHh2EeiJjZHqAYNFLA _6AIpkHh2EeiJjZHqAYNFLA _8NtUYHh2EeiJjZHqAYNFLA _8dSBcXh2EeiJjZHqAYNFLA _8zWYEHh2EeiJjZHqAYNFLA _9YpdgHh2EeiJjZHqAYNFLA _9oNjgXh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:CombinedFragment" xmi:id="_1xZYQHh2EeiJjZHqAYNFLA" name="CombinedFragment3">
+ <operand xmi:type="uml:InteractionOperand" xmi:id="_1xb0gHh2EeiJjZHqAYNFLA" name="Operand 1" covered="_05anYHh2EeiJjZHqAYNFLA _1IKOAHh2EeiJjZHqAYNFLA">
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_2pOYIHh2EeiJjZHqAYNFLA" name="Message4SendEvent" covered="_05anYHh2EeiJjZHqAYNFLA" message="_2pLU0Hh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_2pO_MHh2EeiJjZHqAYNFLA" name="Message4ReceiveEvent" covered="_1IKOAHh2EeiJjZHqAYNFLA" message="_2pLU0Hh2EeiJjZHqAYNFLA"/>
+ <guard xmi:type="uml:InteractionConstraint" xmi:id="_1xb0gXh2EeiJjZHqAYNFLA" name="guard"/>
+ </operand>
+ <operand xmi:type="uml:InteractionOperand" xmi:id="_3TYIYHh2EeiJjZHqAYNFLA" name="Operand 2" covered="_05anYHh2EeiJjZHqAYNFLA _1IKOAHh2EeiJjZHqAYNFLA">
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_5uijQHh2EeiJjZHqAYNFLA" name="Message5SendEvent" covered="_05anYHh2EeiJjZHqAYNFLA" message="_5uh8MHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_5ujKUHh2EeiJjZHqAYNFLA" name="Message5ReceiveEvent" covered="_1IKOAHh2EeiJjZHqAYNFLA" message="_5uh8MHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_6AIpkHh2EeiJjZHqAYNFLA" name="Message6SendEvent" covered="_1IKOAHh2EeiJjZHqAYNFLA" message="_6AICgHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_6AIpkXh2EeiJjZHqAYNFLA" name="Message6ReceiveEvent" covered="_05anYHh2EeiJjZHqAYNFLA" message="_6AICgHh2EeiJjZHqAYNFLA"/>
+ <guard xmi:type="uml:InteractionConstraint" xmi:id="_3TZWgHh2EeiJjZHqAYNFLA" name="guard"/>
+ </operand>
+ <operand xmi:type="uml:InteractionOperand" xmi:id="_3d-O0Hh2EeiJjZHqAYNFLA" name="Operand 3" covered="_05anYHh2EeiJjZHqAYNFLA _1IKOAHh2EeiJjZHqAYNFLA">
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_8NtUYHh2EeiJjZHqAYNFLA" name="Message8SendEvent" covered="_1IKOAHh2EeiJjZHqAYNFLA" message="_8NstUHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_8Nt7cHh2EeiJjZHqAYNFLA" name="Message8ReceiveEvent" covered="_05anYHh2EeiJjZHqAYNFLA" message="_8NstUHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_8dSBcHh2EeiJjZHqAYNFLA" name="Message9SendEvent" covered="_05anYHh2EeiJjZHqAYNFLA" message="_8dRaYHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_8dSBcXh2EeiJjZHqAYNFLA" name="Message9ReceiveEvent" covered="_1IKOAHh2EeiJjZHqAYNFLA" message="_8dRaYHh2EeiJjZHqAYNFLA"/>
+ <guard xmi:type="uml:InteractionConstraint" xmi:id="_3d_c8Hh2EeiJjZHqAYNFLA" name="guard"/>
+ </operand>
+ <operand xmi:type="uml:InteractionOperand" xmi:id="_3o9W0Hh2EeiJjZHqAYNFLA" name="Operand 4" covered="_05anYHh2EeiJjZHqAYNFLA _1IKOAHh2EeiJjZHqAYNFLA">
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_8zWYEHh2EeiJjZHqAYNFLA" name="Message10SendEvent" covered="_1IKOAHh2EeiJjZHqAYNFLA" message="_8zVxAHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_8zW_IHh2EeiJjZHqAYNFLA" name="Message10ReceiveEvent" covered="_05anYHh2EeiJjZHqAYNFLA" message="_8zVxAHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_9YpdgHh2EeiJjZHqAYNFLA" name="Message12SendEvent" covered="_1IKOAHh2EeiJjZHqAYNFLA" message="_9Yo2cHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_9YqEkHh2EeiJjZHqAYNFLA" name="Message12ReceiveEvent" covered="_05anYHh2EeiJjZHqAYNFLA" message="_9Yo2cHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_9oNjgHh2EeiJjZHqAYNFLA" name="Message13SendEvent" covered="_05anYHh2EeiJjZHqAYNFLA" message="_9oM8cHh2EeiJjZHqAYNFLA"/>
+ <fragment xmi:type="uml:MessageOccurrenceSpecification" xmi:id="_9oNjgXh2EeiJjZHqAYNFLA" name="Message13ReceiveEvent" covered="_1IKOAHh2EeiJjZHqAYNFLA" message="_9oM8cHh2EeiJjZHqAYNFLA"/>
+ <guard xmi:type="uml:InteractionConstraint" xmi:id="_3o994Hh2EeiJjZHqAYNFLA" name="guard"/>
+ </operand>
+ </fragment>
+ <fragment xmi:type="uml:CombinedFragment" xmi:id="_w6lk4Hh3EeiJjZHqAYNFLA" name="CombinedFragment14">
+ <operand xmi:type="uml:InteractionOperand" xmi:id="_w6mzAHh3EeiJjZHqAYNFLA" name="Other Operand">
+ <guard xmi:type="uml:InteractionConstraint" xmi:id="_w6mzAXh3EeiJjZHqAYNFLA" name="guard"/>
+ </operand>
+ </fragment>
+ <message xmi:type="uml:Message" xmi:id="_2pLU0Hh2EeiJjZHqAYNFLA" name="Message4" messageSort="asynchCall" receiveEvent="_2pO_MHh2EeiJjZHqAYNFLA" sendEvent="_2pOYIHh2EeiJjZHqAYNFLA"/>
+ <message xmi:type="uml:Message" xmi:id="_5uh8MHh2EeiJjZHqAYNFLA" name="Message5" messageSort="asynchCall" receiveEvent="_5ujKUHh2EeiJjZHqAYNFLA" sendEvent="_5uijQHh2EeiJjZHqAYNFLA"/>
+ <message xmi:type="uml:Message" xmi:id="_6AICgHh2EeiJjZHqAYNFLA" name="Message6" messageSort="asynchCall" receiveEvent="_6AIpkXh2EeiJjZHqAYNFLA" sendEvent="_6AIpkHh2EeiJjZHqAYNFLA"/>
+ <message xmi:type="uml:Message" xmi:id="_8NstUHh2EeiJjZHqAYNFLA" name="Message8" messageSort="asynchCall" receiveEvent="_8Nt7cHh2EeiJjZHqAYNFLA" sendEvent="_8NtUYHh2EeiJjZHqAYNFLA"/>
+ <message xmi:type="uml:Message" xmi:id="_8dRaYHh2EeiJjZHqAYNFLA" name="Message9" messageSort="asynchCall" receiveEvent="_8dSBcXh2EeiJjZHqAYNFLA" sendEvent="_8dSBcHh2EeiJjZHqAYNFLA"/>
+ <message xmi:type="uml:Message" xmi:id="_8zVxAHh2EeiJjZHqAYNFLA" name="Message10" messageSort="asynchCall" receiveEvent="_8zW_IHh2EeiJjZHqAYNFLA" sendEvent="_8zWYEHh2EeiJjZHqAYNFLA"/>
+ <message xmi:type="uml:Message" xmi:id="_9Yo2cHh2EeiJjZHqAYNFLA" name="Message12" messageSort="asynchCall" receiveEvent="_9YqEkHh2EeiJjZHqAYNFLA" sendEvent="_9YpdgHh2EeiJjZHqAYNFLA"/>
+ <message xmi:type="uml:Message" xmi:id="_9oM8cHh2EeiJjZHqAYNFLA" name="Message13" messageSort="asynchCall" receiveEvent="_9oNjgXh2EeiJjZHqAYNFLA" sendEvent="_9oNjgHh2EeiJjZHqAYNFLA"/>
+ </packagedElement>
+</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/AbstractOperandsTest.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/AbstractOperandsTest.java
new file mode 100644
index 0000000..f7cee23
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/AbstractOperandsTest.java
@@ -0,0 +1,165 @@
+/*****************************************************************************
+ * Copyright (c) 2018 EclipseSource, 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:
+ * EclipseSource - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.uml.diagram.sequence.tests.bug;
+
+import static org.hamcrest.CoreMatchers.instanceOf;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Objects;
+
+import org.eclipse.draw2d.IFigure;
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
+import org.eclipse.papyrus.uml.diagram.sequence.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.ExecutionSpecification;
+import org.eclipse.uml2.uml.InteractionFragment;
+import org.eclipse.uml2.uml.InteractionOperand;
+import org.eclipse.uml2.uml.Message;
+import org.eclipse.uml2.uml.MessageEnd;
+import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
+import org.eclipse.uml2.uml.util.UMLSwitch;
+import org.hamcrest.core.IsInstanceOf;
+import org.junit.Assert;
+import org.junit.Rule;
+
+public abstract class AbstractOperandsTest extends AbstractPapyrusTest {
+
+ @Rule
+ public final PapyrusEditorFixture editor = new PapyrusEditorFixture();
+
+ protected void assertCovered(IGraphicalEditPart coveredPart, IGraphicalEditPart operandPart) {
+ assertCoverage(coveredPart, operandPart, true);
+ }
+
+ protected void assertNotCovered(IGraphicalEditPart coveredPart, IGraphicalEditPart operandPart) {
+ assertCoverage(coveredPart, operandPart, false);
+ }
+
+ protected void assertCoverage(IGraphicalEditPart coveredPart, IGraphicalEditPart operandPart, boolean expectedCoverage) {
+ EObject semantic = coveredPart.getNotationView().getElement();
+ InteractionOperand operand = getOperand(operandPart);
+
+ assertCoverage(semantic, operand, expectedCoverage);
+ }
+
+ protected InteractionOperand getOperand(IGraphicalEditPart operandPart) {
+ return (InteractionOperand) operandPart.getNotationView().getElement();
+ }
+
+ protected void assertCoverage(EObject semantic, InteractionOperand operand, boolean expectedCoverage) {
+ new UMLSwitch<Void>() {
+ @Override
+ public Void caseMessage(Message object) {
+ assertCoverage(object, operand, expectedCoverage);
+ return null;
+ }
+
+ @Override
+ public Void caseExecutionSpecification(ExecutionSpecification object) {
+ assertCoverage(object, operand, expectedCoverage);
+ return null;
+ }
+ }.doSwitch(semantic);
+ }
+
+ protected MessageEnd getSend(IGraphicalEditPart messageEditPart) {
+ return ((Message) messageEditPart.getNotationView().getElement()).getSendEvent();
+ }
+
+ protected MessageEnd getReceive(IGraphicalEditPart messageEditPart) {
+ return ((Message) messageEditPart.getNotationView().getElement()).getReceiveEvent();
+ }
+
+ protected InteractionFragment getStart(IGraphicalEditPart execSpecEditPart) {
+ return ((ExecutionSpecification) execSpecEditPart.getNotationView().getElement()).getStart();
+ }
+
+ protected InteractionFragment getFinish(IGraphicalEditPart execSpecEditPart) {
+ return ((ExecutionSpecification) execSpecEditPart.getNotationView().getElement()).getFinish();
+ }
+
+ protected void assertCoverage(Message message, InteractionOperand operand, boolean expectedCoverage) {
+ assertCoverage(message.getSendEvent(), operand, expectedCoverage);
+ assertCoverage(message.getReceiveEvent(), operand, expectedCoverage);
+ }
+
+ protected void assertCoverage(MessageEnd messageEnd, InteractionOperand operand, boolean expectedCoverage) {
+ Assert.assertThat(messageEnd, IsInstanceOf.instanceOf(MessageOccurrenceSpecification.class));
+ assertCoverage((InteractionFragment) messageEnd, operand, expectedCoverage);
+ }
+
+ protected void assertCoverage(ExecutionSpecification exec, InteractionOperand operand, boolean expectedCoverage) {
+ assertCoverage(exec.getStart(), operand, expectedCoverage);
+ assertCoverage(exec.getFinish(), operand, expectedCoverage);
+ }
+
+ protected void assertCoverage(InteractionFragment fragment, InteractionOperand operand, boolean expectedCoverage) {
+ Assert.assertEquals(expectedCoverage, operand.getFragments().contains(fragment));
+ }
+
+ // Don't use editor.createShape(), because we need a special type of request to create operands.
+ // The "InsertAt" behavior will only be computed if we use a CreateUnspecifiedTypeRequest (From the palette)
+ // and target an Operand. The Operand will then be responsible for setting the InsertAt parameter
+ // and delegate to the CombinedFragment compartment for the actual creation
+ protected GraphicalEditPart createOperand(IGraphicalEditPart targetVisualPart, Point location) {
+ CreateUnspecifiedTypeRequest request = new CreateUnspecifiedTypeRequest(Collections.singletonList(UMLElementTypes.InteractionOperand_Shape), targetVisualPart.getDiagramPreferencesHint());
+
+ request.setLocation(location);
+
+ EditPart target = targetVisualPart.getTargetEditPart(request);
+ assertThat("No target edit part", target, notNullValue());
+ org.eclipse.gef.commands.Command command = target.getCommand(request);
+ editor.execute(command);
+
+ // Find the new edit-part
+ Object result = request.getNewObject();
+ Assert.assertThat(result, instanceOf(Collection.class));
+ Collection<?> results = (Collection<?>) result;
+ return results.stream()
+ .filter(ViewDescriptor.class::isInstance).map(ViewDescriptor.class::cast)
+ .map(desc -> desc.getAdapter(View.class)).map(View.class::cast)
+ .filter(Objects::nonNull)
+ .map(view -> DiagramEditPartsUtil.getEditPartFromView(view, targetVisualPart))
+ .filter(GraphicalEditPart.class::isInstance).map(GraphicalEditPart.class::cast)
+ .filter(Objects::nonNull)
+ .findAny().orElseThrow(() -> new IllegalStateException("Could not find new shape edit-part"));
+ }
+
+ // Convert a point that is relative to the given part to a point relative to the current Viewport (Taking zoom & translate into account).
+ // This can be used to get a "Mouse Location" to configure Requests
+ protected static Point at(int x, int y, IGraphicalEditPart relativeTo) {
+ Point at = new Point(x, y);
+
+ IFigure figure = relativeTo.getContentPane();
+ Point layoutOrigin = figure.getClientArea().getLocation();
+
+ at.performTranslate(layoutOrigin.x, layoutOrigin.y);
+ figure.translateToParent(at);
+ figure.translateToAbsolute(at);
+
+ return at;
+ }
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/BugTests.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/BugTests.java
index a8a5734..011abe0 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/BugTests.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/BugTests.java
@@ -38,6 +38,7 @@ import org.junit.runners.Suite.SuiteClasses;
LifelineCoverageRegressionTest.class,
TestCFOperandsCoveredNodes.class,
TestCFOperandsSemanticCoverage.class,
+ TestCFOperandsReorder.class,
})
public class BugTests {
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsReorder.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsReorder.java
new file mode 100644
index 0000000..e8b9ab0
--- /dev/null
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsReorder.java
@@ -0,0 +1,229 @@
+/*****************************************************************************
+ * Copyright (c) 2018 EclipseSource, 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:
+ * EclipseSource - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.uml.diagram.sequence.tests.bug;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.draw2d.geometry.Dimension;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.requests.ChangeBoundsRequest;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.RequestConstants;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.Size;
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.InteractionOperand;
+import org.eclipse.uml2.uml.Message;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+/**
+ * Test class for Bug 533697.
+ *
+ * Tests that:
+ *
+ * <ul>
+ * <li>It must be possible to reorder operands in a CF via a {@link RequestConstants#REQ_DROP Drop request}</li>
+ * <li>It is <strong>not</strong> possible to reparent an Operand (i.e. drop it to a different container)</li>
+ * <li>After a drop, all Operands have the same size</li>
+ * <li>After a drop, covered fragments are updated, without moving</li>
+ * </ul>
+ */
+@PluginResource({ "resource/bugs/bug533697-reorderOperands.di", "resource/bugs/style.css" })
+@ActiveDiagram("Reorder")
+public class TestCFOperandsReorder extends AbstractOperandsTest {
+
+ Map<IGraphicalEditPart, Dimension> initialSizes = new HashMap<>();
+
+ IGraphicalEditPart operand1, operand2, operand3, operand4, otherOperand;
+ IGraphicalEditPart message4, message5, message6, message8, message9, message10, message12, message13;
+
+ @Before
+ public void init() {
+ initialSizes.clear();
+
+ operand1 = (IGraphicalEditPart) editor.findEditPart("Operand 1", InteractionOperand.class);
+ operand2 = (IGraphicalEditPart) editor.findEditPart("Operand 2", InteractionOperand.class);
+ operand3 = (IGraphicalEditPart) editor.findEditPart("Operand 3", InteractionOperand.class);
+ operand4 = (IGraphicalEditPart) editor.findEditPart("Operand 4", InteractionOperand.class);
+ otherOperand = (IGraphicalEditPart) editor.findEditPart("Other Operand", InteractionOperand.class);
+
+ initialSizes.put(operand1, getSize(operand1));
+ initialSizes.put(operand2, getSize(operand2));
+ initialSizes.put(operand3, getSize(operand3));
+ initialSizes.put(operand4, getSize(operand4));
+ initialSizes.put(otherOperand, getSize(otherOperand));
+
+ message4 = (IGraphicalEditPart)editor.findEditPart("Message4", Message.class);
+ message5 = (IGraphicalEditPart)editor.findEditPart("Message5", Message.class);
+ message6 = (IGraphicalEditPart)editor.findEditPart("Message6", Message.class);
+ message8 = (IGraphicalEditPart)editor.findEditPart("Message8", Message.class);
+ message9 = (IGraphicalEditPart)editor.findEditPart("Message9", Message.class);
+ message10 = (IGraphicalEditPart)editor.findEditPart("Message10", Message.class);
+ message12 = (IGraphicalEditPart)editor.findEditPart("Message12", Message.class);
+ message13 = (IGraphicalEditPart)editor.findEditPart("Message13", Message.class);
+
+ assertCovered(message4, operand1);
+
+ assertCovered(message5, operand2);
+ assertCovered(message6, operand2);
+
+ assertCovered(message8, operand3);
+ assertCovered(message9, operand3);
+
+ assertCovered(message10, operand4);
+ assertCovered(message12, operand4);
+ assertCovered(message13, operand4);
+ }
+
+ @Test
+ public void testReorderFirstToSecond() {
+ drop(operand1, operand2);
+
+ assertCovered(message4, operand2);
+ assertCovered(message5, operand2);
+
+ assertCovered(message6, operand1);
+
+ assertCovered(message8, operand3);
+ assertCovered(message9, operand3);
+
+ assertCovered(message10, operand4);
+ assertCovered(message12, operand4);
+ assertCovered(message13, operand4);
+ }
+
+ @Test
+ public void testReorderSecondToFirst() {
+ drop(operand2, operand1);
+
+ assertCovered(message4, operand2);
+ assertCovered(message5, operand2);
+
+ assertCovered(message6, operand1);
+
+ assertCovered(message8, operand3);
+ assertCovered(message9, operand3);
+
+ assertCovered(message10, operand4);
+ assertCovered(message12, operand4);
+ assertCovered(message13, operand4);
+ }
+
+ @Test
+ public void testReorderLastToThird() {
+ drop(operand4, operand3);
+
+ assertCovered(message4, operand1);
+
+ assertCovered(message5, operand2);
+ assertCovered(message6, operand2);
+
+ assertCovered(message8, operand4);
+ assertCovered(message9, operand4);
+ assertCovered(message10, operand4);
+
+ assertCovered(message12, operand3);
+ assertCovered(message13, operand3);
+ }
+
+ @Test
+ public void testReorderThirdToLast() {
+ drop(operand3, operand4);
+
+ assertCovered(message4, operand1);
+
+ assertCovered(message5, operand2);
+ assertCovered(message6, operand2);
+
+ assertCovered(message8, operand4);
+ assertCovered(message9, operand4);
+ assertCovered(message10, operand4);
+
+ assertCovered(message12, operand3);
+ assertCovered(message13, operand3);
+ }
+
+ @Test
+ public void testReorderFirstToLast() {
+ drop(operand1, operand4);
+
+ assertCovered(message4, operand2);
+ assertCovered(message5, operand2);
+
+ assertCovered(message6, operand3);
+ assertCovered(message8, operand3);
+
+ assertCovered(message9, operand4);
+ assertCovered(message10, operand4);
+ assertCovered(message12, operand4);
+
+ assertCovered(message13, operand1);
+ }
+
+ @Test
+ public void testReorderLastToFirst() {
+ drop(operand4, operand1);
+
+ assertCovered(message4, operand4);
+ assertCovered(message5, operand4);
+ assertCovered(message6, operand4);
+
+ assertCovered(message8, operand1);
+
+ assertCovered(message9, operand2);
+ assertCovered(message10, operand2);
+
+ assertCovered(message12, operand3);
+ assertCovered(message13, operand3);
+ }
+
+ @Test
+ public void testReparentForbidden() {
+ Assert.assertFalse(drop(operand1, otherOperand));
+ Assert.assertFalse(drop(otherOperand, operand4));
+ }
+
+ private boolean drop(IGraphicalEditPart operand, IGraphicalEditPart onOperand) {
+ ChangeBoundsRequest dropRequest = new ChangeBoundsRequest(RequestConstants.REQ_DROP);
+ dropRequest.setEditParts(operand);
+ Command command = onOperand.getCommand(dropRequest);
+ boolean canExecute = command.canExecute();
+ if (canExecute) {
+ editor.execute(command);
+ }
+
+ return canExecute;
+ }
+
+ @After
+ public void checkSizes() {
+ for (Map.Entry<IGraphicalEditPart, Dimension> sizeEntry : initialSizes.entrySet()) {
+ Dimension newSize = getSize(sizeEntry.getKey());
+ Assert.assertEquals(sizeEntry.getValue(), newSize);
+ }
+ initialSizes.clear();
+ }
+
+ private Dimension getSize(IGraphicalEditPart part) {
+ Node node = (Node)part.getNotationView();
+ Size size = (Size)node.getLayoutConstraint();
+ return new Dimension(size.getWidth(), size.getHeight());
+ }
+
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsSemanticCoverage.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsSemanticCoverage.java
index 81c7802..96da06a 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsSemanticCoverage.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCFOperandsSemanticCoverage.java
@@ -12,47 +12,23 @@
*****************************************************************************/
package org.eclipse.papyrus.uml.diagram.sequence.tests.bug;
-import static org.hamcrest.CoreMatchers.instanceOf;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.hamcrest.MatcherAssert.assertThat;
-
-import java.util.Collection;
import java.util.Collections;
-import java.util.Objects;
-import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.PositionConstants;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
-import org.eclipse.emf.ecore.EObject;
-import org.eclipse.gef.EditPart;
import org.eclipse.gef.RequestConstants;
import org.eclipse.gef.requests.ChangeBoundsRequest;
-import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateUnspecifiedTypeRequest;
-import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest.ViewDescriptor;
-import org.eclipse.gmf.runtime.notation.View;
-import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil;
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.sequence.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.diagram.sequence.requests.MoveSeparatorRequest;
import org.eclipse.uml2.uml.ActionExecutionSpecification;
import org.eclipse.uml2.uml.CombinedFragment;
-import org.eclipse.uml2.uml.ExecutionSpecification;
-import org.eclipse.uml2.uml.InteractionFragment;
import org.eclipse.uml2.uml.InteractionOperand;
import org.eclipse.uml2.uml.Message;
-import org.eclipse.uml2.uml.MessageEnd;
-import org.eclipse.uml2.uml.MessageOccurrenceSpecification;
-import org.eclipse.uml2.uml.util.UMLSwitch;
-import org.hamcrest.core.IsInstanceOf;
-import org.junit.Assert;
import org.junit.Before;
import org.junit.Ignore;
-import org.junit.Rule;
import org.junit.Test;
/**
@@ -64,10 +40,7 @@ import org.junit.Test;
// Test class for Bug 535097
@PluginResource({ "resource/bugs/bug535097-OperandsSemantic.di", "resource/bugs/style.css" })
@ActiveDiagram("SemanticCoverageTest")
-public class TestCFOperandsSemanticCoverage {
-
- @Rule
- public final PapyrusEditorFixture editor = new PapyrusEditorFixture();
+public class TestCFOperandsSemanticCoverage extends AbstractOperandsTest {
private IGraphicalEditPart cfPart;
private IGraphicalEditPart operandPart;
@@ -366,117 +339,4 @@ public class TestCFOperandsSemanticCoverage {
assertCoverage(getFinish(exec2), getOperand(operand4Part), true);
}
- private void assertCovered(IGraphicalEditPart coveredPart, IGraphicalEditPart operandPart) {
- assertCoverage(coveredPart, operandPart, true);
- }
-
- private void assertNotCovered(IGraphicalEditPart coveredPart, IGraphicalEditPart operandPart) {
- assertCoverage(coveredPart, operandPart, false);
- }
-
- private void assertCoverage(IGraphicalEditPart coveredPart, IGraphicalEditPart operandPart, boolean expectedCoverage) {
- EObject semantic = coveredPart.getNotationView().getElement();
- InteractionOperand operand = getOperand(operandPart);
-
- assertCoverage(semantic, operand, expectedCoverage);
- }
-
- private InteractionOperand getOperand(IGraphicalEditPart operandPart) {
- return (InteractionOperand) operandPart.getNotationView().getElement();
- }
-
- private void assertCoverage(EObject semantic, InteractionOperand operand, boolean expectedCoverage) {
- new UMLSwitch<Void>() {
- @Override
- public Void caseMessage(Message object) {
- assertCoverage(object, operand, expectedCoverage);
- return null;
- }
-
- @Override
- public Void caseExecutionSpecification(ExecutionSpecification object) {
- assertCoverage(object, operand, expectedCoverage);
- return null;
- }
- }.doSwitch(semantic);
- }
-
- private MessageEnd getSend(IGraphicalEditPart messageEditPart) {
- return ((Message) messageEditPart.getNotationView().getElement()).getSendEvent();
- }
-
- private MessageEnd getReceive(IGraphicalEditPart messageEditPart) {
- return ((Message) messageEditPart.getNotationView().getElement()).getReceiveEvent();
- }
-
- private InteractionFragment getStart(IGraphicalEditPart execSpecEditPart) {
- return ((ExecutionSpecification) execSpecEditPart.getNotationView().getElement()).getStart();
- }
-
- private InteractionFragment getFinish(IGraphicalEditPart execSpecEditPart) {
- return ((ExecutionSpecification) execSpecEditPart.getNotationView().getElement()).getFinish();
- }
-
- private void assertCoverage(Message message, InteractionOperand operand, boolean expectedCoverage) {
- assertCoverage(message.getSendEvent(), operand, expectedCoverage);
- assertCoverage(message.getReceiveEvent(), operand, expectedCoverage);
- }
-
- private void assertCoverage(MessageEnd messageEnd, InteractionOperand operand, boolean expectedCoverage) {
- Assert.assertThat(messageEnd, IsInstanceOf.instanceOf(MessageOccurrenceSpecification.class));
- assertCoverage((InteractionFragment) messageEnd, operand, expectedCoverage);
- }
-
- private void assertCoverage(ExecutionSpecification exec, InteractionOperand operand, boolean expectedCoverage) {
- assertCoverage(exec.getStart(), operand, expectedCoverage);
- assertCoverage(exec.getFinish(), operand, expectedCoverage);
- }
-
- private void assertCoverage(InteractionFragment fragment, InteractionOperand operand, boolean expectedCoverage) {
- Assert.assertEquals(expectedCoverage, operand.getFragments().contains(fragment));
- }
-
- // Don't use editor.createShape(), because we need a special type of request to create operands.
- // The "InsertAt" behavior will only be computed if we use a CreateUnspecifiedTypeRequest (From the palette)
- // and target an Operand. The Operand will then be responsible for setting the InsertAt parameter
- // and delegate to the CombinedFragment compartment for the actual creation
- private GraphicalEditPart createOperand(IGraphicalEditPart targetVisualPart, Point location) {
- CreateUnspecifiedTypeRequest request = new CreateUnspecifiedTypeRequest(Collections.singletonList(UMLElementTypes.InteractionOperand_Shape), targetVisualPart.getDiagramPreferencesHint());
-
- request.setLocation(location);
-
- EditPart target = targetVisualPart.getTargetEditPart(request);
- assertThat("No target edit part", target, notNullValue());
- org.eclipse.gef.commands.Command command = target.getCommand(request);
- editor.execute(command);
-
- // Find the new edit-part
- Object result = request.getNewObject();
- Assert.assertThat(result, instanceOf(Collection.class));
- Collection<?> results = (Collection<?>) result;
- return results.stream()
- .filter(ViewDescriptor.class::isInstance).map(ViewDescriptor.class::cast)
- .map(desc -> desc.getAdapter(View.class)).map(View.class::cast)
- .filter(Objects::nonNull)
- .map(view -> DiagramEditPartsUtil.getEditPartFromView(view, targetVisualPart))
- .filter(GraphicalEditPart.class::isInstance).map(GraphicalEditPart.class::cast)
- .filter(Objects::nonNull)
- .findAny().orElseThrow(() -> new IllegalStateException("Could not find new shape edit-part"));
- }
-
- // Convert a point that is relative to the given part to a point relative to the current Viewport (Taking zoom & translate into account).
- // This can be used to get a "Mouse Location" to configure Requests
- private static Point at(int x, int y, IGraphicalEditPart relativeTo) {
- Point at = new Point(x, y);
-
- IFigure figure = relativeTo.getContentPane();
- Point layoutOrigin = figure.getClientArea().getLocation();
-
- at.performTranslate(layoutOrigin.x, layoutOrigin.y);
- figure.translateToParent(at);
- figure.translateToAbsolute(at);
-
- return at;
- }
-
}