diff options
author | Esteban Dugueperoux | 2014-08-14 15:10:37 +0000 |
---|---|---|
committer | Esteban DUGUEPEROUX | 2014-08-18 07:09:15 +0000 |
commit | 71cd3bdfa26d02789976ab4d712df8d663f70ffb (patch) | |
tree | a2b3e50b12e6c67ae2a42c935bb4b3bf83e66bd0 | |
parent | e020255f5d11ac670b8c37eb97e9c8e5993e685b (diff) | |
download | org.eclipse.sirius-71cd3bdfa26d02789976ab4d712df8d663f70ffb.tar.gz org.eclipse.sirius-71cd3bdfa26d02789976ab4d712df8d663f70ffb.tar.xz org.eclipse.sirius-71cd3bdfa26d02789976ab4d712df8d663f70ffb.zip |
[419926] Fix a rebranding issue on SiriusTestCase
SiriusTestCase.deactivateSirius()->deactivateViewpoint()
SiriusTestCase.initSirius()->initViewpoint()
SiriusTestCase.findSirius()->findViewpoint()
Bug: 419926
Change-Id: Id87adf17b5f67adc98e095e8d86d8473b956cb77
Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr>
3 files changed, 44 insertions, 32 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html index 7314c3cf63..374b50e10a 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html +++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html @@ -168,6 +168,14 @@ <code>SWTBotSiriusDiagramEditor.getDiagramEditPart()</code> has been added. It allows to retrieve the diagram edit part of the current editor. </li> </ul> + <h4 id="Changesinorg.eclipse.sirius.tests.support">Changes in + <code>org.eclipse.sirius.tests.support</code> + </h4> + <ul> + <li>In + <code>org.eclipse.sirius.test.support.SiriusTestCase</code>, the methods deactivateSirius(), initSirius() and findSirius() have been renamed into deactivateViewpoint(), initViewpoint() and findViewppoint() to correct a wrong rebranding. + </li> + </ul> <h2 id="sirius1.0.0">Changes in Sirius 1.0.0 (from Sirius 1.0.0M7)</h2> <h3 id="UserVisibleChanges2">User-Visible Changes</h3> <ul> @@ -754,7 +762,7 @@ <code>MappingHiearchy.HiearchyIterator</code> has been removed from API. </li> </ul> - <h4 id="Changesinorg.eclipse.sirius.tests.support">Changes in + <h4 id="Changesinorg.eclipse.sirius.tests.support2">Changes in <code>org.eclipse.sirius.tests.support</code> </h4> <ul> @@ -1674,4 +1682,4 @@ void removeSelectedView(DView view); </li> </ul> </body> -</html>
\ No newline at end of file +</html> diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile index 5838b7a78d..50dd8802cb 100644 --- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile +++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile @@ -52,6 +52,10 @@ h4. Changes in @org.eclipse.sirius.tests.swtbot.support@ * The method @SWTBotSiriusDiagramEditor.adaptLocationToSnap(Point)@ has been added. It allows to adapt location according to SnapToHelper of the current editor. * The method @SWTBotSiriusDiagramEditor.getDiagramEditPart()@ has been added. It allows to retrieve the diagram edit part of the current editor. +h4. Changes in @org.eclipse.sirius.tests.support@ + +* In @org.eclipse.sirius.test.support.SiriusTestCase@, the methods deactivateSirius(), initSirius() and findSirius() have been renamed into deactivateViewpoint(), initViewpoint() and findViewppoint() to correct a wrong rebranding. + h2(#sirius1.0.0). Changes in Sirius 1.0.0 (from Sirius 1.0.0M7) h3. User-Visible Changes diff --git a/plugins/org.eclipse.sirius.tests.support/src/org/eclipse/sirius/tests/support/api/SiriusTestCase.java b/plugins/org.eclipse.sirius.tests.support/src/org/eclipse/sirius/tests/support/api/SiriusTestCase.java index d2c6c7dfb4..47987e7916 100644 --- a/plugins/org.eclipse.sirius.tests.support/src/org/eclipse/sirius/tests/support/api/SiriusTestCase.java +++ b/plugins/org.eclipse.sirius.tests.support/src/org/eclipse/sirius/tests/support/api/SiriusTestCase.java @@ -683,7 +683,7 @@ public abstract class SiriusTestCase extends TestCase { * the name of the viewpoint to initialize. */ protected final void initViewpoint(final String viewpointName) { - initSirius(viewpointName, session, semanticModel); + initViewpoint(viewpointName, session, semanticModel); } /** @@ -697,16 +697,16 @@ public abstract class SiriusTestCase extends TestCase { * the model to use to initialize the viewpoint * @since 1.1 */ - protected final void initSirius(final String viewpointName, final Session alternateSession, final EObject alternateSemanticModel) { - Viewpoint localSessionSirius = null; + protected final void initViewpoint(final String viewpointName, final Session alternateSession, final EObject alternateSemanticModel) { + Viewpoint localSessionViewpoint = null; for (final Viewpoint viewpoint : viewpoints) { if (viewpointName != null && viewpointName.equals(viewpoint.getName())) { - localSessionSirius = getViewpointFromName(viewpointName, alternateSession); + localSessionViewpoint = getViewpointFromName(viewpointName, alternateSession); break; } } - if (localSessionSirius != null) { - Command changeSiriussSelectionCmd = new ChangeViewpointSelectionCommand(alternateSession, new ViewpointSelectionCallback(), Collections.singleton(localSessionSirius), + if (localSessionViewpoint != null) { + Command changeSiriussSelectionCmd = new ChangeViewpointSelectionCommand(alternateSession, new ViewpointSelectionCallback(), Collections.singleton(localSessionViewpoint), Collections.<Viewpoint> emptySet(), new NullProgressMonitor()); alternateSession.getTransactionalEditingDomain().getCommandStack().execute(changeSiriussSelectionCmd); } @@ -719,18 +719,18 @@ public abstract class SiriusTestCase extends TestCase { * the viewpoint name to activate */ protected final void activateViewpoint(final String name) { - boolean activatedSirius = false; + boolean activatedViewpoint = false; for (final Viewpoint viewpoint : viewpoints) { if (name.equals(viewpoint.getName())) { Viewpoint viewpointFromName = getViewpointFromName(name, session); Command changeSiriussSelection = new ChangeViewpointSelectionCommand(session, selectionCallback, Collections.singleton(viewpointFromName), Collections.<Viewpoint> emptySet(), new NullProgressMonitor()); session.getTransactionalEditingDomain().getCommandStack().execute(changeSiriussSelection); - activatedSirius = true; + activatedViewpoint = true; break; } } - if (!activatedSirius) { + if (!activatedViewpoint) { for (final Viewpoint viewpoint : ViewpointRegistry.getInstance().getViewpoints()) { if (name.equals(viewpoint.getName())) { Viewpoint viewpointFromName = getViewpointFromName(name, session); @@ -741,7 +741,7 @@ public abstract class SiriusTestCase extends TestCase { Command changeSiriussSelection = new ChangeViewpointSelectionCommand(session, selectionCallback, Collections.singleton(viewpointFromName), Collections.<Viewpoint> emptySet(), new NullProgressMonitor()); session.getTransactionalEditingDomain().getCommandStack().execute(changeSiriussSelection); - activatedSirius = true; + activatedViewpoint = true; break; } } @@ -754,26 +754,26 @@ public abstract class SiriusTestCase extends TestCase { * @param name * the viewpoint name to deactivate */ - protected final void deactivateSirius(final String name) { - boolean deactivatedSirius = false; + protected final void deactivateViewpoint(final String name) { + boolean deactivatedViewpoint = false; for (final Viewpoint viewpoint : viewpoints) { if (name.equals(viewpoint.getName())) { Viewpoint viewpointFromName = getViewpointFromName(name, session); Command changeSiriussSelection = new ChangeViewpointSelectionCommand(session, selectionCallback, Collections.<Viewpoint> emptySet(), Collections.singleton(viewpointFromName), new NullProgressMonitor()); session.getTransactionalEditingDomain().getCommandStack().execute(changeSiriussSelection); - deactivatedSirius = true; + deactivatedViewpoint = true; break; } } - if (!deactivatedSirius) { + if (!deactivatedViewpoint) { for (final Viewpoint viewpoint : ViewpointRegistry.getInstance().getViewpoints()) { if (name.equals(viewpoint.getName())) { Viewpoint viewpointFromName = getViewpointFromName(name, session); Command changeSiriussSelection = new ChangeViewpointSelectionCommand(session, selectionCallback, Collections.<Viewpoint> emptySet(), Collections.singleton(viewpointFromName), new NullProgressMonitor()); session.getTransactionalEditingDomain().getCommandStack().execute(changeSiriussSelection); - deactivatedSirius = true; + deactivatedViewpoint = true; break; } } @@ -867,8 +867,8 @@ public abstract class SiriusTestCase extends TestCase { for (final RepresentationDescription description : descriptions) { if (description.getName().equals(representationDescriptionName)) { Viewpoint viewpointOfRegistry = (Viewpoint) description.eContainer(); - Viewpoint localSirius = getViewpointFromName(viewpointOfRegistry.getName()); - RepresentationDescription localDescription = getLocalSessionRepresentationDescription(localSirius, representationDescriptionName); + Viewpoint localViewpoint = getViewpointFromName(viewpointOfRegistry.getName()); + RepresentationDescription localDescription = getLocalSessionRepresentationDescription(localViewpoint, representationDescriptionName); representation = DialectManager.INSTANCE.createRepresentation(name, semantic, localDescription, sessionToUse, new NullProgressMonitor()); return; } @@ -891,7 +891,7 @@ public abstract class SiriusTestCase extends TestCase { * Get a {@link RepresentationDescription} ref from the current session * ResourceSet. * - * @param localSirius + * @param localViewpoint * the Sirius local to the current session ResourceSet containing * the {@link RepresentationDescription} to get * @@ -900,8 +900,8 @@ public abstract class SiriusTestCase extends TestCase { * * @return the {@link RepresentationDescription} to get */ - private RepresentationDescription getLocalSessionRepresentationDescription(Viewpoint localSirius, String representationDescriptionName) { - Iterable<RepresentationDescription> candidates = new ViewpointQuery(localSirius).getAllRepresentationDescriptions(); + private RepresentationDescription getLocalSessionRepresentationDescription(Viewpoint localViewpoint, String representationDescriptionName) { + Iterable<RepresentationDescription> candidates = new ViewpointQuery(localViewpoint).getAllRepresentationDescriptions(); RepresentationDescription result = null; for (RepresentationDescription localDescription : candidates) { if (representationDescriptionName.equals(localDescription.getName())) { @@ -931,20 +931,20 @@ public abstract class SiriusTestCase extends TestCase { * the viewpointName to look for * * @param sessionToUse - * the Session from which ResourceSet to return the Sirius + * the Session from which ResourceSet to return the Viewpoint * * @return the first {@link Viewpoint} of the viewpoints Set, return a - * logical Sirius from the session's ResourceSet and not from the - * SiriusRegistry's ResourceSet + * logical Viewpoint from the session's ResourceSet and not from the + * {@link ViewpointRegistry}'s ResourceSet */ public Viewpoint getViewpointFromName(String viewpointName, Session sessionToUse) { Viewpoint localViewpoint = null; for (Viewpoint viewpoint : viewpoints) { if (viewpoint.getName() != null && viewpoint.getName().equals(viewpointName)) { URI viewpointResourceURI = viewpoint.eResource().getURI(); - Resource newSiriusResource = sessionToUse.getTransactionalEditingDomain().getResourceSet().getResource(viewpointResourceURI, true); - if (!newSiriusResource.getContents().isEmpty() && newSiriusResource.getContents().get(0) instanceof Group) { - Group group = (Group) newSiriusResource.getContents().get(0); + Resource newViewpointResource = sessionToUse.getTransactionalEditingDomain().getResourceSet().getResource(viewpointResourceURI, true); + if (!newViewpointResource.getContents().isEmpty() && newViewpointResource.getContents().get(0) instanceof Group) { + Group group = (Group) newViewpointResource.getContents().get(0); Iterator<Viewpoint> iter = group.getOwnedViewpoints().iterator(); while (iter.hasNext() && localViewpoint == null) { @@ -1688,12 +1688,12 @@ public abstract class SiriusTestCase extends TestCase { * Find a viewpoint by name from the global registry. * * @param name - * name of the Sirius to look for. - * @return the first Sirius found in the registry with the specified name, - * if any. The instance returned is the one from the Sirius + * name of the {@link Viewpoint} to look for. + * @return the first {@link Viewpoint} found in the registry with the specified name, + * if any. The instance returned is the one from the {@link Viewpoint} * registry's editing domain. */ - protected Option<Viewpoint> findSirius(String name) { + protected Option<Viewpoint> findViewpoint(String name) { for (Viewpoint vp : ViewpointRegistry.getInstance().getViewpoints()) { if (vp.getName().equals(name)) { return Options.newSome(vp); |