diff options
| author | Laurent Redor | 2016-08-01 13:45:09 +0000 |
|---|---|---|
| committer | Laurent Redor | 2016-08-03 07:11:32 +0000 |
| commit | 57d6ac364ab49f0b755e50b90a79e145d910792a (patch) | |
| tree | 6f51751ab6ee50590076bdbbf25beb3e10a70a92 | |
| parent | d9849da9fee8f7b9e8bebd7b1af2b22babb1a92a (diff) | |
| download | org.eclipse.sirius-57d6ac364ab49f0b755e50b90a79e145d910792a.tar.gz org.eclipse.sirius-57d6ac364ab49f0b755e50b90a79e145d910792a.tar.xz org.eclipse.sirius-57d6ac364ab49f0b755e50b90a79e145d910792a.zip | |
[498441] Improve test added for this bug
The test was OK with or without fix. Indeed, the corner is used instead
of the border (and the behavior is not the same).
This commit now:
* selects the label before moving it,
* uses the border of the label,
* uses another label as the previous one is too close from the edge,
* completes the message of the assertion.
Bug: 498441
Change-Id: Ib0a412f34d4c021d7b711ae56aa94a35bb86c17d
Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeLabelsMoveTest.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeLabelsMoveTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeLabelsMoveTest.java index 0624137346..c73093f8c3 100644 --- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeLabelsMoveTest.java +++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeLabelsMoveTest.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2016 THALES GLOBAL SERVICES. * 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 @@ -144,7 +144,8 @@ public class EdgeLabelsMoveTest extends AbstractSiriusSwtBotGefTestCase { diagramEditor = setUpEditorAccordingToDimensions(diagramName, ZoomLevel.ZOOM_100); - SWTBotGefEditPart editPart = diagramEditor.getEditPart("refToBBegin"); + SWTBotGefEditPart editPart = diagramEditor.getEditPart("refToBCenter"); + editPart.select(); GraphicalEditPart part = (GraphicalEditPart) editPart.part(); IFigure figure = part.getFigure(); @@ -154,10 +155,10 @@ public class EdgeLabelsMoveTest extends AbstractSiriusSwtBotGefTestCase { int originalX = part.getFigure().getBounds().x; int originalY = part.getFigure().getBounds().y; CheckEditPartMoved checkEditPartMoved = new CheckEditPartMoved(editPart); - diagramEditor.dragWithKey(part.getFigure().getBounds().x, part.getFigure().getBounds().y, part.getFigure().getBounds().x - 10, part.getFigure().getBounds().y - 10, SWT.None); + diagramEditor.dragWithKey(part.getFigure().getBounds().x + 10, part.getFigure().getBounds().y, part.getFigure().getBounds().x + 10, part.getFigure().getBounds().y - 10, SWT.None); bot.waitUntil(checkEditPartMoved); - assertEquals(originalX - 10, part.getFigure().getBounds().x); - assertEquals(originalY - 10, part.getFigure().getBounds().y); + assertEquals("The x coordinate should be the same as the move is only on y axis.", originalX, part.getFigure().getBounds().x); + assertEquals("The y coordinate should be different as the label has been moved by moving its border.", originalY - 10, part.getFigure().getBounds().y); } } |
