Skip to content

Commit

Permalink
Renamed variables from objects of supporting Bots eclipse-4diac#377
Browse files Browse the repository at this point in the history
Renamed some variables from objects of supporting Bots with clearer
names to prevent misunderstanding and misinterpretation.

Addresses eclipse-4diac#377
  • Loading branch information
Andrearium committed Sep 3, 2024
1 parent 5b925cd commit 7765fe2
Show file tree
Hide file tree
Showing 7 changed files with 133 additions and 133 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -392,8 +392,8 @@ protected static void deleteProject() {
@SuppressWarnings("static-method")
@AfterEach
protected void cleanEditorArea() {
final SWTBotSystemExplorer sysEx = new SWTBotSystemExplorer(bot);
final SWTBotTreeItem appNode = sysEx.expandApplicationTreeItemInSystemExplorer();
final SWTBotSystemExplorer sysExBot = new SWTBotSystemExplorer(bot);
final SWTBotTreeItem appNode = sysExBot.expandApplicationTreeItemInSystemExplorer();
appNode.contextMenu("Open").click();

final SWTBotGefEditor editor = bot.gefEditor(UITestNamesHelper.PROJECT_NAME);
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -297,9 +297,9 @@ public void checkIfConnectionRemainsAfterMoving1FB() {
final SWTBotFB fbBot = new SWTBotFB(bot);
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_CYCLE_TREE_ITEM, pos1);
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_DEMUX_TREE_ITEM, new Point(300, 50));
final SWTBotConnection connect = new SWTBotConnection(bot);
connect.createConnection(PinNamesHelper.EO, PinNamesHelper.EI);
final ConnectionEditPart connection = connect.findConnection(PinNamesHelper.EO, PinNamesHelper.EI);
final SWTBotConnection connectBot = new SWTBotConnection(bot);
connectBot.createConnection(PinNamesHelper.EO, PinNamesHelper.EI);
final ConnectionEditPart connection = connectBot.findConnection(PinNamesHelper.EO, PinNamesHelper.EI);
assertNotNull(connection);

// select E_CYCLE
Expand Down Expand Up @@ -358,9 +358,9 @@ public void checkIfConnectionRemainsAfterMovingBothFBsOneAfterAnother() {
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_SELECT_TREE_ITEM, pos1);
final Point pos2 = new Point(175, 125);
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_CTUD_TREE_ITEM, pos2);
final SWTBotConnection connect = new SWTBotConnection(bot);
connect.createConnection(PinNamesHelper.QU, PinNamesHelper.G);
final ConnectionEditPart connection = connect.findConnection(PinNamesHelper.QU, PinNamesHelper.G);
final SWTBotConnection connectBot = new SWTBotConnection(bot);
connectBot.createConnection(PinNamesHelper.QU, PinNamesHelper.G);
final ConnectionEditPart connection = connectBot.findConnection(PinNamesHelper.QU, PinNamesHelper.G);
assertNotNull(connection);

// select E_SELECT
Expand Down Expand Up @@ -437,9 +437,9 @@ public void checkIfConnectionRemainsAfterMovingBothFBsTogether() {
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_DEMUX_TREE_ITEM, pos1);
final Point pos2 = new Point(100, 275);
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_SR_TREE_ITEM, pos2);
final SWTBotConnection connect = new SWTBotConnection(bot);
connect.createConnection(PinNamesHelper.EO1, PinNamesHelper.R);
ConnectionEditPart connection = connect.findConnection(PinNamesHelper.EO1, PinNamesHelper.R);
final SWTBotConnection connectBot = new SWTBotConnection(bot);
connectBot.createConnection(PinNamesHelper.EO1, PinNamesHelper.R);
ConnectionEditPart connection = connectBot.findConnection(PinNamesHelper.EO1, PinNamesHelper.R);
assertNotNull(connection);
final SWTBot4diacGefEditor editor = (SWTBot4diacGefEditor) bot.gefEditor(UITestNamesHelper.PROJECT_NAME);

