diff options
| author | Esteban Dugueperoux | 2016-02-08 10:52:08 +0000 |
|---|---|---|
| committer | Esteban DUGUEPEROUX | 2016-02-09 13:45:54 +0000 |
| commit | 725366169ddbb98bf9ea3d3fe7c353622db0e2a2 (patch) | |
| tree | 71fea9dd35c60e2d9fa89670d7776d3f3e6ec61e | |
| parent | 9f09a3e78375e1eab510bb92364cd9f357b7afcd (diff) | |
| download | org.eclipse.sirius-725366169ddbb98bf9ea3d3fe7c353622db0e2a2.tar.gz org.eclipse.sirius-725366169ddbb98bf9ea3d3fe7c353622db0e2a2.tar.xz org.eclipse.sirius-725366169ddbb98bf9ea3d3fe7c353622db0e2a2.zip | |
[486330] Update DAnalysisSessionTests to activate Viewpoints
- DAnalysisSessionTests viewpoints were not activated
Bug: 486330
Change-Id: If52df6fe953b223613ad564d4b1872f1b31eebd9
Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr>
| -rw-r--r-- | plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/DAnalysisSessionTests.java | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/DAnalysisSessionTests.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/DAnalysisSessionTests.java index 188215dd67..ea42700949 100644 --- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/DAnalysisSessionTests.java +++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/DAnalysisSessionTests.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2010, 2015 THALES GLOBAL SERVICES. + * Copyright (c) 2010, 2016 THALES GLOBAL SERVICES. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -25,6 +25,7 @@ import org.eclipse.emf.transaction.RecordingCommand; import org.eclipse.emf.transaction.TransactionalEditingDomain; import org.eclipse.gmf.runtime.diagram.ui.resources.editor.parts.DiagramDocumentEditor; import org.eclipse.sirius.business.api.dialect.DialectManager; +import org.eclipse.sirius.business.api.dialect.command.CreateRepresentationCommand; import org.eclipse.sirius.business.api.dialect.command.RefreshRepresentationsCommand; import org.eclipse.sirius.business.api.session.Session; import org.eclipse.sirius.business.api.session.SessionManager; @@ -69,6 +70,8 @@ public class DAnalysisSessionTests extends SiriusDiagramTestCase { changeSiriusUIPreference(SiriusUIPreferencesKeys.PREF_SAVE_WHEN_NO_EDITOR.name(), false); genericSetUp(SEMANTIC_MODEL_PATH, MODELER_PATH); + initViewpoint("UML2 Benchmarks Acceleo"); + initViewpoint("UML2 Benchmarks OCL"); } /** @@ -101,16 +104,12 @@ public class DAnalysisSessionTests extends SiriusDiagramTestCase { final RepresentationDescription representationDescription = description; while (it.hasNext()) { final EObject cur = it.next(); - if (DialectManager.INSTANCE.canCreate(cur, description)) { - editingDomain.getCommandStack().execute(new RecordingCommand(editingDomain) { - @Override - protected void doExecute() { - doOpenSession(); - final DRepresentation rep = DialectManager.INSTANCE.createRepresentation("Diagram for " + cur, cur, representationDescription, session, new NullProgressMonitor()); - Assert.assertNotNull("The representation has not been created ! ", rep); - representations.add(rep); - } - }); + if (DialectManager.INSTANCE.canCreate(cur, representationDescription)) { + CreateRepresentationCommand createRepresentationCommand = new CreateRepresentationCommand(session, representationDescription, cur, "Diagram for " + cur, new NullProgressMonitor()); + editingDomain.getCommandStack().execute(createRepresentationCommand); + DRepresentation rep = createRepresentationCommand.getCreatedRepresentation(); + Assert.assertNotNull("The representation has not been created ! ", rep); + representations.add(rep); } } Assert.assertEquals("We should have " + wantedRepresentations + " representations", wantedRepresentations, representations.size()); |
