Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2018-12-05 07:34:25 +0000
committerLaurent Redor2018-12-06 17:23:45 +0000
commit10c64b1362d9bd87b105f73db890f46594853569 (patch)
tree4dd3a02441d78a35e326d0abe01209ae30d004b2
parent571e009c9f0f9c7c11437e5957d9de7360a21b87 (diff)
downloadorg.eclipse.sirius-10c64b1362d9bd87b105f73db890f46594853569.tar.gz
org.eclipse.sirius-10c64b1362d9bd87b105f73db890f46594853569.tar.xz
org.eclipse.sirius-10c64b1362d9bd87b105f73db890f46594853569.zip
[542480] Disable snapToGrid for some tests of DragNDropTest
Before this commit, the snapToGrid is enabled by default, even if it was not expected. This commit also removes the delta used for some tests as the cause seemed to be the enablement of snapToGrid. Bug: 542480 Change-Id: Ic96b25f09aa7c43db97db3ddbc1e0883b6b10ca3 Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java16
1 files changed, 11 insertions, 5 deletions
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java
index c1750d7a23..9123e767b0 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java
@@ -145,6 +145,8 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_NAME_2, REPRESENTATION_INSTANCE_2BLANK, DDiagram.class);
if (snapToGrid) {
editor.setSnapToGrid(true, GRID_STEP, 2);
+ } else {
+ editor.setSnapToGrid(false);
}
}
@@ -155,6 +157,8 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_NAME_5, REPRESENTATION_INSTANCE_5BLANK, DDiagram.class);
if (snapToGrid) {
editor.setSnapToGrid(true, GRID_STEP, 2);
+ } else {
+ editor.setSnapToGrid(false);
}
}
@@ -162,7 +166,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
* Open "Test no NPE raised during DND" diagram.
*/
private void openRepresentation3() {
- editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_NAME_3, TEST_NO_NPE_RAISED_DURING_DND, DDiagram.class);
+ editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_NAME_3, TEST_NO_NPE_RAISED_DURING_DND, DDiagram.class, !snapToGrid);
}
/**
@@ -172,6 +176,8 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), REPRESENTATION_NAME_6, REPRESENTATION_INSTANCE_6BLANK, DDiagram.class);
if (snapToGrid) {
editor.setSnapToGrid(true, GRID_STEP, 2);
+ } else {
+ editor.setSnapToGrid(false);
}
}
@@ -320,8 +326,8 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
Point p2Location = editor.getBounds(p2Bot).getTopLeft();
if (!snapToGrid) {
- assertEquals(targetLocation.x, p2Location.x, 2);
- assertEquals(targetLocation.y, p2Location.y, 2);
+ assertEquals(targetLocation.x, p2Location.x);
+ assertEquals(targetLocation.y, p2Location.y);
}
assertEquals("An error message was generated !", rowCount, errorLogBot.tree().rowCount());
@@ -522,8 +528,8 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
// grid.
// The snap will be check in checkEditPartLocation method.
if (!snapToGrid) {
- assertEquals(targetCenter.x, p2Location.x, 4);
- assertEquals(targetCenter.y, p2Location.y, 4);
+ assertEquals(targetCenter.x, p2Location.x);
+ assertEquals(targetCenter.y, p2Location.y);
}
assertEquals("An error message was generated !", rowCount, errorLogBot.tree().rowCount());

Back to the top