Expand Down Expand Up @@ -472,7 +472,7 @@ public void checkIfConnectionRemainsAfterMovingBothFBsTogether() {
final int translationY = pointTo.y - pointFrom.y;

// check if connection has been moved
connection = connect.findConnection(PinNamesHelper.EO1, PinNamesHelper.R);
connection = connectBot.findConnection(PinNamesHelper.EO1, PinNamesHelper.R);
assertNotNull(connection);
final org.eclipse.draw2d.geometry.Point newStartPointConnection = polyLineConnection.getPoints()
.getFirstPoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,14 +192,14 @@ public void compositeInstanceViewerConnectionCanBeAdded() {
final SWTBotFB fbBot = new SWTBotFB(bot);
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_N_TABLE_TREE_ITEM, new Point(200, 200));
goToCompositeInstanceViewer(UITestNamesHelper.E_N_TABLE_FB);
final SWTBotConnection connect = new SWTBotConnection(bot);
SWTBot4diacGefViewer viewer = connect.createConnection(PinNamesHelper.EO, PinNamesHelper.EI);
final SWTBotConnection connectBot = new SWTBotConnection(bot);
SWTBot4diacGefViewer viewer = connectBot.createConnection(PinNamesHelper.EO, PinNamesHelper.EI);
assertThrows(TimeoutException.class, viewer::waitForConnection);
viewer = connect.createConnection(PinNamesHelper.N, PinNamesHelper.CV);
viewer = connectBot.createConnection(PinNamesHelper.N, PinNamesHelper.CV);
assertThrows(TimeoutException.class, viewer::waitForConnection);
viewer = connect.createConnection(PinNamesHelper.START, PinNamesHelper.STOP);
viewer = connectBot.createConnection(PinNamesHelper.START, PinNamesHelper.STOP);
assertThrows(TimeoutException.class, viewer::waitForConnection);
viewer = connect.createConnection(PinNamesHelper.START, PinNamesHelper.EO0);
viewer = connectBot.createConnection(PinNamesHelper.START, PinNamesHelper.EO0);
assertThrows(TimeoutException.class, viewer::waitForConnection);
returnToEditingArea();
}
Expand All @@ -216,8 +216,8 @@ public void compositeInstanceViewerDeleteConnection() {

final SWTBotGefEditor editor = bot.gefEditor(UITestNamesHelper.PROJECT_NAME);
final SWTBot4diacGefViewer viewer = (SWTBot4diacGefViewer) editor.getSWTBotGefViewer();
final SWTBotConnection connect = new SWTBotConnection(bot);
final ConnectionEditPart connection = connect.findConnection(PinNamesHelper.EO, PinNamesHelper.REQ);
final SWTBotConnection connectBot = new SWTBotConnection(bot);
final ConnectionEditPart connection = connectBot.findConnection(PinNamesHelper.EO, PinNamesHelper.REQ);
final PolylineConnection figure = (PolylineConnection) connection.getFigure();
final PointList points = figure.getPoints();
final org.eclipse.draw2d.geometry.Point firstPoint = points.getFirstPoint();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,12 +49,12 @@ public void createSubapplicationViaContextMenu() {
editor.clickContextMenu(UITestNamesHelper.NEW_SUBAPPLICATION, 100, 100);
final List<SWTBotGefEditPart> selectedEditParts = editor.selectedEditParts();
assertEquals(1, selectedEditParts.size());
final SWTBotSubapp subapp = new SWTBotSubapp(bot);
assertTrue(subapp.isSubappSelected(selectedEditParts, UITestNamesHelper.SUBAPP));
final SWTBotSubapp subappBot = new SWTBotSubapp(bot);
assertTrue(subappBot.isSubappSelected(selectedEditParts, UITestNamesHelper.SUBAPP));
// check App node and SubApp TreeItem in SystemExplorer tree
final SWTBotSystemExplorer sysEx = new SWTBotSystemExplorer(bot);
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isSubAppNodeInSystemExplorerEmpty());
final SWTBotSystemExplorer sysExBot = new SWTBotSystemExplorer(bot);
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isSubAppNodeInSystemExplorerEmpty());
}

