Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2015-02-26 09:33:39 +0000
committerEsteban DUGUEPEROUX2015-02-27 08:45:19 +0000
commit81a8b1f44c065dd8dfd198e33d66e4eca395c04d (patch)
tree91f99cbe454d3814ab9fe0b8412dbe18a405a800
parent8a5ceae32a9a2414cf1a48a01ba98107b8406a66 (diff)
downloadorg.eclipse.sirius-81a8b1f44c065dd8dfd198e33d66e4eca395c04d.tar.gz
org.eclipse.sirius-81a8b1f44c065dd8dfd198e33d66e4eca395c04d.tar.xz
org.eclipse.sirius-81a8b1f44c065dd8dfd198e33d66e4eca395c04d.zip
[452962] Update DAnalysisSessionImpl.doSave() to not send
SessionListener.SEMANTIC_CHANGE - Update DAnalysisSessionImpl.doSave() to not send a SessionListener.SEMANTIC_CHANGE event on save as this event is sent by SemanticResourcesUpdater. - Update SessionManagerListener2Tests to copy its data in workspace before testing. Bug: 452962 Change-Id: I223ae5936524d8906af7758713903c38525dcb75 Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr>
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.html7
-rw-r--r--plugins/org.eclipse.sirius.doc/doc/Release Notes.textile1
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionManagerListener2Tests.java13
-rw-r--r--plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/modeler/ecore/EcoreModeler.java6
-rw-r--r--plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java10
5 files changed, 22 insertions, 15 deletions
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
index 3e7d6d3ebc..0121e3e79d 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.html
@@ -95,6 +95,13 @@
<code>EDataType</code>, it is not an
<code>EObject</code> anymore.
</li>
+ <li>
+ <code>org.eclipse.sirius.business.api.session.SessionListener.SEMANTIC_CHANGE</code> is no more send to
+ <code>SessionListener</code> and
+ <code>SessionManagerListener</code> listeners on save when a semantic resource is saved. Use a
+ <code>ResourceSyncClient</code> listener on
+ <code>ResourceSetSync</code> to have know if a semantic resource is saved.
+ </li>
</ul>
<h4 id="Changesinorg.eclipse.sirius.ui">Changes in
<code>org.eclipse.sirius.ui</code>
diff --git a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
index a5c076ad8a..c3a032f072 100644
--- a/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
+++ b/plugins/org.eclipse.sirius.doc/doc/Release Notes.textile
@@ -29,6 +29,7 @@ h4. Changes in @org.eclipse.sirius@
* The @isBbocked()@ and @setBlocked()@ methods on the @org.eclipse.sirius.viewpoint.DAnalysisSessionEObject@ EClass have been removed, as they were not actually used in the internal code.
* The @org.eclipse.sirius.business.api.session.Session.createSemanticResource()@ method has been removed. Use @Session.addSemanticResource()@ instead.
* @org.eclipse.sirius.viewpoint.RGBValues@ has been changed from an @EClass@ to an @EDataType@, it is not an @EObject@ anymore.
+* @org.eclipse.sirius.business.api.session.SessionListener.SEMANTIC_CHANGE@ is no more send to @SessionListener@ and @SessionManagerListener@ listeners on save when a semantic resource is saved. Use a @ResourceSyncClient@ listener on @ResourceSetSync@ to have know if a semantic resource is saved.
h4. Changes in @org.eclipse.sirius.ui@
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionManagerListener2Tests.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionManagerListener2Tests.java
index dfda86d272..dcc4cb0718 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionManagerListener2Tests.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/api/session/SessionManagerListener2Tests.java
@@ -37,6 +37,7 @@ import org.eclipse.sirius.business.api.session.SessionStatus;
import org.eclipse.sirius.business.api.session.danalysis.DAnalysisSession;
import org.eclipse.sirius.business.internal.session.danalysis.SaveSessionJob;
import org.eclipse.sirius.diagram.DDiagram;
+import org.eclipse.sirius.tests.SiriusTestsPlugin;
import org.eclipse.sirius.tests.support.api.EclipseTestsSupportHelper;
import org.eclipse.sirius.tests.support.api.SiriusDiagramTestCase;
import org.eclipse.sirius.tests.support.api.TestsUtil;
@@ -78,22 +79,26 @@ public class SessionManagerListener2Tests extends SiriusDiagramTestCase implemen
changeSiriusUIPreference(SiriusUIPreferencesKeys.PREF_RELOAD_ON_LAST_EDITOR_CLOSE.name(), true);
changeSiriusUIPreference(SiriusUIPreferencesKeys.PREF_SAVE_WHEN_NO_EDITOR.name(), true);
+ copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, ZOOM_SEMANTIC_MODEL_FOLDER_PATH, ZOOM_SEMANTIC_MODEL_NAME);
+ copyFilesToTestProject(SiriusTestsPlugin.PLUGIN_ID, PACKAGES_SEMANTIC_MODEL_FOLDER_PATH, PACKAGES_SEMANTIC_MODEL_NAME);
+
/* Initialize session 2 */
String alternativeSessionResourcePath = TEMPORARY_PROJECT_NAME + "/" + "alternativeSession.aird";
- genericSetUp(ZOOM_SEMANTIC_MODEL_PATH, MODELER_PATH, alternativeSessionResourcePath);
+ genericSetUp(TEMPORARY_PROJECT_NAME + "/" + ZOOM_SEMANTIC_MODEL_NAME, MODELER_PATH, alternativeSessionResourcePath);
alternateSession = session;
alternateSemanticModel = alternateSession.getSemanticResources().iterator().next().getContents().get(0);
initViewpoint(DESIGN_VIEWPOINT_NAME, alternateSession, alternateSemanticModel);
TestsUtil.emptyEventsFromUIThread();
String sessionResourcePath = TEMPORARY_PROJECT_NAME + "/" + "session.aird";
- genericSetUp(PACKAGES_SEMANTIC_MODEL_PATH, MODELER_PATH, sessionResourcePath);
+ genericSetUp(TEMPORARY_PROJECT_NAME + "/" + PACKAGES_SEMANTIC_MODEL_NAME, MODELER_PATH, sessionResourcePath);
initViewpoint(DESIGN_VIEWPOINT_NAME);
TestsUtil.emptyEventsFromUIThread();
- Job.getJobManager().join(SaveSessionJob.FAMILY, new NullProgressMonitor());
+ session.save(new NullProgressMonitor());
mock = createMock(SessionManagerListener.class);
- // by default in easymock 2.4 a mock wasn't allowed to be called in multiple threads unless it was made thread-safe
+ // by default in easymock 2.4 a mock wasn't allowed to be called in
+ // multiple threads unless it was made thread-safe
makeThreadSafe(mock, true);
SessionManager.INSTANCE.addSessionsListener(mock);
diff --git a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/modeler/ecore/EcoreModeler.java b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/modeler/ecore/EcoreModeler.java
index 681deee560..2a71a96bc1 100644
--- a/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/modeler/ecore/EcoreModeler.java
+++ b/plugins/org.eclipse.sirius.tests.junit/src/org/eclipse/sirius/tests/unit/diagram/modeler/ecore/EcoreModeler.java
@@ -26,7 +26,11 @@ public interface EcoreModeler {
String PACKAGES_SEMANTIC_MODEL_PATH = "/" + SiriusTestsPlugin.PLUGIN_ID + PACKAGES_SEMANTIC_MODEL_FOLDER_PATH + PACKAGES_SEMANTIC_MODEL_NAME; //$NON-NLS-1$
- String ZOOM_SEMANTIC_MODEL_PATH = "/" + SiriusTestsPlugin.PLUGIN_ID + "/data/unit/modelers/ecore/design/zoom.ecore"; //$NON-NLS-1$ $NON-NLS-2$
+ String ZOOM_SEMANTIC_MODEL_NAME = "zoom.ecore"; //$NON-NLS-1$
+
+ String ZOOM_SEMANTIC_MODEL_FOLDER_PATH = "/data/unit/modelers/ecore/design/"; //$NON-NLS-1$
+
+ String ZOOM_SEMANTIC_MODEL_PATH = "/" + SiriusTestsPlugin.PLUGIN_ID + ZOOM_SEMANTIC_MODEL_FOLDER_PATH + ZOOM_SEMANTIC_MODEL_NAME; //$NON-NLS-1$ $NON-NLS-2$
String MODELER_PATH = "/org.eclipse.sirius.sample.ecore.design/description/ecore.odesign";//$NON-NLS-1$
diff --git a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
index 7b37ca56f5..d0aaa2c5ff 100644
--- a/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
+++ b/plugins/org.eclipse.sirius/src/org/eclipse/sirius/business/internal/session/danalysis/DAnalysisSessionImpl.java
@@ -833,16 +833,6 @@ public class DAnalysisSessionImpl extends DAnalysisSessionEObjectImpl implements
// has already been logged.
status = save.getStatus();
} else {
- boolean semanticSave = false;
- for (final Resource resource : savedResources) {
- if (semanticResourcesCollection.contains(resource) || getControlledResources().contains(resource)) {
- semanticSave = true;
- }
- }
- if (semanticSave) {
- notifyListeners(SessionListener.SEMANTIC_CHANGE);
- }
- monitor.worked(1);
CommandStack commandStack = transactionalEditingDomain.getCommandStack();
if (commandStack instanceof BasicCommandStack) {
((BasicCommandStack) commandStack).saveIsDone();

Back to the top