Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLaurent Redor2017-08-16 16:55:33 +0000
committerFlorian Barbin2017-08-25 14:31:16 +0000
commitadd47270fc166182e7cc4ee6f777661fb0109ecd (patch)
tree5697e59d84cb22526662e8d88ed840a326d59080
parentd318854aa942cea691efd02be07263b20eceb057 (diff)
downloadorg.eclipse.sirius-add47270fc166182e7cc4ee6f777661fb0109ecd.tar.gz
org.eclipse.sirius-add47270fc166182e7cc4ee6f777661fb0109ecd.tar.xz
org.eclipse.sirius-add47270fc166182e7cc4ee6f777661fb0109ecd.zip
[520881] Complete existing tests
This commit improves the code coverage of existing tests. It allows to find some bugs before addressing the bug 520881. In BorderedNodeCreationTest, in assertBorderedNodeAtLocation(), we check the Draw2D location of the border node and now the GMF location. This required the addition of org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper.getAbsoluteBoundsIn100Percent(GraphicalEditPart, boolean). The existing GraphicalHelper.getAbsoluteBoundsIn100Percent(GraphicalEditPart) does not consider the scrollbar of containers. This new API is not documented as it is more for internal uses. Several tests of AllCreationTestSuite (*WithSnapToGrid*) will be fixed in following commits, for this issue or for other bugs concerning snapToGrid (like bug 520632). This commit also formats source code of CDBIL. Bug: 520881 Change-Id: Ida20a610d0ab2180cb11b1af098d8f2c352c666e Signed-off-by: Laurent Redor <laurent.redor@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java103
-rw-r--r--plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java73
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/data/unit/tools/creation/borderedNode/borderedNode.aird22
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationNearCollapsedWithSnapToGridTest.java23
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationTest.java114
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationWithSnapToGridTest.java35
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationNearCollapsedWithSnapToGridTest.java24
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationWithSnapToGridTest.java24
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithBorderNodeCreationPositionWithSnapToGridTest.java69
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllCreationTestSuite.java5
10 files changed, 340 insertions, 152 deletions
diff --git a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java
index 83b539d5a4..db145fb402 100644
--- a/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java
+++ b/plugins/org.eclipse.sirius.diagram.ui/src-diag/org/eclipse/sirius/diagram/ui/internal/refresh/borderednode/CanonicalDBorderItemLocator.java
@@ -44,8 +44,8 @@ import org.eclipse.sirius.ext.base.Options;
public class CanonicalDBorderItemLocator {
/**
- * The number of sides. Used to avoid infinite loop exception in there is
- * too many borderNode relative to the size of the container.
+ * The number of sides. Used to avoid infinite loop exception in there is too many borderNode relative to the size
+ * of the container.
*/
private static final int NB_SIDES = 4;
@@ -64,11 +64,9 @@ public class CanonicalDBorderItemLocator {
private BitSet authorizedSides = new BitSet(PositionConstants.NSEW);
/**
- * The parent bounds can be set with
- * {@link #setParentBorderBounds(Rectangle)} if it is known or if the
- * CanonicalDBorderItemLocator must consider a different bounds. If this
- * bounds is not set, it will be computed at the first
- * {@link #getParentBorder()} call.
+ * The parent bounds can be set with {@link #setParentBorderBounds(Rectangle)} if it is known or if the
+ * CanonicalDBorderItemLocator must consider a different bounds. If this bounds is not set, it will be computed at
+ * the first {@link #getParentBorder()} call.
*/
private Rectangle parentBorder;
@@ -132,23 +130,20 @@ public class CanonicalDBorderItemLocator {
}
/**
- * Sets the side of the parent figure on which the border item should
- * appear.
+ * Sets the side of the parent figure on which the border item should appear.
*
* @param side
- * the side on which this border item appears as defined in
- * {@link PositionConstants}
+ * the side on which this border item appears as defined in {@link PositionConstants}
*/
public void setCurrentSideOfParent(int side) {
this.currentSide = side;
}
/**
- * Returns the preferred side of the parent figure on which to place this
- * border item.
+ * Returns the preferred side of the parent figure on which to place this border item.
*
- * @return the preferred side of the parent figure on which to place this
- * border item as defined in {@link PositionConstants}
+ * @return the preferred side of the parent figure on which to place this border item as defined in
+ * {@link PositionConstants}
*/
public int getPreferredSideOfParent() {
return preferredSide;
@@ -175,10 +170,8 @@ public class CanonicalDBorderItemLocator {
* @param parentBorder
* the parent border
* @param authorizedSides
- * the authorized sides. a BitSet using the
- * {@link PositionConstants} values as index. All sides are
- * considered as authorized if the value is null or the bitSet is
- * empty.
+ * the authorized sides. a BitSet using the {@link PositionConstants} values as index. All sides are
+ * considered as authorized if the value is null or the bitSet is empty.
* @return draw constant
*/
private static int findClosestSideOfParent(final Rectangle proposedLocation, final Rectangle parentBorder, BitSet authorizedSides) {
@@ -405,8 +398,7 @@ public class CanonicalDBorderItemLocator {
}
/**
- * Determine if the the given point conflicts with the position of an
- * existing borderItemFigure.
+ * Determine if the the given point conflicts with the position of an existing borderItemFigure.
*
* @param recommendedLocation
* the location to check
@@ -414,8 +406,8 @@ public class CanonicalDBorderItemLocator {
* the size of the bordered node to check
* @param portsNodesToIgnore
* list of nodes to ignore during conflict detection.
- * @return the optional Rectangle of the border item that is in conflict
- * with the given bordered node (a none option)
+ * @return the optional Rectangle of the border item that is in conflict with the given bordered node (a none
+ * option)
*/
private Option<Rectangle> conflicts(final Point recommendedLocation, final Dimension nodeSize, final Collection<Node> portsNodesToIgnore) {
final Rectangle recommendedRect = new Rectangle(recommendedLocation.x, recommendedLocation.y, nodeSize.width, nodeSize.height);
@@ -470,8 +462,7 @@ public class CanonicalDBorderItemLocator {
}
/**
- * Ensure the suggested location actually lies on the parent boundary. The
- * side takes precedence.
+ * Ensure the suggested location actually lies on the parent boundary. The side takes precedence.
*
* @param suggestedLocation
* suggested location
@@ -547,10 +538,8 @@ public class CanonicalDBorderItemLocator {
/**
* Locate the recommendedLocation on the south border :
* <UL>
- * <LI>Search alternately to the left and to the right until find an
- * available space</LI>
- * <LI>And finally if there is no space on this border search on the east
- * border.</LI>
+ * <LI>Search alternately to the left and to the right until find an available space</LI>
+ * <LI>And finally if there is no space on this border search on the east border.</LI>
* </UL>
*
* @param recommendedLocation
@@ -643,10 +632,8 @@ public class CanonicalDBorderItemLocator {
/**
* Locate the recommendedLocation on the north border :
* <UL>
- * <LI>Search alternately to the left and to the right until find an
- * available space</LI>
- * <LI>And finally if there is no space on this border search on the west
- * border.</LI>
+ * <LI>Search alternately to the left and to the right until find an available space</LI>
+ * <LI>And finally if there is no space on this border search on the west border.</LI>
* </UL>
*
* @param recommendedLocation
@@ -739,10 +726,8 @@ public class CanonicalDBorderItemLocator {
/**
* Locate the recommendedLocation on the west border :
* <UL>
- * <LI>Search alternately upward and downward until find an available space
- * </LI>
- * <LI>And finally if there is no space on this border search on the south
- * border.</LI>
+ * <LI>Search alternately upward and downward until find an available space</LI>
+ * <LI>And finally if there is no space on this border search on the south border.</LI>
* </UL>
*
* @param recommendedLocation
@@ -835,10 +820,8 @@ public class CanonicalDBorderItemLocator {
/**
* Locate the recommendedLocation on the east border :
* <UL>
- * <LI>Search alternately upward and downward until find an available space
- * </LI>
- * <LI>And finally if there is no space on this border search on the north
- * border.</LI>
+ * <LI>Search alternately upward and downward until find an available space</LI>
+ * <LI>And finally if there is no space on this border search on the north border.</LI>
* </UL>
*
* @param recommendedLocation
@@ -929,12 +912,11 @@ public class CanonicalDBorderItemLocator {
}
/**
- * Sets the preferred side of the parent figure on which to place this
- * border item.
+ * Sets the preferred side of the parent figure on which to place this border item.
*
* @param preferredSide
- * the preferred side of the parent figure on which to place this
- * border item as defined in {@link PositionConstants}
+ * the preferred side of the parent figure on which to place this border item as defined in
+ * {@link PositionConstants}
*/
// CHECKSTYLE:OFF
public void setPreferredSideOfParent(int preferredSide) {
@@ -951,11 +933,9 @@ public class CanonicalDBorderItemLocator {
}
/**
- * Returns the side of the parent figure on which the border item is
- * currently on.
+ * Returns the side of the parent figure on which the border item is currently on.
*
- * @return the side on which this border item appears as defined in
- * {@link PositionConstants}
+ * @return the side on which this border item appears as defined in {@link PositionConstants}
*/
public int getCurrentSideOfParent() {
return currentSide;
@@ -975,12 +955,11 @@ public class CanonicalDBorderItemLocator {
}
/**
- * Set the parent border bounds if it is known. If this bounds is not set,
- * it will be computed at the first {@link #getParentBorder()} call.
+ * Set the parent border bounds if it is known. If this bounds is not set, it will be computed at the first
+ * {@link #getParentBorder()} call.
*
* @param parentBounds
- * The bounds to consider for this
- * {@link CanonicalDBorderItemLocator}.
+ * The bounds to consider for this {@link CanonicalDBorderItemLocator}.
*/
public void setParentBorderBounds(Rectangle parentBounds) {
parentBorder = parentBounds;
@@ -991,16 +970,14 @@ public class CanonicalDBorderItemLocator {
}
/**
- * Returns a suitable location for the border item given a proposed Bounds.
- * By implementing this method, the feedback shown when the user moves a
- * border item can reflect where the locator will actually place the border
+ * Returns a suitable location for the border item given a proposed Bounds. By implementing this method, the
+ * feedback shown when the user moves a border item can reflect where the locator will actually place the border
* item.
* <p>
- * For example, if the border item is restricted to being on the border of
- * its parent shape, when the user attempts to move the border item outside
- * the border of the parent shape (the proposed bounds), the feedback will
- * always show the border item on the border. In this case, this method
- * would return a location on the border close to the proposed location.
+ * For example, if the border item is restricted to being on the border of its parent shape, when the user attempts
+ * to move the border item outside the border of the parent shape (the proposed bounds), the feedback will always
+ * show the border item on the border. In this case, this method would return a location on the border close to the
+ * proposed location.
* </p>
*
* @param proposedBounds
@@ -1008,8 +985,8 @@ public class CanonicalDBorderItemLocator {
* @param borderItem
* the border item in question
* @param portsNodesToIgnore
- * list of nodes to ignore during conflict detection. This list
- * must contain at least the <code>borderItem</code>.
+ * list of nodes to ignore during conflict detection. This list must contain at least the
+ * <code>borderItem</code>.
* @return a Point corresponding to the valid location
*/
public Point getValidLocation(Rectangle proposedBounds, Node borderItem, final Collection<Node> portsNodesToIgnore) {
diff --git a/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java
index ddbc5a8a9f..5147cca292 100644
--- a/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java
+++ b/plugins/org.eclipse.sirius.ext.gmf.runtime/src/org/eclipse/sirius/ext/gmf/runtime/editparts/GraphicalHelper.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2011, 2015 THALES GLOBAL SERVICES.
+ * Copyright (c) 2011, 2017 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
@@ -14,6 +14,7 @@ import java.util.List;
import org.eclipse.draw2d.FigureCanvas;
import org.eclipse.draw2d.FreeformViewport;
+import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PointList;
@@ -183,6 +184,33 @@ public final class GraphicalHelper {
}
/**
+ * Returns the difference between the logical origin (0, 0) and the top-left point actually visible. This
+ * corresponds to how much the scrollbars "shift" the successive containers.
+ *
+ * @param part
+ * an edit part on the view
+ * @return the scroll size
+ */
+ protected static Point getContainerScrollSize(GraphicalEditPart part) {
+ Preconditions.checkNotNull(part);
+ Point result = new Point(0, 0);
+ Point diagramScrollSize = new Point(0, 0);
+
+ IFigure current = part.getFigure();
+ FreeformViewport rootFreeformViewport = null;
+ while (current != null) {
+ if (current instanceof FreeformViewport) {
+ rootFreeformViewport = (FreeformViewport) current;
+ diagramScrollSize = rootFreeformViewport.getViewLocation();
+ result.translate(diagramScrollSize);
+ }
+ current = current.getParent();
+ }
+ result.translate(diagramScrollSize.negate());
+ return result;
+ }
+
+ /**
* .
*
* @param part
@@ -228,14 +256,32 @@ public final class GraphicalHelper {
* a part from the diagram.
*/
public static void screen2logical(Rectangle rect, GraphicalEditPart part) {
+ screen2logical(rect, part, false);
+ }
+
+ /**
+ * Converts a rectangle from screen coordinates to logical coordinates.
+ *
+ * @param rect
+ * the rectangle to convert.
+ * @param part
+ * a part from the diagram.
+ * @param considerAllScroll
+ * In all cases, the scroll of the diagram is used, but the scroll of containers are considered only if
+ * this parameter is true.
+ */
+ protected static void screen2logical(Rectangle rect, GraphicalEditPart part, boolean considerAllScroll) {
+ double zoom = GraphicalHelper.getZoom(part);
+ if (considerAllScroll) {
+ rect.translate(GraphicalHelper.getContainerScrollSize(part).scale(zoom));
+ }
rect.translate(GraphicalHelper.getScrollSize(part));
- rect.performScale(1.0d / GraphicalHelper.getZoom(part));
+ rect.performScale(1.0d / zoom);
}
/**
- * Converts a dimension from screen coordinates to logical coordinates.
- * Dimensions have no defined position, so only the current zoom level is
- * take into account, not the scroll state.
+ * Converts a dimension from screen coordinates to logical coordinates. Dimensions have no defined position, so only
+ * the current zoom level is take into account, not the scroll state.
*
* @param dim
* the dimension to convert.
@@ -551,6 +597,21 @@ public final class GraphicalHelper {
* @return The absolute bounds.
*/
public static Rectangle getAbsoluteBoundsIn100Percent(GraphicalEditPart part) {
+ return getAbsoluteBoundsIn100Percent(part, false);
+ }
+
+ /**
+ * Get the absolute bounds of this <code>part</code>. In case of zoom or/and scrollbars, the bounds are converted
+ * from screen to logical.<BR>
+ *
+ * @param part
+ * The part to consider.
+ * @param considerAllScroll
+ * In all cases, the scroll of the diagram is used, but the scroll of containers are considered only if
+ * this parameter is true.
+ * @return The absolute bounds.
+ */
+ public static Rectangle getAbsoluteBoundsIn100Percent(GraphicalEditPart part, boolean considerAllScroll) {
PrecisionRectangle bounds;
if (part.getFigure() instanceof HandleBounds) {
bounds = new PrecisionRectangle(((HandleBounds) part.getFigure()).getHandleBounds());
@@ -558,7 +619,7 @@ public final class GraphicalHelper {
bounds = new PrecisionRectangle(part.getFigure().getBounds());
}
part.getFigure().translateToAbsolute(bounds);
- screen2logical(bounds, part);
+ screen2logical(bounds, part, considerAllScroll);
return bounds;
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/tools/creation/borderedNode/borderedNode.aird b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/tools/creation/borderedNode/borderedNode.aird
index b3bf93809e..47c52445ee 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/data/unit/tools/creation/borderedNode/borderedNode.aird
+++ b/plugins/org.eclipse.sirius.tests.swtbot/data/unit/tools/creation/borderedNode/borderedNode.aird
@@ -7,7 +7,7 @@
<data xmi:type="notation:Diagram" xmi:id="_83PZoWlnEeKsCtNUNlpK4A" type="Sirius" element="_82_iAGlnEeKsCtNUNlpK4A" measurementUnit="Pixel">
<children xmi:type="notation:Node" xmi:id="_83QAsGlnEeKsCtNUNlpK4A" type="2001" element="_82_iAWlnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83QnwGlnEeKsCtNUNlpK4A" type="5002">
- <layoutConstraint xmi:type="notation:Location" xmi:id="_-RBQAWlnEeKsCtNUNlpK4A" x="87"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_-RBQAWlnEeKsCtNUNlpK4A" x="87" y="20"/>
</children>
<children xmi:type="notation:Node" xmi:id="_83USIGlnEeKsCtNUNlpK4A" type="3003" element="_82_iAmlnEeKsCtNUNlpK4A">
<styles xmi:type="notation:ShapeStyle" xmi:id="_83USIWlnEeKsCtNUNlpK4A" fontName="Comic Sans MS"/>
@@ -32,7 +32,7 @@
<children xmi:type="notation:Node" xmi:id="_83RO0WlnEeKsCtNUNlpK4A" type="7001">
<children xmi:type="notation:Node" xmi:id="_83X8gGlnEeKsCtNUNlpK4A" type="3007" element="_82_iC2lnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83YjkGlnEeKsCtNUNlpK4A" type="5003">
- <layoutConstraint xmi:type="notation:Location" xmi:id="_-RCeI2lnEeKsCtNUNlpK4A" x="31" y="5"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_-RCeI2lnEeKsCtNUNlpK4A" x="31" y="14"/>
</children>
<children xmi:type="notation:Node" xmi:id="_83ZKoGlnEeKsCtNUNlpK4A" type="3001" element="_82_iDGlnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83ZxsGlnEeKsCtNUNlpK4A" type="5001">
@@ -61,7 +61,7 @@
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_aAFPkWr-EeKUzcXlhUGLrg" x="28" y="1" width="1" height="1"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_83X8gWlnEeKsCtNUNlpK4A" fontName="Comic Sans MS" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RB3EWlnEeKsCtNUNlpK4A" x="35" y="59" width="60" height="30"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RB3EWlnEeKsCtNUNlpK4A" x="35" y="60" width="60" height="30"/>
</children>
<styles xmi:type="notation:SortingStyle" xmi:id="_83RO0mlnEeKsCtNUNlpK4A"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_83RO02lnEeKsCtNUNlpK4A"/>
@@ -85,7 +85,7 @@
<children xmi:type="notation:Node" xmi:id="_83Sc8GlnEeKsCtNUNlpK4A" type="7001">
<children xmi:type="notation:Node" xmi:id="_83c1AGlnEeKsCtNUNlpK4A" type="3007" element="_82_iH2lnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83dcEGlnEeKsCtNUNlpK4A" type="5003">
- <layoutConstraint xmi:type="notation:Location" xmi:id="_-RDsQmlnEeKsCtNUNlpK4A" x="91" y="5"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_-RDsQmlnEeKsCtNUNlpK4A" x="91" y="20"/>
</children>
<children xmi:type="notation:Node" xmi:id="_83eDIGlnEeKsCtNUNlpK4A" type="3001" element="_82_iIGlnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83eDI2lnEeKsCtNUNlpK4A" type="5001">
@@ -125,7 +125,7 @@
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_aAHEwGr-EeKUzcXlhUGLrg" x="52" y="1" width="1" height="1"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_83c1AWlnEeKsCtNUNlpK4A" fontName="Comic Sans MS" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RDFMWlnEeKsCtNUNlpK4A" x="130" y="48" width="120" height="60"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RDFMWlnEeKsCtNUNlpK4A" x="131" y="48" width="120" height="59"/>
</children>
<styles xmi:type="notation:SortingStyle" xmi:id="_83Sc8WlnEeKsCtNUNlpK4A"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_83Sc8mlnEeKsCtNUNlpK4A"/>
@@ -142,7 +142,7 @@
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_aAF2oWr-EeKUzcXlhUGLrg" x="103" y="1" width="1" height="1"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_83R14WlnEeKsCtNUNlpK4A" fontName="Comic Sans MS" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RDFMGlnEeKsCtNUNlpK4A" x="266" y="106" width="178" height="88"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RDFMGlnEeKsCtNUNlpK4A" x="268" y="106" width="177" height="88"/>
</children>
<children xmi:type="notation:Node" xmi:id="_83Sc82lnEeKsCtNUNlpK4A" type="2002" element="_83AJGWlnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83TEAGlnEeKsCtNUNlpK4A" type="5006"/>
@@ -182,7 +182,7 @@
</children>
<children xmi:type="notation:Node" xmi:id="_83htgmlnEeKsCtNUNlpK4A" type="3007" element="_83AJLWlnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83iUkGlnEeKsCtNUNlpK4A" type="5003">
- <layoutConstraint xmi:type="notation:Location" xmi:id="_-RFhdGlnEeKsCtNUNlpK4A" x="85" y="3"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_-RFhdGlnEeKsCtNUNlpK4A" x="95" y="-17"/>
</children>
<children xmi:type="notation:Node" xmi:id="_83n0IGlnEeKsCtNUNlpK4A" type="3001" element="_83AJM2lnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83obMGlnEeKsCtNUNlpK4A" type="5001">
@@ -193,7 +193,7 @@
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_83regmlnEeKsCtNUNlpK4A"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_83n0IWlnEeKsCtNUNlpK4A" fontName="Comic Sans MS" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RE6YmlnEeKsCtNUNlpK4A" x="-2" y="11" width="10" height="10"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RE6YmlnEeKsCtNUNlpK4A" x="-2" y="13" width="10" height="10"/>
</children>
<children xmi:type="notation:Node" xmi:id="_83pCQGlnEeKsCtNUNlpK4A" type="3001" element="_83AJOGlnEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_83ppUGlnEeKsCtNUNlpK4A" type="5001">
@@ -204,7 +204,7 @@
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_83sFkmlnEeKsCtNUNlpK4A"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_83pCQWlnEeKsCtNUNlpK4A" fontName="Comic Sans MS" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RFhcmlnEeKsCtNUNlpK4A" x="-2" y="22" width="10" height="10"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RFhcmlnEeKsCtNUNlpK4A" x="-2" y="24" width="10" height="10"/>
</children>
<children xmi:type="notation:Node" xmi:id="_83qQYGlnEeKsCtNUNlpK4A" type="3003" element="_83AJPWlnEeKsCtNUNlpK4A">
<styles xmi:type="notation:ShapeStyle" xmi:id="_83qQYWlnEeKsCtNUNlpK4A" fontName="Comic Sans MS"/>
@@ -222,7 +222,7 @@
<layoutConstraint xmi:type="notation:Bounds" xmi:id="_aALWMWr-EeKUzcXlhUGLrg" x="22" y="1" width="1" height="1"/>
</children>
<styles xmi:type="notation:ShapeStyle" xmi:id="_83htg2lnEeKsCtNUNlpK4A" fontName="Comic Sans MS" fontHeight="8"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RE6YWlnEeKsCtNUNlpK4A" x="171" y="36" width="84" height="51"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_-RE6YWlnEeKsCtNUNlpK4A" x="171" y="36" width="147" height="51"/>
</children>
<styles xmi:type="notation:SortingStyle" xmi:id="_83TEAmlnEeKsCtNUNlpK4A"/>
<styles xmi:type="notation:FilteringStyle" xmi:id="_83TEA2lnEeKsCtNUNlpK4A"/>
@@ -263,7 +263,7 @@
</children>
<children xmi:type="notation:Node" xmi:id="_sgRD0GlqEeKsCtNUNlpK4A" type="2001" element="_sgGEsGlqEeKsCtNUNlpK4A">
<children xmi:type="notation:Node" xmi:id="_sgSR8GlqEeKsCtNUNlpK4A" type="5002">
- <layoutConstraint xmi:type="notation:Location" xmi:id="_sgSR8WlqEeKsCtNUNlpK4A" x="117"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_sgSR8WlqEeKsCtNUNlpK4A" x="117" y ="20"/>
</children>
<children xmi:type="notation:Node" xmi:id="_sgS5AGlqEeKsCtNUNlpK4A" type="3003" element="_sgGrwGlqEeKsCtNUNlpK4A">
<styles xmi:type="notation:ShapeStyle" xmi:id="_sgS5AWlqEeKsCtNUNlpK4A" fontName="Comic Sans MS"/>
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationNearCollapsedWithSnapToGridTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationNearCollapsedWithSnapToGridTest.java
index 2b8e7bbfe0..96aa108ca0 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationNearCollapsedWithSnapToGridTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationNearCollapsedWithSnapToGridTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2017 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
@@ -15,7 +15,9 @@ import org.eclipse.draw2d.ScalableFigure;
import org.eclipse.draw2d.Viewport;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PrecisionPoint;
+import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper;
/**
* Same tests as {@link BorderedNodeCreationNearCollapsedTest} but with
@@ -25,11 +27,16 @@ import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
*/
public class BorderedNodeCreationNearCollapsedWithSnapToGridTest extends BorderedNodeCreationNearCollapsedTest {
+ /**
+ * The grid spacing in pixels.
+ */
+ private static final int GRID_SPACING = 100;
+
@Override
protected void setUp() throws Exception {
super.setUp();
- editor.setSnapToGrid(true, 100, 2);
+ editor.setSnapToGrid(true, GRID_SPACING, 2);
}
/**
@@ -69,10 +76,14 @@ public class BorderedNodeCreationNearCollapsedWithSnapToGridTest extends Bordere
errorMessage += " expected <Point(" + nodeLocation.x + ", " + snapToLocation.y + ")> or <Point(" + nodeLocation.x + ", " + expectedLocation.y + ")> but was:" + nodeLocation;
assertTrue(errorMessage, nodeLocation.y == snapToLocation.y);
} else {
- errorMessage += " expected <Point(" + expectedLocation.x + ", " + absoluteSnapToLocation.y + ")> or <Point(" + absoluteSnapToLocation.x + ", " + expectedLocation.y + ")> but was:"
- + nodeLocation;
- assertTrue(errorMessage, nodeLocation.x == expectedLocation.x && nodeLocation.y == absoluteSnapToLocation.y || nodeLocation.x == absoluteSnapToLocation.x
- && nodeLocation.y == expectedLocation.y);
+ // Get the absolute bounds of parent
+ Rectangle parentBounds = GraphicalHelper.getAbsoluteBoundsIn100Percent(parentPart, true);
+
+ errorMessage += " At least x or y must be on the grid (grid spacing = " + GRID_SPACING + "), but was: " + nodeLocation + "for parent: " + parentBounds;
+
+ assertTrue(errorMessage,
+ (nodeLocation.x % GRID_SPACING == 0 && (nodeLocation.y == expectedLocation.y || nodeLocation.y == parentLocation.y - 2 || nodeLocation.y == parentBounds.bottom() - 8))
+ || ((nodeLocation.x == expectedLocation.x || nodeLocation.x == parentLocation.x - 2 || nodeLocation.x == parentBounds.right() - 8) && nodeLocation.y % GRID_SPACING == 0));
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationTest.java
index e571f64813..8b2e6cb35d 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2017 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
@@ -25,10 +25,10 @@ import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramBorderNodeEdit
import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramContainerEditPart;
import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramNodeEditPart;
import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper;
+import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper;
import org.eclipse.sirius.ext.base.Option;
import org.eclipse.sirius.tests.swtbot.support.api.AbstractSiriusSwtBotGefTestCase;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIDiagramRepresentation.ZoomLevel;
-import org.eclipse.sirius.tests.swtbot.support.api.business.UILocalSession;
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.view.DesignerViews;
@@ -118,15 +118,6 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
private static final String CLASS_4_NAME = "Class4";
- private UIResource sessionAirdResource;
-
- private UILocalSession localSession;
-
- /**
- * Current editor.
- */
- protected SWTBotSiriusDiagramEditor editor;
-
/**
* If true, the creation will be made near the bordered node named
* "elementToRevealName + collapse" (this bordered node should exist), 1
@@ -254,6 +245,25 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
* created, this class is revealed before creation.
*/
protected void testBNC_OnNode(ZoomLevel zoomLevel, String classToRevealName) {
+ testBNC_OnNode(zoomLevel, classToRevealName, true);
+ }
+
+ /**
+ * Ensures that a bordered node created on a Node (with Scroll) has the
+ * expected location.
+ *
+ * @param zoomLevel
+ * the zoomLevel to set on the editor
+ * @param classToRevealName
+ * the name of the class on which the bordered node will be
+ * created, this class is revealed before creation.
+ * @param eastAndSouthCases
+ * true if the east and south cases must be tested, false
+ * otherwise (if the node is in the container the reveal does not
+ * reveal east and south sides so it is not possible to created
+ * border nodes on these sides).
+ */
+ protected void testBNC_OnNode(ZoomLevel zoomLevel, String classToRevealName, boolean eastAndSouthCases) {
editor.zoom(zoomLevel);
SWTBotGefEditPart classEditPart = editor.getEditPart(classToRevealName, AbstractDiagramNodeEditPart.class);
@@ -287,9 +297,13 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
} else {
fail("Problem during getting expanded bounds of the collapse bordered node.");
}
+ testBNC_OnNodeFinalCheck(classEditPart, classAbsoluteLocation, creationLocation, absoluteExpectedLocation);
} else {
- // Try to locate the bordered node at 8 pixels to the top-left
- // corner of the class
+ // To increase code coverage the 4 corners are tested
+ Rectangle classBounds = editor.getAbsoluteBounds(classEditPart);
+
+ // Try to locate the bordered node at the top-left corner of the
+ // class (on north side)
Point delta = new Point(8, 0);
// We compute the location according the the class location, the
// zoom factor and an insets to be sure to be in the class and not
@@ -300,7 +314,58 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
// bordered node make by BorderItemLocator
// (IBorderItemOffsets.DEFAULT_OFFSET - size of the node).
absoluteExpectedLocation = classAbsoluteLocation.getTranslated(delta.translate(0, -2));
+ testBNC_OnNodeFinalCheck(classEditPart, classAbsoluteLocation, creationLocation, absoluteExpectedLocation);
+ undo(getBorderedNodeCreationOnClassToolName());
+
+ if (eastAndSouthCases) {
+ // Try to locate the bordered node to the top-right corner of
+ // the class (on east side)
+ delta = new Point(classBounds.width - 1, 2);
+ // We compute the location according the the class location and
+ // the zoom factor
+ creationLocation = classLocation.getTranslated(delta.getScaled(zoomLevel.getAmount()));
+ // The expected location is in absolute coordinate the delta is
+ // translate with -7 in y axis corresponding to the shift of the
+ // bordered node make by BorderItemLocator
+ // (IBorderItemOffsets.DEFAULT_OFFSET - size of the node).
+ absoluteExpectedLocation = classAbsoluteLocation.getTranslated(delta.translate(-7, 0));
+ testBNC_OnNodeFinalCheck(classEditPart, classAbsoluteLocation, creationLocation, absoluteExpectedLocation);
+ undo(getBorderedNodeCreationOnClassToolName());
+
+ // Try to locate the bordered node to the bottom-left corner of
+ // the class (on south side)
+ delta = new Point(8, classBounds.height - 4);
+ // We compute the location according the the class location, the
+ // zoom factor and an insets to be sure to be in the class and
+ // not just above.
+ creationLocation = classLocation.getTranslated(delta.getScaled(zoomLevel.getAmount()).translate(0, 1));
+ // The expected location is in absolute coordinate the delta is
+ // translate with -2 in y axis corresponding to the shift of the
+ // bordered node make by BorderItemLocator
+ // (IBorderItemOffsets.DEFAULT_OFFSET - size of the node).
+ absoluteExpectedLocation = classAbsoluteLocation.getTranslated(delta.translate(0, -4));
+ testBNC_OnNodeFinalCheck(classEditPart, classAbsoluteLocation, creationLocation, absoluteExpectedLocation);
+ undo(getBorderedNodeCreationOnClassToolName());
+ }
+
+ // Try to locate the bordered node to the top-left corner of the
+ // class (on west side)
+ delta = new Point(2, 2);
+ // We compute the location according the the class location, the
+ // zoom factor and an insets to be sure to be in the class and not
+ // just above.
+ creationLocation = classLocation.getTranslated(delta.getScaled(zoomLevel.getAmount()));
+ // The expected location is in absolute coordinate the delta is
+ // translate with -2 in y axis corresponding to the shift of the
+ // bordered node make by BorderItemLocator
+ // (IBorderItemOffsets.DEFAULT_OFFSET - size of the node).
+ absoluteExpectedLocation = classAbsoluteLocation.getTranslated(delta.translate(-4, 0));
+ testBNC_OnNodeFinalCheck(classEditPart, classAbsoluteLocation, creationLocation, absoluteExpectedLocation);
}
+
+ }
+
+ private void testBNC_OnNodeFinalCheck(SWTBotGefEditPart classEditPart, Point classAbsoluteLocation, Point creationLocation, Point absoluteExpectedLocation) {
absoluteExpectedLocation = adaptExpectedLocation(((GraphicalEditPart) classEditPart.part()).getFigure(), classAbsoluteLocation, absoluteExpectedLocation);
createBorderedNode(getBorderedNodeCreationOnClassToolName(), creationLocation.x, creationLocation.y);
@@ -552,8 +617,8 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
* @param creationLocation
* The relative creation location used to create the border node
* or null
- * @param parentFigure
- * the parent figure
+ * @param parentPart
+ * the parent edit part
* @param nearCollapsedBorderedNode
* If true, the creation will be made near the bordered node
* named "elementToRevealName + collapse" (this bordered node
@@ -561,14 +626,19 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
* creation will be made at 8 pixel of the top-left corner of the
* container.
*/
- private void assertBorderedNodeAtLocation(String borderedNodeLabel, Point expectedLocation, Point parentLocation, Point creationLocation, IGraphicalEditPart parentPart,
+ protected void assertBorderedNodeAtLocation(String borderedNodeLabel, Point expectedLocation, Point parentLocation, Point creationLocation, IGraphicalEditPart parentPart,
boolean nearCollapsedBorderedNode) {
- Point nodeLocation = editor.getAbsoluteLocation(borderedNodeLabel, AbstractDiagramBorderNodeEditPart.class);
+ IGraphicalEditPart borderNodePart = (IGraphicalEditPart) editor.getEditPart(borderedNodeLabel, AbstractDiagramBorderNodeEditPart.class).part();
+ Point nodeLocation = editor.getAbsoluteLocation(borderNodePart);
String errorMessage = "The BorderedNode has been created at wrong location.";
if (nearCollapsedBorderedNode) {
errorMessage = "The BorderedNode has been created at wrong location (for near collapsed bordered node case).";
}
+ // Check Draw2d
assertSameLocation(errorMessage, expectedLocation, nodeLocation, parentLocation, creationLocation, parentPart);
+ // Check GMF
+ Point gmfNodeLocation = GMFHelper.getAbsoluteLocation((Node) borderNodePart.getModel(), true);
+ assertSameLocation(errorMessage, expectedLocation, gmfNodeLocation, parentLocation, creationLocation, parentPart);
}
/**
@@ -605,7 +675,7 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
* (zoom level : 100%) has the expected location.
*/
public void testBNC_OnNodeInContainerWithScroll() {
- testBNC_OnNode(ZoomLevel.ZOOM_100, CLASS_2_NAME);
+ testBNC_OnNode(ZoomLevel.ZOOM_100, CLASS_2_NAME, false);
}
/**
@@ -613,7 +683,7 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
* (zoom level : 50%) has the expected location.
*/
public void testBNC_OnNodeInContainerWithScrollAndChangeZoom() {
- testBNC_OnNode(ZoomLevel.ZOOM_50, CLASS_2_NAME);
+ testBNC_OnNode(ZoomLevel.ZOOM_50, CLASS_2_NAME, false);
}
/**
@@ -622,16 +692,16 @@ public class BorderedNodeCreationTest extends AbstractSiriusSwtBotGefTestCase {
* the expected location.
*/
public void testBNC_OnNodeInContainerWithScrollWithScrollInDiagram() {
- testBNC_OnNode(ZoomLevel.ZOOM_100, CLASS_4_NAME);
+ testBNC_OnNode(ZoomLevel.ZOOM_100, CLASS_4_NAME, false);
}
/**
* Ensures that a bordered node created on a Node in Container with scroll
- * (which location implies to scroll on the diagram) (zoom level : 100%) has
+ * (which location implies to scroll on the diagram) (zoom level : 200%) has
* the expected location.
*/
public void testBNC_OnNodeInContainerWithScrollWithScrollInDiagramAndChangeZoom() {
- testBNC_OnNode(ZoomLevel.ZOOM_200, CLASS_4_NAME);
+ testBNC_OnNode(ZoomLevel.ZOOM_200, CLASS_4_NAME, false);
}
/**
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationWithSnapToGridTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationWithSnapToGridTest.java
index fdbafd34b4..63dac0c0e6 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationWithSnapToGridTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/BorderedNodeCreationWithSnapToGridTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2017 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
@@ -12,12 +12,15 @@ package org.eclipse.sirius.tests.swtbot;
import org.eclipse.draw2d.IFigure;
import org.eclipse.draw2d.Viewport;
+import org.eclipse.draw2d.geometry.Dimension;
import org.eclipse.draw2d.geometry.Point;
import org.eclipse.draw2d.geometry.PrecisionPoint;
import org.eclipse.draw2d.geometry.Rectangle;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.GraphicalEditPart;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.gmf.runtime.notation.Node;
import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramBorderNodeEditPart;
+import org.eclipse.sirius.diagram.ui.edit.api.part.AbstractDiagramNodeEditPart;
import org.eclipse.sirius.diagram.ui.internal.refresh.GMFHelper;
import org.eclipse.sirius.tests.swtbot.support.api.business.UIDiagramRepresentation.ZoomLevel;
import org.eclipse.swtbot.eclipse.gef.finder.widgets.SWTBotGefEditPart;
@@ -39,11 +42,16 @@ public class BorderedNodeCreationWithSnapToGridTest extends BorderedNodeCreation
*/
private static final String NEW_BORDERED_NODE_ON_CLASS_2_NAME = "new Attribute2";
+ /**
+ * The grid spacing in pixels.
+ */
+ private static final int GRID_SPACING = 100;
+
@Override
protected void setUp() throws Exception {
super.setUp();
- editor.setSnapToGrid(true, 100, 2);
+ editor.setSnapToGrid(true, GRID_SPACING, 2);
}
/**
@@ -51,7 +59,7 @@ public class BorderedNodeCreationWithSnapToGridTest extends BorderedNodeCreation
* snapToGrid) on a Node (zoom level : 100%) are not at same location.
*/
public void testCreateTwoBorderNodesAtSameLocation() {
- testBNC_OnNode(ZoomLevel.ZOOM_100, C1_NAME);
+ testBNC_OnNode(ZoomLevel.ZOOM_100, C1_NAME, false);
// Create another border node just beside the new border node but at the
// same location with snapToGrid and check that the create
// location is not the same (in draw2d and GMF coordinates).
@@ -77,6 +85,11 @@ public class BorderedNodeCreationWithSnapToGridTest extends BorderedNodeCreation
Rectangle secondNewNodeGMFBounds = GMFHelper.getAbsoluteBounds((Node) secondNewNode.part().getModel());
assertFalse("Second border node should not overlap the first one (GMF).", firstNewNodeGMFBounds.intersects(secondNewNodeGMFBounds));
+
+ SWTBotGefEditPart classEditPart = editor.getEditPart(C1_NAME, AbstractDiagramNodeEditPart.class);
+ Point classAbsoluteLocation = editor.getAbsoluteLocation((GraphicalEditPart) classEditPart.part());
+ assertBorderedNodeAtLocation(NEW_BORDERED_NODE_ON_CLASS_2_NAME, creationLocation, classAbsoluteLocation, creationLocation, ((GraphicalEditPart) classEditPart.part()),
+ nearCollapsedBorderedNode);
}
/**
@@ -98,19 +111,23 @@ public class BorderedNodeCreationWithSnapToGridTest extends BorderedNodeCreation
if (nodeLocation.x == parentLocation.x + 8 || nodeLocation.x == parentLocation.x) {
// Case where the grid is outside the parent
- errorMessage += " expected <Point(" + nodeLocation.x + ", " + absoluteSnapToLocation.y + ")> or <Point(" + nodeLocation.x + ", " + expectedLocation.y + ")> but was:" + nodeLocation;
+ errorMessage += " expected <Point(" + nodeLocation.x + ", " + absoluteSnapToLocation.y + ")> or <Point(" + nodeLocation.x + ", " + expectedLocation.y + ")> but was: " + nodeLocation;
assertTrue(errorMessage, nodeLocation.x == nodeLocation.x && nodeLocation.y == absoluteSnapToLocation.y || nodeLocation.x == nodeLocation.x && nodeLocation.y == expectedLocation.y);
} else if (nodeLocation.y == parentLocation.y) {
// The y axis is the same as parent. Check that this axis also
// corresponds to the grid. The x axis is constrained by the border
// (east or west).
- errorMessage += " expected <Point(" + nodeLocation.x + ", " + absoluteSnapToLocation.y + ")> or <Point(" + nodeLocation.x + ", " + expectedLocation.y + ")> but was:" + nodeLocation;
+ errorMessage += " expected <Point(" + nodeLocation.x + ", " + absoluteSnapToLocation.y + ")> or <Point(" + nodeLocation.x + ", " + expectedLocation.y + ")> but was: " + nodeLocation;
assertTrue(errorMessage, nodeLocation.y == absoluteSnapToLocation.y);
} else {
- errorMessage += " expected <Point(" + expectedLocation.x + ", " + absoluteSnapToLocation.y + ")> or <Point(" + absoluteSnapToLocation.x + ", " + expectedLocation.y + ")> but was:"
- + nodeLocation;
- assertTrue(errorMessage, nodeLocation.x == expectedLocation.x && nodeLocation.y == absoluteSnapToLocation.y || nodeLocation.x == absoluteSnapToLocation.x
- && nodeLocation.y == expectedLocation.y);
+ // Get the absolute bounds of parent
+ Rectangle parentBounds = new Rectangle(editor.getAbsoluteLocation(parentPart), parentPart.getFigure().getSize());
+
+ errorMessage += " At least x or y must be on the grid (grid spacing = " + GRID_SPACING + "), but was: " + nodeLocation + " for parent: " + parentBounds;
+
+ assertTrue(errorMessage,
+ (nodeLocation.x % GRID_SPACING == 0 && (nodeLocation.y == expectedLocation.y || nodeLocation.y == parentLocation.y - 2 || nodeLocation.y == parentBounds.bottom() - 8))
+ || ((nodeLocation.x == expectedLocation.x || nodeLocation.x == parentLocation.x - 2 || nodeLocation.x == parentBounds.right() - 8) && nodeLocation.y % GRID_SPACING == 0));
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationNearCollapsedWithSnapToGridTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationNearCollapsedWithSnapToGridTest.java
index 358b8a69b3..411189e4e9 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationNearCollapsedWithSnapToGridTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationNearCollapsedWithSnapToGridTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2017 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
@@ -19,6 +19,7 @@ import org.eclipse.draw2d.geometry.PrecisionPoint;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper;
+import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper;
/**
* Same tests as {@link CollapsedBorderedNodeCreationNearCollapsedTest} but with
@@ -28,11 +29,16 @@ import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper;
*/
public class CollapsedBorderedNodeCreationNearCollapsedWithSnapToGridTest extends CollapsedBorderedNodeCreationNearCollapsedTest {
+ /**
+ * The grid spacing in pixels.
+ */
+ private static final int GRID_SPACING = 100;
+
@Override
protected void setUp() throws Exception {
super.setUp();
- editor.setSnapToGrid(true, 100, 2);
+ editor.setSnapToGrid(true, GRID_SPACING, 2);
}
@Override
@@ -94,10 +100,16 @@ public class CollapsedBorderedNodeCreationNearCollapsedWithSnapToGridTest extend
errorMessage += " expected <Point(" + nodeLocation.x + ", " + absoluteSnapToLocation.y + ")> but was:" + nodeLocation;
assertTrue(errorMessage, nodeLocation.y == absoluteSnapToLocation.y);
} else {
- errorMessage += " expected <Point(" + absoluteExpectedLocation.x + ", " + absoluteSnapToLocation.y + ")> or <Point(" + absoluteSnapToLocation.x + ", " + absoluteExpectedLocation.y
- + ")> but was:" + nodeLocation;
- assertTrue(errorMessage, nodeLocation.x == absoluteExpectedLocation.x && nodeLocation.y == absoluteSnapToLocation.y || nodeLocation.x == absoluteSnapToLocation.x
- && nodeLocation.y == absoluteExpectedLocation.y);
+ // Get the absolute bounds of parent
+ Rectangle parentBounds = GraphicalHelper.getAbsoluteBoundsIn100Percent(parentPart, true);
+
+ errorMessage += " At least x or y must be on the grid (grid spacing = " + GRID_SPACING + "), but was: " + nodeLocation + "for parent: " + parentBounds;
+
+ assertTrue(errorMessage,
+ ((nodeLocation.x - 4) % GRID_SPACING == 0
+ && (nodeLocation.y == absoluteExpectedLocation.y || nodeLocation.y == parentAbsoluteLocation.y + 1 || nodeLocation.y == parentBounds.bottom() - 2))
+ || ((nodeLocation.x == absoluteExpectedLocation.x || nodeLocation.x == parentAbsoluteLocation.x + 1 || nodeLocation.x == parentBounds.right() - 2)
+ && (nodeLocation.y - 4) % GRID_SPACING == 0));
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationWithSnapToGridTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationWithSnapToGridTest.java
index 51684c8259..d3d6a9907e 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationWithSnapToGridTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/CollapsedBorderedNodeCreationWithSnapToGridTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2017 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
@@ -18,6 +18,7 @@ import org.eclipse.draw2d.geometry.PrecisionPoint;
import org.eclipse.draw2d.geometry.Rectangle;
import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper;
+import org.eclipse.sirius.ext.gmf.runtime.editparts.GraphicalHelper;
/**
* Same tests as {@link CollapsedBorderedNodeCreationTest} but with snapToGrid
@@ -27,11 +28,16 @@ import org.eclipse.sirius.diagram.ui.edit.internal.part.PortLayoutHelper;
*/
public class CollapsedBorderedNodeCreationWithSnapToGridTest extends CollapsedBorderedNodeCreationTest {
+ /**
+ * The grid spacing in pixels.
+ */
+ private static final int GRID_SPACING = 100;
+
@Override
protected void setUp() throws Exception {
super.setUp();
- editor.setSnapToGrid(true, 100, 2);
+ editor.setSnapToGrid(true, GRID_SPACING, 2);
}
@Override
@@ -85,10 +91,16 @@ public class CollapsedBorderedNodeCreationWithSnapToGridTest extends CollapsedBo
errorMessage += " expected <Point(" + nodeLocation.x + ", " + absoluteSnapToLocation.y + ")> but was:" + nodeLocation;
assertTrue(errorMessage, nodeLocation.y == absoluteSnapToLocation.y);
} else {
- errorMessage += " expected <Point(" + absoluteExpectedLocation.x + ", " + absoluteSnapToLocation.y + ")> or <Point(" + absoluteSnapToLocation.x + ", " + absoluteExpectedLocation.y
- + ")> but was:" + nodeLocation;
- assertTrue(errorMessage, nodeLocation.x == absoluteExpectedLocation.x && nodeLocation.y == absoluteSnapToLocation.y || nodeLocation.x == absoluteSnapToLocation.x
- && nodeLocation.y == absoluteExpectedLocation.y);
+ // Get the absolute bounds of parent
+ Rectangle parentBounds = GraphicalHelper.getAbsoluteBoundsIn100Percent(parentPart, true);
+
+ errorMessage += " At least x or y must be on the grid (grid spacing = " + GRID_SPACING + "), but was: " + nodeLocation + "for parent: " + parentBounds;
+
+ assertTrue(errorMessage,
+ ((nodeLocation.x - 4) % GRID_SPACING == 0
+ && (nodeLocation.y == absoluteExpectedLocation.y || nodeLocation.y == parentAbsoluteLocation.y + 1 || nodeLocation.y == parentBounds.bottom() - 2))
+ || ((nodeLocation.x == absoluteExpectedLocation.x || nodeLocation.x == parentAbsoluteLocation.x + 1 || nodeLocation.x == parentBounds.right() - 2)
+ && (nodeLocation.y - 4) % GRID_SPACING == 0));
}
}
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithBorderNodeCreationPositionWithSnapToGridTest.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithBorderNodeCreationPositionWithSnapToGridTest.java
index 1839d9c4e6..3fdd52da0c 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithBorderNodeCreationPositionWithSnapToGridTest.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/EdgeWithBorderNodeCreationPositionWithSnapToGridTest.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2017 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
@@ -100,16 +100,19 @@ public class EdgeWithBorderNodeCreationPositionWithSnapToGridTest extends EdgeCr
// * or one of them is the same as parent (case when the grid is outside
// the
// node).
- assertTrue("For starting point, the x coordinate should be on the grid or the y coordinate should be on the grid or at least one should be the same as parent.",
- checkLocation(GraphicalHelper.getAbsoluteBoundsIn100Percent(sourceBorderNode).getTopLeft(), source));
- assertTrue("For ending point, the x coordinate should be on the grid or the y coordinate should be on the grid or at least one should be the same as parent.",
- checkLocation(GraphicalHelper.getAbsoluteBoundsIn100Percent(targetBorderNode).getTopLeft(), target));
+ Rectangle parentSourceBounds = GraphicalHelper.getAbsoluteBoundsIn100Percent(source, true);
+ Point sourceBNLocation = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourceBorderNode, true).getTopLeft();
+ assertTrue("For starting point (" + sourceBNLocation.preciseX() + ", " + sourceBNLocation.preciseY() + "), the x or y coordinate should be on the grid (step=" + gridStep
+ + ") or at least one should be the same as parent: " + parentSourceBounds + ".", checkLocation(sourceBNLocation, parentSourceBounds));
+ Rectangle parentTargetBounds = GraphicalHelper.getAbsoluteBoundsIn100Percent(target, true);
+ Point targetBNLocation = GraphicalHelper.getAbsoluteBoundsIn100Percent(targetBorderNode, true).getTopLeft();
+ assertTrue("For ending point (" + targetBNLocation.preciseX() + ", " + targetBNLocation.preciseY() + "), the x or y coordinate should be on the grid (step=" + gridStep
+ + ") or at least one should be the same as parent: " + parentTargetBounds + ".", checkLocation(targetBNLocation, parentTargetBounds));
}
- private boolean checkLocation(Point location, IGraphicalEditPart parentPart) {
+ private boolean checkLocation(Point location, Rectangle parentBounds) {
boolean result = (location.x % gridStep) == 0 || (location.y % gridStep) == 0;
if (!result) {
- Rectangle parentBounds = GraphicalHelper.getAbsoluteBoundsIn100Percent(parentPart);
result = (location.x == parentBounds.x || location.x == (parentBounds.x + parentBounds.width)) || (location.y == parentBounds.y || location.y == (parentBounds.y + parentBounds.height));
}
return result;
@@ -300,7 +303,8 @@ public class EdgeWithBorderNodeCreationPositionWithSnapToGridTest extends EdgeCr
private void testBorderNodesAreAligned(String diagramDescriptionName, String diagramName, String sourceName, Class<? extends EditPart> sourceEditPartType, int sourceDelta, String targetName,
Class<? extends EditPart> targetEditPartType, int targetDelta, final boolean verticalEdge, ZoomLevel zoomLevel, Option<String> nameOfElementToRevealInFirst) {
editor = (SWTBotSiriusDiagramEditor) openRepresentation(localSession.getOpenedSession(), diagramDescriptionName, diagramName, DDiagram.class, false, true);
- editor.setSnapToGrid(true, 2, 2);
+ int gridSpacing = 2;
+ editor.setSnapToGrid(true, gridSpacing, 2);
editor.zoom(zoomLevel);
try {
SWTBotGefEditPart sourceSwtbotPart = editor.getEditPart(sourceName, sourceEditPartType);
@@ -326,14 +330,14 @@ public class EdgeWithBorderNodeCreationPositionWithSnapToGridTest extends EdgeCr
Rectangle absoluteSourceBounds = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourcePart);
sourceTranslation = new PrecisionPoint(sourceDelta * zoomLevel.getAmount(), (absoluteSourceBounds.height - 2) * zoomLevel.getAmount());
targetTranslation = new PrecisionPoint(targetDelta * zoomLevel.getAmount(), 2 * zoomLevel.getAmount());
- absoluteSource = absoluteSourceBounds.getLocation().getTranslated(sourceDelta, absoluteSourceBounds.height - 2);
- absoluteTarget = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourcePart).getLocation().getTranslated(targetDelta, 2);
+ absoluteSource = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourcePart, true).getLocation().getTranslated(sourceDelta, absoluteSourceBounds.height - 2);
+ absoluteTarget = GraphicalHelper.getAbsoluteBoundsIn100Percent(targetPart, true).getLocation().getTranslated(targetDelta, 2);
} else {
Rectangle absoluteSourceBounds = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourcePart);
sourceTranslation = new PrecisionPoint((absoluteSourceBounds.width - 2) * zoomLevel.getAmount(), sourceDelta * zoomLevel.getAmount());
targetTranslation = new PrecisionPoint(2 * zoomLevel.getAmount(), targetDelta * zoomLevel.getAmount());
- absoluteSource = absoluteSourceBounds.getLocation().getTranslated(absoluteSourceBounds.width - 2, sourceDelta);
- absoluteTarget = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourcePart).getLocation().getTranslated(2, targetDelta);
+ absoluteSource = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourcePart, true).getLocation().getTranslated(absoluteSourceBounds.width - 2, sourceDelta);
+ absoluteTarget = GraphicalHelper.getAbsoluteBoundsIn100Percent(targetPart, true).getLocation().getTranslated(2, targetDelta);
}
Point source = sourceBounds.getLocation().getTranslated(sourceTranslation);
editor.click(source);
@@ -367,22 +371,45 @@ public class EdgeWithBorderNodeCreationPositionWithSnapToGridTest extends EdgeCr
return "The border node coordinates are {0, 0}.";
}
});
- // Get the new target border node
+ // Get the new target border node (and wait that its figure is
+ // correctly located, ie not at {0, 0})
IGraphicalEditPart targetBorderNode = getBorderNode(targetPart);
+ bot.waitUntil(new ICondition() {
+
+ @Override
+ public boolean test() throws Exception {
+ if (verticalEdge) {
+ return targetBorderNode.getFigure().getBounds().x != 0;
+ } else {
+ return targetBorderNode.getFigure().getBounds().y != 0;
+ }
+ }
+
+ @Override
+ public void init(SWTBot bot) {
+ }
+
+ @Override
+ public String getFailureMessage() {
+ return "The border node coordinates are {0, 0}.";
+ }
+ });
if (verticalEdge) {
- int sourceXLocation = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourceBorderNode).getLocation().x;
- assertEquals("The source and the target border nodes should be aligned.", sourceXLocation, GraphicalHelper.getAbsoluteBoundsIn100Percent(targetBorderNode).getLocation().x);
+ int sourceXLocation = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourceBorderNode, true).getLocation().x;
+ assertEquals("The source and the target border nodes should be aligned.", sourceXLocation, GraphicalHelper.getAbsoluteBoundsIn100Percent(targetBorderNode, true).getLocation().x);
// The x coordinate must be between source clicked point and
// target clicked point.
- assertTrue("The x coordinate must be between source clicked point and target clicked point: Expected " + absoluteSource.x + "<= x <=" + absoluteTarget.x + " but what "
- + sourceXLocation + ".", absoluteSource.x <= sourceXLocation && sourceXLocation <= absoluteTarget.x);
+ assertTrue("The x coordinate must be between source clicked point and target clicked point: Expected " + (absoluteSource.x - gridSpacing) + "<= x <=" + (absoluteTarget.x + gridSpacing)
+ + " but what " + sourceXLocation + ".", (absoluteSource.x - gridSpacing) <= sourceXLocation && sourceXLocation <= (absoluteTarget.x + gridSpacing));
} else {
- int sourceYLocation = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourceBorderNode).getLocation().y;
- assertEquals("The source and the target border nodes should be aligned.", sourceYLocation, GraphicalHelper.getAbsoluteBoundsIn100Percent(targetBorderNode).getLocation().y);
+ int sourceYLocation = GraphicalHelper.getAbsoluteBoundsIn100Percent(sourceBorderNode, true).getLocation().y;
+ assertEquals("The source and the target border nodes should be aligned.", sourceYLocation, GraphicalHelper.getAbsoluteBoundsIn100Percent(targetBorderNode, true).getLocation().y);
// The y coordinate must be between source clicked point and
// target clicked point.
- assertTrue("The y coordinate must be between source clicked point and target clicked point: Expected " + absoluteSource.y + "<= y <=" + absoluteTarget.y + " but what "
- + sourceYLocation + ".", absoluteSource.y <= sourceYLocation && sourceYLocation <= absoluteTarget.y);
+ assertTrue(
+ "The y coordinate must be aligned on the grid and between source clicked point and target clicked point (or at least no further than a grid step) : Expected "
+ + (absoluteSource.y - gridSpacing) + "<= y <=" + (absoluteTarget.y + gridSpacing) + " but what " + sourceYLocation + ".",
+ (absoluteSource.y - gridSpacing) <= sourceYLocation && sourceYLocation <= (absoluteTarget.y + gridSpacing));
}
} finally {
editor.zoom(ZoomLevel.ZOOM_100);
diff --git a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllCreationTestSuite.java b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllCreationTestSuite.java
index d072dbc38e..a6a996c15f 100644
--- a/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllCreationTestSuite.java
+++ b/plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/suite/AllCreationTestSuite.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2010, 2014 THALES GLOBAL SERVICES.
+ * Copyright (c) 2010, 2017 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
@@ -10,6 +10,7 @@
*******************************************************************************/
package org.eclipse.sirius.tests.swtbot.suite;
+import org.eclipse.sirius.tests.swtbot.BorderNodeSideTest;
import org.eclipse.sirius.tests.swtbot.BorderedNodeCreationNearCollapsedTest;
import org.eclipse.sirius.tests.swtbot.BorderedNodeCreationNearCollapsedWithSnapToGridTest;
import org.eclipse.sirius.tests.swtbot.BorderedNodeCreationTest;
@@ -72,7 +73,6 @@ public class AllCreationTestSuite extends TestCase {
suite.addTestSuite(CollapsedBorderedNodeCreationNearCollapsedTest.class);
suite.addTestSuite(NoteCreationWithSnapToGridTest.class);
- // suite.addTestSuite(NodeCreationPositionWithSnapToGridTest.class);
suite.addTestSuite(NodeCreationWithSnapToGridTest.class);
suite.addTestSuite(ContainerCreationWithSnapToGridTest.class);
suite.addTestSuite(DNodeListCreationWithSnapToGridTest.class);
@@ -83,6 +83,7 @@ public class AllCreationTestSuite extends TestCase {
suite.addTestSuite(EdgeCreationPositionTest.class);
suite.addTestSuite(EdgeCreationPositionWithSnapToGridTest.class);
suite.addTestSuite(EdgeWithBorderNodeCreationPositionWithSnapToGridTest.class);
+ suite.addTestSuite(BorderNodeSideTest.class);
return suite;
}

Back to the top