diff options
| author | Laurent Redor | 2014-12-05 12:44:30 +0000 |
|---|---|---|
| committer | Laurent Redor | 2014-12-05 12:44:30 +0000 |
| commit | 643a839ed2a9dadc44d4b85df3077321d883fbd1 (patch) | |
| tree | f0d3ee8c2cc6dc5429997082aa12bee998838c53 | |
| parent | a72dabf337ee8252b6987b1aebf037dba993564e (diff) | |
| download | org.eclipse.sirius-643a839ed2a9dadc44d4b85df3077321d883fbd1.tar.gz org.eclipse.sirius-643a839ed2a9dadc44d4b85df3077321d883fbd1.tar.xz org.eclipse.sirius-643a839ed2a9dadc44d4b85df3077321d883fbd1.zip | |
[test] Add a delta of 1 for GMF bendpoints.
The result is different locally and on Hudson. This delta allows some
failures caused by round problem.
Change-Id: I6394b4556702bdc1dfd2ecbf396a32edba3b4412
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.java | 9 |
1 files changed, 6 insertions, 3 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 cdc990601e..26004ced67 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 @@ -38,8 +38,10 @@ import org.eclipse.sirius.tests.swtbot.Activator; import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase; import org.eclipse.sirius.tests.swtbot.support.api.business.UIResource; import org.eclipse.sirius.tests.swtbot.support.api.editor.SWTBotSiriusDiagramEditor; +import org.eclipse.sirius.tests.swtbot.support.api.matcher.geometry.PointAround; import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefConnectionEditPart; import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart; +import org.hamcrest.core.IsNot; import org.junit.Assert; /** @@ -443,6 +445,7 @@ public abstract class AbstractUmlDragAndDropTest extends AbstractSiriusSwtBotGef Point newPoint = newPoints.getPoint(i); Assert.assertEquals("The two points at index " + i + " should be equal", originalPoint, newPoint); Assert.assertEquals("The two GMF points at index " + i + " should be equal", originalGmfPointsFromSource.get(i), newGMFBendpointsFromSource.get(i)); + assertThat("The two GMF points at index " + i + " should be equal", newGMFBendpointsFromSource.get(i), PointAround.around(originalGmfPointsFromSource.get(i), 1)); } // moved points @@ -450,7 +453,7 @@ public abstract class AbstractUmlDragAndDropTest extends AbstractSiriusSwtBotGef Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertNotEquals("The two points at index " + i + " should be different", originalPoint, newPoint); - Assert.assertNotEquals("The two GMF points at index " + i + " should be different", originalGmfPointsFromSource.get(i), newGMFBendpointsFromSource.get(i)); + assertThat("The two GMF points at index " + i + " should be different", newGMFBendpointsFromSource.get(i), IsNot.not(PointAround.around(originalGmfPointsFromSource.get(i), 1))); } } else { // EdgeRouting.STRAIGHT: the first point has moved @@ -462,7 +465,7 @@ public abstract class AbstractUmlDragAndDropTest extends AbstractSiriusSwtBotGef Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertNotEquals("The two points at index " + i + " should be different", originalPoint, newPoint); - Assert.assertNotEquals("The two GMF points at index " + i + " should be different", originalGmfPointsFromSource.get(i), newGMFBendpointsFromSource.get(i)); + assertThat("The two GMF points at index " + i + " should be different", newGMFBendpointsFromSource.get(i), IsNot.not(PointAround.around(originalGmfPointsFromSource.get(i), 1))); } // unmoved points @@ -470,7 +473,7 @@ public abstract class AbstractUmlDragAndDropTest extends AbstractSiriusSwtBotGef Point originalPoint = originalPoints.getPoint(i); Point newPoint = newPoints.getPoint(i); Assert.assertEquals("The two points at index " + i + " should be equal", originalPoint, newPoint); - Assert.assertEquals("The two GMF points at index " + i + " should be equal", originalGmfPointsFromSource.get(i), newGMFBendpointsFromSource.get(i)); + assertThat("The two GMF points at index " + i + " should be equal", newGMFBendpointsFromSource.get(i), PointAround.around(originalGmfPointsFromSource.get(i), 1)); } } if (isEquals(originalPoints, originalGmfPointsFromSource) && !isEquals(newPoints, newGMFBendpointsFromSource)) { |
