Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre-Charles David2018-05-23 13:48:49 +0000
committerPierre-Charles David2018-05-23 13:48:49 +0000
commitd052932114926ae8b38c0379be4b832b1508bc33 (patch)
tree473a77ab822e87c1b66e6195b42096467316f988
parent0bfbdf728e462e9997fdcb42ab6eee4df7c72e3d (diff)
downloadorg.eclipse.sirius-d052932114926ae8b38c0379be4b832b1508bc33.tar.gz
org.eclipse.sirius-d052932114926ae8b38c0379be4b832b1508bc33.tar.xz
org.eclipse.sirius-d052932114926ae8b38c0379be4b832b1508bc33.zip
[test] Fix DragNDropTest by re-obtaining a current SWBotTreeItem when neededv6.0.0rc1
Change-Id: Ia1df3be3a2cb6d4c5315581e07d9f11b16f5480d Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.tests.swtbot/src/org/eclipse/sirius/tests/swtbot/DragNDropTest.java14
1 files changed, 11 insertions, 3 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 5ddb527db0..adae13cbbb 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
@@ -176,6 +176,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
int rowCount = errorLogBot.tree().rowCount();
// DnD P1(EPackage) from the Model Content view to the diagram
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).getNode(CONTAINER_TO_DRAG_P1);
ecoreTreeItem.dragAndDrop(editor.getCanvas());
@@ -211,6 +212,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
Point p1Location = editor.getBounds(p1Bot).getLocation();
// DnD P2(EPackage) from the Model Content view to P1
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem1 = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).getNode(CONTAINER_TO_DRAG_P2);
util.dragAndDrop(ecoreTreeItem1, editor.getCanvas(), new org.eclipse.swt.graphics.Point(p1Location.x + 25, p1Location.y + 25));
bot.waitUntil(new DiagramWithChildrensCondition(editor, 1));
@@ -437,6 +439,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
Point targetLocation = editor.getBounds(p1Bot).getLeft().getTranslated(-200, 0);
// DnD P2.1(EPackage) from the Model Content view to the diagram
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).expandNode(CONTAINER_TO_DRAG_P1).expandNode(CONTAINER_TO_DRAG_P2).getNode(CONTAINER_TO_DRAG_P3);
util.dragAndDrop(ecoreTreeItem, editor.getCanvas(), targetLocation);
bot.waitUntil(new CheckNumberOfDescendants(p1Bot, AbstractDiagramNodeEditPart.class, 1));
@@ -504,6 +507,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
// DnD C1(EClass) from the Model Content view to P2. This
// move shall not be allowed. Asserts that no error message is
// generated
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).expandNode(CONTAINER_TO_DRAG_P1).getNode(CLASS_TO_DRAG_C1);
ecoreTreeItem.dragAndDrop(editor.getCanvas());
@@ -544,6 +548,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
// DnD C1(EClass) from the Model Content view to P2. This
// move shall not be allowed. Asserts that no error message is
// generated
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).expandNode(CONTAINER_TO_DRAG_P1).getNode(CLASS_TO_DRAG_C1);
util.dragAndDrop(ecoreTreeItem, editor.getCanvas(), new org.eclipse.swt.graphics.Point(p1Location.x + 25, p1Location.y + 25));
@@ -576,6 +581,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
int rowCount = errorLogBot.tree().rowCount();
// DnD P1(EPackage) from the Model Content view to the diagram
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).getNode(CONTAINER_TO_DRAG_P1);
ecoreTreeItem.dragAndDrop(editor.getCanvas());
@@ -611,6 +617,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
Point p1Location = editor.getBounds(p1Bot).getLocation();
// DnD P2(EPackage) from the Model Content view to P1
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).expandNode(CONTAINER_TO_DRAG_P1).getNode(CLASS_TO_DRAG_C1);
util.dragAndDrop(ecoreTreeItem, editor.getCanvas(), new org.eclipse.swt.graphics.Point(p1Location.x + 25, p1Location.y + 25));
bot.waitUntil(new DiagramWithChildrensCondition(editor, 1));
@@ -646,6 +653,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
Point targetLocation = editor.getBounds(p1Bot).getLeft().getTranslated(-200, 0);
// DnD P2(EPackage) from the Model Content view to the diagram
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).getNode(CONTAINER_TO_DRAG_P2);
util.dragAndDrop(ecoreTreeItem, editor.getCanvas(), new org.eclipse.swt.graphics.Point(targetLocation.x, targetLocation.y));
bot.waitUntil(new DiagramWithChildrensCondition(editor, 2));
@@ -683,7 +691,6 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
*/
@Test
public void test_DnDClassFromMC2DiagramBlank5() throws Exception {
-
openRepresentation5();
try {
@@ -691,8 +698,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
SWTBot errorLogBot = bot.viewByPartName("Error Log").bot();
int rowCount = errorLogBot.tree().rowCount();
- DndUtil util = new DndUtil(bot.getDisplay());
-
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
// DnD P1(EPackage) from the Model Content view to the diagram
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).expandNode(CONTAINER_TO_DRAG_P1).getNode(CLASS_TO_DRAG_C1);
ecoreTreeItem.dragAndDrop(editor.getCanvas());
@@ -727,6 +733,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
int rowCount = errorLogBot.tree().rowCount();
// DnD P1(EPackage) from the Model Content view to the diagram
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).expandNode(CONTAINER_TO_DRAG_P1).getNode(CLASS_TO_DRAG_C1);
ecoreTreeItem.dragAndDrop(editor.getCanvas());
@@ -763,6 +770,7 @@ public class DragNDropTest extends AbstractSiriusSwtBotGefTestCase {
Point p1Location = editor.getBounds(p1Bot).getLocation();
// DnD P2(EPackage) from the Model Content view to P1
+ semanticResourceNode = localSession.getSemanticResourceNode(ecoreEcoreResource);
final SWTBotTreeItem ecoreTreeItem = semanticResourceNode.expandNode(ROOTPACKAGE_NAME).getNode(CONTAINER_TO_DRAG_P2);
util.dragAndDrop(ecoreTreeItem, editor.getCanvas(), new org.eclipse.swt.graphics.Point(p1Location.x + 25, p1Location.y + 25));

Back to the top