diff options
Diffstat (limited to 'tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java')
-rw-r--r-- | tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java index 8f59b899337..9bb2c7a2c99 100644 --- a/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java +++ b/tests/junit/framework/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java @@ -13,7 +13,7 @@ * Christian W. Damus - bugs 433206, 465416, 434983, 483721, 469188, 485220, 491542, 497865, 533673, 533682, 533676, 533679, 536486 * Thanh Liem PHAN (ALL4TEC) thanhliem.phan@all4tec.net - Bug 521550 * EclipseSource - Bug 536631 - * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 549108 + * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Bug 549108, 580192 *****************************************************************************/ package org.eclipse.papyrus.junit.utils.rules; @@ -894,6 +894,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit ServiceUtils.getInstance().getService(IPageManager.class, editor.getServicesRegistry()).closePage(diagram); flushDisplayEvents(); } + activeDiagramEditor = null; } catch (Exception e) { throw new IllegalStateException("Cannot close diagram", e); } @@ -1591,13 +1592,17 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit return getNewEditPart(parent, request.getViewDescriptors()); } - private IGraphicalEditPart getNewEditPart(EditPart context, Collection<? extends ViewDescriptor> viewDescriptors) { + + /** + * @since 3.3 + */ + protected IGraphicalEditPart getNewEditPart(EditPart context, Collection<? extends ViewDescriptor> viewDescriptors) { return viewDescriptors.stream() .map(desc -> desc.getAdapter(View.class)).map(View.class::cast) .filter(Objects::nonNull) .map(view -> DiagramEditPartsUtil.getEditPartFromView(view, context)) .filter(IGraphicalEditPart.class::isInstance).map(IGraphicalEditPart.class::cast) - .findAny().orElseGet(failOnAbsence("Could not find newly created edit-part")); + .findAny().orElseGet(failOnAbsence("Could not find newly created edit-part")); //$NON-NLS-1$ } /** |