/**
Expand Down Expand Up @@ -84,8 +84,8 @@ public void createFBViaContextMenu() {
editor.directEditType(UITestNamesHelper.E_CYCLE_FB);
bot.sleep(3000);

final SWTBotSystemExplorer sysEx = new SWTBotSystemExplorer(bot);
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
final SWTBotSystemExplorer sysExBot = new SWTBotSystemExplorer(bot);
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
}

/**
Expand All @@ -104,19 +104,19 @@ public void goToParentViaContextMenuEmptySubApp() {
editor.clickContextMenu(UITestNamesHelper.NEW_SUBAPPLICATION, 100, 100);
// check System Explorer tree if SubApp is present

final SWTBotSystemExplorer sysEx = new SWTBotSystemExplorer(bot);
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isSubAppNodeInSystemExplorerEmpty());
final SWTBotSystemExplorer sysExBot = new SWTBotSystemExplorer(bot);
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isSubAppNodeInSystemExplorerEmpty());
goToCompositeInstanceViewer(UITestNamesHelper.SUBAPP);
final SWTBot4diacGefEditor editorSubApp = (SWTBot4diacGefEditor) bot.gefEditor(UITestNamesHelper.PROJECT_NAME);
assertNotNull(editorSubApp);
// check System Explorer tree again after entering subapplication
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isSubAppNodeInSystemExplorerEmpty());
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isSubAppNodeInSystemExplorerEmpty());
editorSubApp.clickContextMenu(UITestNamesHelper.GO_TO_PARENT, 100, 100);
// check System Explorer tree after returning
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isSubAppNodeInSystemExplorerEmpty());
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isSubAppNodeInSystemExplorerEmpty());
}

/**
Expand All @@ -133,32 +133,32 @@ public void goToParentViaContextMenuEmptySubApp() {
public void goToParentViaContextMenuSubAppWithFB() {
final SWTBotFB fbBot = new SWTBotFB(bot);
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_CYCLE_TREE_ITEM, new Point(100, 100));
final SWTBotSubapp subapp = new SWTBotSubapp(bot);
subapp.createSubappWithDragRectangle(50, 50, 400, 400);
final SWTBotSubapp subappBot = new SWTBotSubapp(bot);
subappBot.createSubappWithDragRectangle(50, 50, 400, 400);
// check System Explorer tree if SubApp is present
final SWTBotSystemExplorer sysEx = new SWTBotSystemExplorer(bot);
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
final SWTBotSystemExplorer sysExBot = new SWTBotSystemExplorer(bot);
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
goToCompositeInstanceViewer(UITestNamesHelper.SUBAPP);
final SWTBot4diacGefEditor editorSubApp = (SWTBot4diacGefEditor) bot.gefEditor(UITestNamesHelper.PROJECT_NAME);
assertNotNull(editorSubApp);
bot.toolbarButton(UITestNamesHelper.TOOLBAR_BUTTON_ZOOM_FIT_PAGE).click();
// check System Explorer tree again after entering subapplication
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
editorSubApp.clickContextMenu(UITestNamesHelper.GO_TO_PARENT, 100, 100);
// check System Explorer tree after returning
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
}

@SuppressWarnings({ "static-method", "static-access" })
@Test
public void goToChildViaContextMenuSubAppWithACompositeFB() {
final SWTBotFB fbBot = new SWTBotFB(bot);
fbBot.dragAndDropEventsFB(UITestNamesHelper.E_N_TABLE_TREE_ITEM, new Point(100, 100));
final SWTBotSubapp subapp = new SWTBotSubapp(bot);
subapp.createSubappWithDragRectangle(50, 50, 300, 300);
final SWTBotSubapp subappBot = new SWTBotSubapp(bot);
subappBot.createSubappWithDragRectangle(50, 50, 300, 300);
goToCompositeInstanceViewer(UITestNamesHelper.SUBAPP);
final SWTBot4diacGefEditor editorSubApp = (SWTBot4diacGefEditor) bot.gefEditor(UITestNamesHelper.PROJECT_NAME);
assertNotNull(editorSubApp);
Expand All @@ -168,9 +168,9 @@ public void goToChildViaContextMenuSubAppWithACompositeFB() {
final Rectangle fbBounds = fbBot.getBoundsOfFB(editorSubApp, UITestNamesHelper.E_N_TABLE_FB);
fbBot.selectFBWithFBNameInEditor(editorSubApp, UITestNamesHelper.E_N_TABLE_FB);
editorSubApp.clickContextMenu(UITestNamesHelper.GO_TO_CHILD, fbBounds.x, fbBounds.y);
final SWTBotSystemExplorer sysEx = new SWTBotSystemExplorer(bot);
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_N_TABLE_FB));
final SWTBotSystemExplorer sysExBot = new SWTBotSystemExplorer(bot);
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_N_TABLE_FB));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ public void isSubappInSystemExplorerTree() {
bot.menu(UITestNamesHelper.SOURCE).menu(UITestNamesHelper.NEW_SUBAPPLICATION).click();
final List<SWTBotGefEditPart> selectedEditParts = editor.selectedEditParts();
assertEquals(1, selectedEditParts.size());
final SWTBotSubapp subapp = new SWTBotSubapp(bot);
assertTrue(subapp.isSubappSelected(selectedEditParts, UITestNamesHelper.SUBAPP));
final SWTBotSubapp subappBot = new SWTBotSubapp(bot);
assertTrue(subappBot.isSubappSelected(selectedEditParts, UITestNamesHelper.SUBAPP));

// checks for SystemExplorer tree
final SWTBotSystemExplorer sysEx = new SWTBotSystemExplorer(bot);
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
final SWTBotSystemExplorer sysExBot = new SWTBotSystemExplorer(bot);
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
}

/**
Expand Down Expand Up @@ -86,16 +86,16 @@ public void isFbAndSubappInSystemExplorerTree() {
assertEquals(1, selectedEditParts.size());

// checks for App node
final SWTBotSystemExplorer sysEx = new SWTBotSystemExplorer(bot);
final SWTBotSubapp subapp = new SWTBotSubapp(bot);
assertTrue(subapp.isSubappSelected(selectedEditParts, UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysEx.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.E_SWITCH_FB));
final SWTBotSystemExplorer sysExBot = new SWTBotSystemExplorer(bot);
final SWTBotSubapp subappBot = new SWTBotSubapp(bot);
assertTrue(subappBot.isSubappSelected(selectedEditParts, UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.SUBAPP));
assertTrue(sysExBot.isElementInApplicationOfSystemInSystemExplorer(UITestNamesHelper.E_SWITCH_FB));

// checks for SubApp node
assertTrue(sysEx.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
assertTrue(sysExBot.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_CYCLE_FB));
assertThrows(WidgetNotFoundException.class,
() -> sysEx.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_SWITCH_FB));
() -> sysExBot.isFBInSubAppOfSystemInSystemExplorer(UITestNamesHelper.E_SWITCH_FB));
}

}
Loading

0 comments on commit 7765fe2

Please sign in to comment.