Skip to content

Commit

Permalink
[333] Add tests to reveal the GMF style customization problem
Browse files Browse the repository at this point in the history
Currently, a strange StringValueStyle is created on edge after a layout
with ELK, like this

<styles xmi:type="notation:StringValueStyle"
xmi:id="_b5DYgOqeEe6GK951-Ozudg" name="junctionPoints"
stringValue="()"/>

As consequence, the edge appears as customized (tabbar button "Reset
style properties to default", and same button in tab Appearance
Properties view, is enabled).
  • Loading branch information
lredor committed Jun 26, 2024
1 parent 77e6cc0 commit 10cf0d4
Showing 1 changed file with 2 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1889,11 +1889,6 @@ private void testArrangeAllResultForEdgesRoutingStyle(String diagramName, String
}

private void checkRoutingStyle(AbstractDiagramEdgeEditPart edgeEditPart, String message, String edgeName, int expectedRoutingStyle) {
checkRoutingStyle(edgeEditPart, message, edgeName, expectedRoutingStyle, false);
}

private void checkRoutingStyle(AbstractDiagramEdgeEditPart edgeEditPart, String message, String edgeName, int expectedRoutingStyle, boolean checkGMFCusto) {
// TODO : checkGMFCusto is a temporary parameter to dissociate the problem concerning StringValueStyle.
String fullMessage = MessageFormat.format(message, edgeName);
View notationView = edgeEditPart.getNotationView();
DDiagramElement dde = edgeEditPart.resolveDiagramElement();
Expand All @@ -1907,12 +1902,8 @@ private void checkRoutingStyle(AbstractDiagramEdgeEditPart edgeEditPart, String
EdgeRouting originalEdgeRouting = optionalEdgeMapping.get().getStyle().getRoutingStyle();
if (EdgeRouting.get(expectedRoutingStyle).equals(originalEdgeRouting)) {
// The routing is the same, so the edge should not appear as customized.
if (checkGMFCusto) {
assertTrue("This edge \"" + edgeName + "\" must not appear as customized.",
(!(new DDiagramElementQuery(dde).isCustomized() || new ViewQueryWithoutFontNameCheck(notationView).isCustomized())));
} else {
assertTrue("This edge \"" + edgeName + "\" must not appear as customized.", (!(new DDiagramElementQuery(dde).isCustomized())));
}
assertTrue("This edge \"" + edgeName + "\" must not appear as customized.",
(!(new DDiagramElementQuery(dde).isCustomized() || new ViewQueryWithoutFontNameCheck(notationView).isCustomized())));
} else {
assertTrue("The custom features list of the style of DEdge \"" + edgeName + "\" must contain the routingStyle.",
dde.getStyle().getCustomFeatures().contains(DiagramPackage.Literals.DEDGE__ROUTING_STYLE.getName()));
Expand Down

0 comments on commit 10cf0d4

Please sign in to comment.