Skip to main content
summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorCamille Letavernier2018-05-17 08:44:27 +0000
committerNicolas FAUVERGUE2018-05-22 15:58:01 +0000
commit7edf8affa9b885d998704202f422f1cb247594e2 (patch)
treea8365a3847a5cf70cf2622d02bf1ceeeb7bb794d /tests
parent89be951db129192f9c49a82b6f05495ba1f05a79 (diff)
downloadorg.eclipse.papyrus-7edf8affa9b885d998704202f422f1cb247594e2.tar.gz
org.eclipse.papyrus-7edf8affa9b885d998704202f422f1cb247594e2.tar.xz
org.eclipse.papyrus-7edf8affa9b885d998704202f422f1cb247594e2.zip
Bug 533696: [Sequence Diagram] Moving an InteractionOperand in a
CombinedFragment is not possible https://bugs.eclipse.org/bugs/show_bug.cgi?id=533696 - Add test Change-Id: I0dd4a7d7db888d9472880984d64432bb9721ff53 Signed-off-by: Camille Letavernier <cletavernier@eclipsesource.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java52
1 files changed, 52 insertions, 0 deletions
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java
index 1bde54d8d0c..2e9ac91f655 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java
+++ b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.sequence.tests/src/org/eclipse/papyrus/uml/diagram/sequence/tests/bug/TestCombinedFragmentOperandsLayout.java
@@ -306,6 +306,58 @@ public class TestCombinedFragmentOperandsLayout extends AbstractPapyrusTest {
}
}
+ // Bug 533696: It is not possible to move an operand
+ @Test
+ public void testMoveOperandForbidden() {
+ ChangeBoundsRequest request = new ChangeBoundsRequest(RequestConstants.REQ_MOVE);
+ request.setEditParts(op1EditPart);
+ Command command;
+
+ // Move on X/Y
+ request.setMoveDelta(new Point(-60, 25));
+ command = op1EditPart.getCommand(request);
+ Assert.assertFalse("It shouldn't be possible to move the Operand", command != null && command.canExecute());
+
+ // Move on X
+ request.setMoveDelta(new Point(30, 0));
+ command = op1EditPart.getCommand(request);
+ Assert.assertFalse("It shouldn't be possible to move the Operand", command != null && command.canExecute());
+
+ // Move on Y
+ request.setMoveDelta(new Point(0, -10));
+ command = op1EditPart.getCommand(request);
+ Assert.assertFalse("It shouldn't be possible to move the Operand", command != null && command.canExecute());
+ }
+
+ // Check that moving the CF (without resizing) won't change the size of its operands
+ @Test
+ public void testMoveCombinedFragment() {
+ // Prepare request & store initial state
+ ChangeBoundsRequest request = new ChangeBoundsRequest(RequestConstants.REQ_MOVE);
+ request.setEditParts(cfEditPart);
+
+ Rectangle op1Bounds = op1EditPart.getFigure().getBounds().getCopy();
+ Rectangle op2Bounds = op2EditPart.getFigure().getBounds().getCopy();
+
+ // Move on X/Y
+ request.setMoveDelta(new Point(-60, 25));
+ editor.execute(cfEditPart.getCommand(request));
+ assertOperandSize(op1Bounds.width(), op1Bounds.height(), op1EditPart);
+ assertOperandSize(op2Bounds.width(), op2Bounds.height(), op2EditPart);
+
+ // Move on X
+ request.setMoveDelta(new Point(30, 0));
+ editor.execute(cfEditPart.getCommand(request));
+ assertOperandSize(op1Bounds.width(), op1Bounds.height(), op1EditPart);
+ assertOperandSize(op2Bounds.width(), op2Bounds.height(), op2EditPart);
+
+ // Move on Y
+ request.setMoveDelta(new Point(0, -10));
+ editor.execute(cfEditPart.getCommand(request));
+ assertOperandSize(op1Bounds.width(), op1Bounds.height(), op1EditPart);
+ assertOperandSize(op2Bounds.width(), op2Bounds.height(), op2EditPart);
+ }
+
// 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

Back to the top