Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2014-12-05 11:28:03 +0000
committerLaurent Redor2014-12-05 11:52:39 +0000
commit033f76194cef24a8fbc14ef48cd0c342821d15ee (patch)
treea235b498199527846bbab92356ed7a7ac233ce05
parentd7ecac45b5bb65df363bdd5a021c5f6a862ca615 (diff)
downloadorg.eclipse.sirius-033f76194cef24a8fbc14ef48cd0c342821d15ee.tar.gz
org.eclipse.sirius-033f76194cef24a8fbc14ef48cd0c342821d15ee.tar.xz
org.eclipse.sirius-033f76194cef24a8fbc14ef48cd0c342821d15ee.zip
[test] Cleanup tests by disabling snapToGrid.
This avoids to use PointAround.around matcher and allow to use an assertEquals instead. Change-Id: If78d8c5f876350284b7d0256df1170c8ef729446 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/AbstractUmlDragAndDropTest.java2
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/UmlPortMoveTest.java14
2 files changed, 4 insertions, 12 deletions
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/AbstractUmlDragAndDropTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/AbstractUmlDragAndDropTest.java
index 3ffa35eb85..cdc990601e 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/AbstractUmlDragAndDropTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/AbstractUmlDragAndDropTest.java
@@ -105,7 +105,6 @@ public abstract class AbstractUmlDragAndDropTest extends AbstractSiriusSwtBotGef
sessionAirdResource = new UIResource(designerProject, FILE_DIR, SESSION_FILE);
localSession = designerPerspective.openSessionFromFile(sessionAirdResource);
editor = openAndGetEditor(getRepresentationDescriptionName(), getRepresentationNameToOpen());
- editor.setSnapToGrid(false);
}
/**
@@ -147,6 +146,7 @@ public abstract class AbstractUmlDragAndDropTest extends AbstractSiriusSwtBotGef
protected SWTBotSiriusDiagramEditor openAndGetEditor(final String representationDescriptionName, final String representationName) {
final SWTBotSiriusDiagramEditor editor = openDiagram(localSession.getOpenedSession(), representationDescriptionName, representationName, DDiagram.class);
editor.zoomDefault();
+ editor.setSnapToGrid(false);
return editor;
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/UmlPortMoveTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/UmlPortMoveTest.java
index 30a3b7c153..d0a9e9d84b 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/UmlPortMoveTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/uml/UmlPortMoveTest.java
@@ -25,7 +25,6 @@ import org.eclipse.draw2d.geometry.PointList;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramBorderNodeEditPart;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIDiagramRepresentation.ZoomLevel;
-import org.eclipse.sirius.tests.swtbot.support.api.matcher.geometry.PointAround;
/**
* This class test moving and drag'and'drop ports.
@@ -39,16 +38,10 @@ public class UmlPortMoveTest extends AbstractUmlDragAndDropTest {
private static final String DND_REPRESENTATION_NAME = "Component Diagram";
- private static final String MOVE_DIAGRAM_NAME_PREFIX = "Move ";
-
- private static final String RESIZE_DIAGRAM_NAME_PREFIX = "Resize ";
-
private static final String MOVE_REPRESENTATION_PORT_ON_CONTAINER_NAME = "Component Diagram-MovePortOnContainer";
private static final String MOVE_REPRESENTATION_PORT_ON_CONTAINER_IN_CONTAINER_NAME = "Component Diagram-MovePortOnContainerInContainer";
- private static final String MOVE_REPRESENTATION_PORT_ON_NODE_NAME = "Component Diagram-MovePortOnNode";
-
private static final String MOVE_REPRESENTATION_PORT_ON_NODE_IN_CONTAINER_NAME = "Component Diagram-MovePortOnNodeInContainer";
private static final String MOVE_REPRESENTATION_PORT_ON_PORT_ON_CONTAINER_NAME = "Component Diagram-MovePortOnPortOnContainer";
@@ -170,7 +163,7 @@ public class UmlPortMoveTest extends AbstractUmlDragAndDropTest {
final Rectangle newPortBounds = getEditPartBounds(DROP_PORT_NAME);
- assertThat("Port is not at expected position (it may have changed of container)", newPortBounds.getTopRight(), PointAround.around(originalTopRight.getTranslated(translation), 5));
+ assertEquals("Port is not at expected position (it may have changed of container)", newPortBounds.getTopRight(), originalTopRight.getTranslated(translation));
}
/**
@@ -305,8 +298,7 @@ public class UmlPortMoveTest extends AbstractUmlDragAndDropTest {
// Get the new bounds and compare with the expected
final Rectangle newPortBounds = getEditPartBounds(DROP_PORT_NAME);
if (checkMoving) {
- assertThat("Port is not at expected position (probably not moved but resized)", newPortBounds.getTopRight(),
- PointAround.around(originalPortBounds.getTopRight().getTranslated(VERTICAL_TRANSLATION), 5));
+ assertEquals("Port is not at expected position (probably not moved but resized)", newPortBounds.getTopRight(), originalPortBounds.getTopRight().getTranslated(VERTICAL_TRANSLATION));
if (originalDraw2DPoints != null && originalGmfPointsFromSource != null) {
// check the stability of the existing edge when moving the
@@ -314,7 +306,7 @@ public class UmlPortMoveTest extends AbstractUmlDragAndDropTest {
checkEdgeStability(DROP_PORT_NAME, AbstractDiagramBorderNodeEditPart.class, originalDraw2DPoints, originalGmfPointsFromSource);
}
} else {
- assertThat("Port is not at expected position (probably not moved but resized)", newPortBounds.getTopRight(), PointAround.around(originalPortBounds.getTopRight(), 0));
+ assertEquals("Port is not at expected position (probably not moved but resized)", newPortBounds.getTopRight(), originalPortBounds.getTopRight());
}
}
}

Back to the top