Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java')
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java95
1 files changed, 3 insertions, 92 deletions
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java
index a98efb09618..3dc26b39d77 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/AbstractEditorIntegrationTest.java
@@ -11,105 +11,16 @@
*****************************************************************************/
package org.eclipse.papyrus.editor.integration.tests.tests;
-import org.eclipse.core.resources.IFile;
-import org.eclipse.core.resources.IProject;
-import org.eclipse.core.runtime.NullProgressMonitor;
-import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.editor.integration.tests.Activator;
-import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
-import org.eclipse.papyrus.infra.core.resource.ModelSet;
-import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
-import org.eclipse.papyrus.infra.core.services.ServiceException;
-import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
-import org.eclipse.papyrus.junit.utils.EditorUtils;
-import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
-import org.eclipse.papyrus.junit.utils.ProjectUtils;
-import org.eclipse.swt.widgets.Display;
-import org.eclipse.ui.IEditorPart;
-import org.junit.After;
-import org.junit.Assert;
+import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest;
import org.osgi.framework.Bundle;
-public abstract class AbstractEditorIntegrationTest {
+public abstract class AbstractEditorIntegrationTest extends AbstractEditorTest {
- protected IMultiDiagramEditor editor;
-
- protected IProject project;
-
- /**
- *
- * @return
- * the current bundle
- */
+ @Override
protected Bundle getBundle() {
return Activator.getDefault().getBundle();
}
- /**
- * Inits this.editor
- * Fails or throws an exception if an error occurs
- *
- * @param bundle
- * TODO
- */
- protected void initModel(String projectName, String modelName, Bundle bundle) throws Exception {
- project = ProjectUtils.createProject(projectName);
- final IFile diModelFile = PapyrusProjectUtils.copyPapyrusModel(project, getBundle(), getSourcePath(), modelName);
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- try {
- editor = EditorUtils.openPapyrusEditor(diModelFile);
- } catch (Exception ex) {
- Activator.log.error(ex);
- Assert.fail(ex.getMessage());
- }
- }
- });
-
- Assert.assertNotNull(editor);
- }
-
- @After
- public void dispose() throws Exception {
- if(editor != null) {
- Display.getDefault().syncExec(new Runnable() {
-
- public void run() {
- ((IEditorPart)editor).getSite().getPage().closeEditor(editor, false);
- }
- });
-
- editor = null;
- }
-
- if(project != null) {
- project.delete(true, new NullProgressMonitor());
- project = null;
- }
- }
-
- protected IPageManager getPageManager() throws ServiceException {
- return getServicesRegistry().getService(IPageManager.class);
- }
-
- protected ServicesRegistry getServicesRegistry() throws ServiceException {
- return editor.getServicesRegistry();
- }
-
- protected TransactionalEditingDomain getTransactionalEditingDomain() throws ServiceException {
- return getServicesRegistry().getService(TransactionalEditingDomain.class);
- }
-
- protected ModelSet getModelSet() throws ServiceException {
- return getServicesRegistry().getService(ModelSet.class);
- }
-
- /**
- * The path to the source model folder
- *
- * @return
- */
- protected abstract String getSourcePath();
}

Back to the top