Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaged Elaasar2017-02-21 03:19:48 -0500
committerFlorian Noyrit2017-03-13 12:19:06 -0400
commit7a1e61e4203fcf468a2635b80dd94182a95b588b (patch)
tree804451f2f230c2cb1a4b07815f4ccd2dc1edcf52 /tests/junit/plugins/editor
parentcb10068854ce727bc5004e997663ae0a3ae2ffd6 (diff)
downloadorg.eclipse.papyrus-7a1e61e4203fcf468a2635b80dd94182a95b588b.tar.gz
org.eclipse.papyrus-7a1e61e4203fcf468a2635b80dd94182a95b588b.tar.xz
org.eclipse.papyrus-7a1e61e4203fcf468a2635b80dd94182a95b588b.zip
Bug 510451 - Reimplement the ISO42010 specification to properly support
architectural contexts and viewpoints Replaced the viewpoint configuration framework by a new architectural context/viewpoint framework. This involves defining architecture contexts and viewpoints in models and contributing them via extension points or via the preferences. Models reference an architecture context and a set of viewpoints at creation time, but can be switched later. Architecture contexts double as client contexts for which elementtypesetconfigurations can be registered. They also define viewpoints, which reference representation kinds (diagrams or tables). This contribution defines three architecture contexts: UML, Profile, and SysML corresponding to what Papyrus used to call diagram categories. Change-Id: I203b58d9e97afdffc45c2674683c0281eb8a7c5b Signed-off-by: Maged Elaasar <melaasar@gmail.com>
Diffstat (limited to 'tests/junit/plugins/editor')
-rw-r--r--tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java19
-rw-r--r--tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java28
2 files changed, 35 insertions, 12 deletions
diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java
index 79f6099c62b..ebfd7b5d3aa 100644
--- a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java
+++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/ModelSetTests.java
@@ -15,15 +15,17 @@ import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.editor.integration.tests.Activator;
+import org.eclipse.papyrus.infra.architecture.commands.IModelCreationCommand;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.sashwindows.di.service.IPageManager;
import org.eclipse.papyrus.infra.core.services.ExtensionServicesRegistry;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.core.utils.DiResourceSet;
-import org.eclipse.papyrus.infra.ui.extension.commands.IModelCreationCommand;
import org.eclipse.papyrus.junit.utils.EditorUtils;
import org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand;
import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor;
@@ -59,7 +61,7 @@ public class ModelSetTests extends AbstractEditorIntegrationTest {
@Test
public void testCreateModelWithSpecialChars() throws Exception {
- ModelSet modelSet = new DiResourceSet();
+ final ModelSet modelSet = new DiResourceSet();
IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("diagramCreationWithSpecialChars");
emptyModelCreationProject.create(new NullProgressMonitor());
emptyModelCreationProject.open(new NullProgressMonitor());
@@ -81,10 +83,17 @@ public class ModelSetTests extends AbstractEditorIntegrationTest {
//Ignore
}
- IModelCreationCommand creationCommand = new CreateUMLModelCommand();
- creationCommand.createModel(modelSet);
+ // create the UML model
+ TransactionalEditingDomain ted = modelSet.getTransactionalEditingDomain();
+ ted.getCommandStack().execute(new RecordingCommand(ted) {
+ @Override
+ protected void doExecute() {
+ IModelCreationCommand creationCommand = new CreateUMLModelCommand();
+ creationCommand.createModel(modelSet);
+ }
+ });
- //Create the root UML Model
+ //get the root UML Model
UmlModel umlModel = (UmlModel)modelSet.getModel(UmlModel.MODEL_ID);
Model model = (Model)umlModel.lookupRoot();
diff --git a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java
index 4bbcfb5f3c1..fb5fc9c013d 100644
--- a/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java
+++ b/tests/junit/plugins/editor/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/PageManagerTests.java
@@ -38,6 +38,7 @@ import org.eclipse.papyrus.commands.DestroyElementPapyrusCommand;
import org.eclipse.papyrus.commands.ICreationCommand;
import org.eclipse.papyrus.commands.OpenDiagramCommand;
import org.eclipse.papyrus.editor.integration.tests.Activator;
+import org.eclipse.papyrus.infra.architecture.commands.IModelCreationCommand;
import org.eclipse.papyrus.infra.core.resource.ModelSet;
import org.eclipse.papyrus.infra.core.sasheditor.editor.IPage;
import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
@@ -50,7 +51,6 @@ import org.eclipse.papyrus.infra.emf.gmf.command.GMFtoEMFCommandWrapper;
import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
-import org.eclipse.papyrus.infra.ui.extension.commands.IModelCreationCommand;
import org.eclipse.papyrus.junit.utils.EditorUtils;
import org.eclipse.papyrus.uml.diagram.clazz.CreateClassDiagramCommand;
import org.eclipse.papyrus.uml.diagram.clazz.UmlClassDiagramForMultiEditor;
@@ -81,7 +81,7 @@ public class PageManagerTests extends AbstractEditorIntegrationTest {
@Test
public void testModelWithDiagramCreation() throws Exception {
- ModelSet modelSet = new DiResourceSet();
+ final ModelSet modelSet = new DiResourceSet();
IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("diagramModelCreation");
emptyModelCreationProject.create(new NullProgressMonitor());
emptyModelCreationProject.open(new NullProgressMonitor());
@@ -101,8 +101,14 @@ public class PageManagerTests extends AbstractEditorIntegrationTest {
// Ignore
}
- IModelCreationCommand creationCommand = new CreateUMLModelCommand();
- creationCommand.createModel(modelSet);
+ TransactionalEditingDomain ted = modelSet.getTransactionalEditingDomain();
+ ted.getCommandStack().execute(new RecordingCommand(ted) {
+ @Override
+ protected void doExecute() {
+ IModelCreationCommand creationCommand = new CreateUMLModelCommand();
+ creationCommand.createModel(modelSet);
+ }
+ });
// Create the root UML Model
UmlModel umlModel = (UmlModel) modelSet.getModel(UmlModel.MODEL_ID);
@@ -162,7 +168,7 @@ public class PageManagerTests extends AbstractEditorIntegrationTest {
}
private IFile createEmptyModel() throws Exception {
- ModelSet modelSet = new DiResourceSet();
+ final ModelSet modelSet = new DiResourceSet();
IProject emptyModelCreationProject = ResourcesPlugin.getWorkspace().getRoot().getProject("emptyModelCreation");
emptyModelCreationProject.create(new NullProgressMonitor());
emptyModelCreationProject.open(new NullProgressMonitor());
@@ -171,8 +177,16 @@ public class PageManagerTests extends AbstractEditorIntegrationTest {
modelSet.createsModels(emptyModelDi);
- IModelCreationCommand creationCommand = new CreateUMLModelCommand();
- creationCommand.createModel(modelSet);
+ // create the UML model
+ TransactionalEditingDomain ted = modelSet.getTransactionalEditingDomain();
+ ted.getCommandStack().execute(new RecordingCommand(ted) {
+ @Override
+ protected void doExecute() {
+ IModelCreationCommand creationCommand = new CreateUMLModelCommand();
+ creationCommand.createModel(modelSet);
+ }
+ });
+
modelSet.save(new NullProgressMonitor());

Back to the top