[test] Make SiriusControlAndDeleteRepresentationTest more reliable

This test directly use resource.save(SomeOutputstream) to snapshot in
memory models.
Calling resource.save() has side-effects on the resourceset notably
setting isModified and notifying all the listeners which lead to an
unexpected amount of logic triggered because of the test behavior.

This change inhibit those side effects to have a more reliable test.

Change-Id: I2528c70d618c98154d9e524a6decba86d212780d
Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
[441483] Fix runtime errors in SWTBot test suite

The first test in the SWTBot suite,
ViewpointSpecificationProjectCreationTest, creates a plug-in project,
which triggers PDE. PDE requires PlatformAdmin to work properly, but
this was removed in Luna [1], and we did not have the workaround in
place to force the compatiblity bunde to be present.

Add the required dependency via the surefire plug-in configuration to
ensure everything needed is present at runtime (see [2]).

Also add a explicit dependencies to org.eclipse.sdk.ide and
org.eclipse.platform to the SWTBot tests plug-in, which seem to fix a
seemingly unrelated error about "Product org.eclipse.sdk.ide could not
be found." at the beginning of the tests.

[1] https://wiki.eclipse.org/Equinox/Luna_Framework#Removal_of_the_PlatformAdmin_Service_Implementation
[2] https://issues.jboss.org/browse/JBIDE-16161

Change-Id: I3661bba68cd66e9f8919624cde830c206266d207
Signed-off-by: Pierre-Charles David <pierre-charles.david@obeo.fr>
[430724] Session.save will now postpone the save in post-commit

Bug: 430724
Signed-off-by: Cedric Brun <cedric.brun@obeo.fr>
Improve IsModifiedSavingPolicy to avoid False Positives

This adaptation of IsModifiedSavingPolicy is closer to the
SavingPolicyImpl strategy:
1. it uses the resource.isModified state as a basis to compute
what needs to be saved. Any resource marked has having been migrated
will also be considered "logically modified".
2. it browse the other resources to detect dependencies toward
resources which are modified
3. it filter this set of logically modified resources by serializing
them in a file buffer and comparing the result with the current file.

This strategy has the following characteristics :
- we avoid many serializations compared to the SavingPolicyImpl
  implementation by using the isModified boolean
- On the other hand we might browse the models, but this is made in a
  way that proxies should not be resolved. In practice this did not even
  came up in the profiling traces.
- we will never ever actually save the file if there is no change (just
  like the previous policy)
- If we *miss* a resource in the first step and don't consider it
logically modified whereas we should, its a bug and some resources might
not have been saved.

Also this commit makes sure only platform:/resources are considered
(which is important for CDOResources for instance, we don't need to
browse the model there, or Ecore resource with http:// URIs, we don't
need to send PUT on the Eclipse Server...)
It make sures non existing files will be saved anyway as their
"isModifed" status would not be enough for a resource which just got
created in memory for instance.
It also makes the IsModifiedSavingPolicy ignore resource.isLoaded
when deciding whether a resource has changes or not. This is necessary
to keep the same behavior as the reference policy.

Bug: 430724
Signed-off-by: Cedric Brun <cedric.brun@obeo.fr
Introduce a ResourceMigrationMarker

This marker might be attached to a Resource to indicate that
some automatic migration *might* have change the structure
of the model during the loading (with no isModified flag)

This forces the IsModifiedSavingPolicy to consider this resource as
"logically modified".

This marker is automatically removed when the resource is processed
by the saving policy which checked that the serialization has no
difference with the current file content.

Bug: 430724
Signed-off-by: Cedric Brun <cedric.brun@obeo.fr
Activate IsModifiedSavingPolicy by default

Bug: 430724
Signed-off-by: Cedric Brun <cedric.brun@obeo.fr