Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-02-24 17:45:21 +0000
committerChristian W. Damus2015-03-25 12:43:24 +0000
commit076626232757a6cc017b64d4d9d9d3cbe31906a1 (patch)
tree4d6410896a66ad939b0fd3ab90705d1ec5a7772c /tests/junit
parent424a1bc00a5f57be8b3ea59165333fa0db45ba71 (diff)
downloadorg.eclipse.papyrus-076626232757a6cc017b64d4d9d9d3cbe31906a1.tar.gz
org.eclipse.papyrus-076626232757a6cc017b64d4d9d9d3cbe31906a1.tar.xz
org.eclipse.papyrus-076626232757a6cc017b64d4d9d9d3cbe31906a1.zip
Bug 433206: Papyrus shall enable local synchronization between graphical element and element in the model
https://bugs.eclipse.org/bugs/show_bug.cgi?id=433206 (1) Refactor the 'uml.diagram.synchronizeview' plug-in: * remove the UML dependency (supplied by a UML-specific default children strategy) * move into infra.gmfdiag component * rename for GMF-standard 'canonical' terminology * API types, extension points, etc. renamed for 'canonical' terminology * fix parsing of priorities and other problems in the extension-point loading * support listening to multiple dependent model elements for canonical refresh * add a notion of default semantic children strategies for edit-parts that don't have specific requirements but can rely on a generic implementation (2) Implement a canonical request wrapper to pass through the drop request to default drop edit policy provided by the diagram, by-passing the pluggable strategies to which the CustomizableDopEditPolicy delegates. (3) Implement a toggle action in the various diagram filter menus to toggle canonical synchronization. (4) Enable the canonical edit policy provider. This requires additional changes: * only activate the canonical edit policy when the style is applied and is enabled because otherwise GMF assumes that canonical mode is on and treats connections as canonical (GMF run-time only checks that the edit policy is installed and is active) * listen for changes to the canonical style to disable/enable the canonical edit policy on the fly (5) Fix undo/redo of canonical view creation and of canonical enablement. (6) Properties view support for model/view synchronization (canonical edit policy). (7) Adapt SysML test utility to account for possible inclusion of ToggleCanonicalModeCommand by GMF in drop commands. (8) Implement deferred loading of synch child strategies and XML enablement expressions. (9) Fix problems in handling of connections incoming and outgoing canonical top shapes. (10) Support for a CSS 'canonical' style attribute. (11) Initial simple canonical synchronization scenarios for JUnit test cases. (12) Integrate canonical edit policy tests into the build. (13) Test cases for toggling canonical on/off, with undo/redo. Test cases for adding elements to the semantic model, with undo/redo. Test cases for deleting elements from the semantic model (including by simple remove, which unlike destroy does not also deletes dependent views anyways), with undo/redo. (14) Add regression tests for creation/deletion of elements and views together per the usual diagram editing scenarios, in the context of canonical diagrams. (15) Fix problems in canonical creation (with undo and redo) of connection views for non-owned relationship elements. (16) Add tests for CSS control of canonical synchronization. Fix inability to override CSS canonical style to turn synchronization off on selected views. Bug 461629: [CSS] Diagram refresh undo/redo problems https://bugs.eclipse.org/bugs/show_bug.cgi?id=461629 Implement new DiagramHelper refresh APIs to fix a few problems: - encapsulate synchronous (forced) and asynchronous refresh in new API methods. Deprecate the old methods that required clients to follow several steps. Update various client call sites to use the new API instead of the deprecated API - add corresponding APIs for refresh of individual DiagramEditParts, with similar heuristic for dropping redundant refresh requests - re-implement asynchronous refresh to use a new TransactionalEditingDomain executor that runs tasks as pre-commit trigger commands, to capture any undo/redo information for model changes - implement a new transaction option in the Papyrus editing domain that prevents runExclusive calls creating read-only transactions nested within a write transaction, so that canonical changes ensuing from edit-part refresh during refresh tasks can be properly recorded (without unprotected writes nested in the read-only context) Bug 433206: Papyrus shall enable local synchronization between graphical element and element in the model https://bugs.eclipse.org/bugs/show_bug.cgi?id=433206 (17) Enable test cases unblocked by the fix for undo/redo problems in diagram refresh (being bug 461629). (18) Do not record the edit-part but the view in the SetCanonicalCommand to support undo/redo even if the diagram has been closed and re-opened in the mean-time. To refresh the CanonicalEditPolicy's activation state after execute/undo/redo, the command now searches on the fly for all edit-parts (in all open diagram editors) that present the view in question. (19) Implement a new 'semi-active' state in the PapyrusCanonicalEditPolicy that is its minimally active state. This allows the edit policy to react to semantic model changes to delete views for deleted model elements, where such views are ones that it had originally created by canonical refresh. This relies on new tracking of canonically- created views, which in turn relies on a new utility for digging through complex command tree structures to get the views that were created by them. Includes automated tests for non-transactional refresh creating canonical views, with undo and redo in the semantic model undoing and redoing creationg of the elements that had been canonically created, after the canonical edit policy was (non-transactionally) disabled. (20) Don't forget about views that were created canonically if the diagram happens to be closed and then re-opened. (21) Rework the CanonicalStateListener to support injection of refresh 'pokes' to trigger updates in other dependents, such as the Properties view, when change in canonical activation is detected for any reason. (22) New JUnit tests for: - undo of semantic model change that created a canonical view after canonical edit policy disabled by CSS and close/reopen of the diagram - canonical edit policy's book-keeping does not leak diagram views nor model elements (23) CanonicalStateListener should be auto-retained because it automatically installs itself, and it won't be uninstalled except when successfully released. (24) Fix layout (margins etc.) of Synchronization properties group. (25) Fix concurrent modification in iteration over diagram edit part tree. Rationalize state-transition logic in canonical edit policy. (26) Fix some problems in canonical composite structures (incomplete): - manage connections canonically on border items as well as top shapes - do not include connectors as semantic children of structured classifiers but only as connections/edges of their connected elements - do not create parts of Association type when dropping an Association onto a structured classifier - include notation context in children-strategy query to account for structures such as part-with-port in connectors to disambiguate repeated semantic elements - add canonical composite structure tests (one still failing) (27) Refactor the canonical children strategies extension point ID to make it more meaningful and less redundant. Shave some execution time off the execution of the canonical edit policy tests in the automated build environment where we don't need to see what is happening in the diagrams. This involves a refactoring of earlier infrastructure that detects the build server or local Maven/Tycho build environment. (28) Fix failure to create canonical connection views because source/target nodes that were created canonically don't yet have their edit-parts. The canonical creation of connections is now deferred using the transaction pre-commit executor, exposed as a new DiagramHelper::submit(...) API. Several JUnit tests need updating, both to correct erroneous assumptions on latent bugs now fixed, and also to add UI event-processing in undo/redo scenarios to account for deferred connection creation. Use a DeferredLayoutCommand to improve the layout of the contents added to shape compartments by canonical 'drop', which otherwise would all be stacked on top of one another. Add a new pluggable strategy for determination of the edit-part that should handle creation of views, for cases such as flows in activities where connections must be dropped into contents compartments, not onto either the source or target node shape. (29) Fix canonical presentation of activity flows on pins. Implement basics of canonical synchronization of state machine diagrams. (30) Communication diagram synchronization of messages between lifelines. Requires a new extension interface for pluggable view-children strategies, to complement the semantic-children strategies, because the views that need to be synchronized are labels of connected edges, not the edges themselves. The semantic-children strategy interface is refactored to align with the new visual-children strategy interface, and likewise the determination of existing semantic and visual children in the PapyrusCanonicalEditPolicy. This also removes redundant re-calculation on semantic node children in the second-phase processing of connections. (31) Fix exceptions in synchronization and layout of communication diagrams. Fix regression in canonical deletion of edges. (32) Fix spurious deactivation of canonical edit policy in edit-parts that had had canonical mode (refresh enablement) toggled during execution of some user command. Change-Id: I9c39f74638cb55455e2d8bc42b07e49501ec3ea7
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.di)4
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation66
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml9
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java46
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch2
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch2
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java2
-rw-r--r--tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/Activator.java42
-rw-r--r--tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java6
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.classpath (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.classpath)14
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.project (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.project)2
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.settings/org.eclipse.jdt.core.prefs (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.settings/org.eclipse.jdt.core.prefs)6
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.settings/org.eclipse.jdt.ui.prefs (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.settings/org.eclipse.jdt.ui.prefs)0
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/META-INF/MANIFEST.MF31
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/about.html (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/about.html)0
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/build.properties (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/build.properties)3
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram.css20
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.di (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.di)4
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.notation227
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.uml43
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.di (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.di)4
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.notation227
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.uml42
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.di (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.di)4
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.notation113
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.uml42
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.di2
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.notation272
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.uml54
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/compositediagram.css17
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/org.eclipse.papyrus.infra.gmfdiag.canonical.tests.launch43
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/plugin.properties (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/plugin.properties)5
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/pom.xml14
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AbstractCSSCanonicalTest.java183
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AbstractCanonicalTest.java708
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AllTests.java40
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/BasicCanonicalClassDiagramTest.java136
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalClassDiagramTest.java132
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalCompositeDiagramTest.java133
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalStateInClassDiagramTest.java233
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSExternalStylesheetInClassDiagramTest.java195
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CanonicalStateInClassDiagramTest.java193
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CanonicalViewDeletionInClassDiagramTest.java185
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/EditingInClassDiagramRegressionTest.java269
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/EditingInModelInClassDiagramTest.java387
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/internal/Activator.java (renamed from tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/src/org/eclipse/papyrus/uml/diagram/synchronizeview/test/Activator.java)16
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/commands/util/CommandTreeIteratorTest.java194
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/infra/gmfdiag/commands/tests/AllTests.java6
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java34
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java12
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java33
-rw-r--r--tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java91
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/META-INF/MANIFEST.MF3
-rw-r--r--tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java276
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/META-INF/MANIFEST.MF15
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.notation19
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.uml4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.notation19
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.uml4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.notation24
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.uml4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.notation24
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.uml4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.di2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.notation36
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.uml4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.di2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.notation39
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.uml4
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.di2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.notation9
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.uml2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.di2
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.notation9
-rw-r--r--tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.uml2
77 files changed, 4613 insertions, 450 deletions
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.di b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di
index 8634d4c00e0..bf9abab340f 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.di
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.di
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation
new file mode 100644
index 00000000000..50f74c0a930
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.notation
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <notation:Diagram xmi:id="_b2JjcMjxEeS9XIofcN-grg" type="PapyrusUMLClassDiagram" name="main" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_eDFVEMjxEeS9XIofcN-grg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_eDHKQMjxEeS9XIofcN-grg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_eDHKQcjxEeS9XIofcN-grg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_eDHKQsjxEeS9XIofcN-grg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_eDHxUMjxEeS9XIofcN-grg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_eDHxUcjxEeS9XIofcN-grg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_eDHxUsjxEeS9XIofcN-grg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_eDHxU8jxEeS9XIofcN-grg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eDHxVMjxEeS9XIofcN-grg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_eDHxVcjxEeS9XIofcN-grg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_eDHxVsjxEeS9XIofcN-grg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_eDHxV8jxEeS9XIofcN-grg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_eDHxWMjxEeS9XIofcN-grg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eDHxWcjxEeS9XIofcN-grg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_eDHxWsjxEeS9XIofcN-grg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_eDHxW8jxEeS9XIofcN-grg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_eDHxXMjxEeS9XIofcN-grg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_eDHxXcjxEeS9XIofcN-grg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eDHxXsjxEeS9XIofcN-grg"/>
+ </children>
+ <element xmi:type="uml:Class" href="css_leaktest.uml#_eC9ZQMjxEeS9XIofcN-grg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_eDFVEcjxEeS9XIofcN-grg" x="47" y="21"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_ggADcMjxEeS9XIofcN-grg" type="2006">
+ <children xmi:type="notation:DecorationNode" xmi:id="_ggAqgMjxEeS9XIofcN-grg" type="5023"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_ggAqgcjxEeS9XIofcN-grg" type="8508">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_ggAqgsjxEeS9XIofcN-grg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_ggBRkMjxEeS9XIofcN-grg" type="7015">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_ggBRkcjxEeS9XIofcN-grg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_ggBRksjxEeS9XIofcN-grg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_ggBRk8jxEeS9XIofcN-grg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ggBRlMjxEeS9XIofcN-grg"/>
+ </children>
+ <element xmi:type="uml:Enumeration" href="css_leaktest.uml#_gf9nMMjxEeS9XIofcN-grg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ggADccjxEeS9XIofcN-grg" x="252" y="17"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_i5ZjwMjxEeS9XIofcN-grg" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_i5aK0MjxEeS9XIofcN-grg" type="5026"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_i5aK0cjxEeS9XIofcN-grg" type="7016">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_yadd4MjxEeS9XIofcN-grg" source="PapyrusCSSForceValue">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_yadd4cjxEeS9XIofcN-grg" key="mutable" value="true"/>
+ </eAnnotations>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_i5aK0sjxEeS9XIofcN-grg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_i5aK08jxEeS9XIofcN-grg"/>
+ </children>
+ <element xmi:type="uml:Package" href="css_leaktest.uml#_i5XukMjxEeS9XIofcN-grg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_i5ZjwcjxEeS9XIofcN-grg" x="29" y="159" width="385" height="300"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_b2JjccjxEeS9XIofcN-grg" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_b2JjcsjxEeS9XIofcN-grg"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_b2Jjc8jxEeS9XIofcN-grg">
+ <owner xmi:type="uml:Model" href="css_leaktest.uml#_b0QGAMjxEeS9XIofcN-grg"/>
+ </styles>
+ <styles xmi:type="notation:EObjectListValueStyle" xmi:id="_yY3icMjxEeS9XIofcN-grg" name="css_stylesheets" eObjectListValue="_yY4wkMjxEeS9XIofcN-grg"/>
+ <element xmi:type="uml:Model" href="css_leaktest.uml#_b0QGAMjxEeS9XIofcN-grg"/>
+ </notation:Diagram>
+ <css:ModelStyleSheets xmi:id="_tfPhEMjxEeS9XIofcN-grg"/>
+ <css:EmbeddedStyleSheet xmi:id="_yY4wkMjxEeS9XIofcN-grg" label="canonical" content="Class, Enumeration, Package {&#xA; canonical: true&#xA;}"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml
new file mode 100644
index 00000000000..c4c95eda8ff
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/model/canonical/css_leaktest.uml
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_b0QGAMjxEeS9XIofcN-grg" name="Model">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_b0QtEMjxEeS9XIofcN-grg">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_eC9ZQMjxEeS9XIofcN-grg" name="Class1"/>
+ <packagedElement xmi:type="uml:Enumeration" xmi:id="_gf9nMMjxEeS9XIofcN-grg" name="Enumeration1"/>
+ <packagedElement xmi:type="uml:Package" xmi:id="_i5XukMjxEeS9XIofcN-grg" name="Package1"/>
+</uml:Model>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java
index 2df2fe2a585..f3a04ec9349 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.editor.integration.tests/src/org/eclipse/papyrus/editor/integration/tests/tests/EditingScenariosMemoryLeakTest.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 CEA and others.
+ * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* Christian W. Damus (CEA) - Initial API and implementation
+ * Christian W. Damus - bug 433206
*
*/
package org.eclipse.papyrus.editor.integration.tests.tests;
@@ -16,6 +17,7 @@ import static org.hamcrest.CoreMatchers.instanceOf;
import static org.hamcrest.CoreMatchers.notNullValue;
import static org.hamcrest.MatcherAssert.assertThat;
+import org.eclipse.emf.transaction.RecordingCommand;
import org.eclipse.gef.commands.Command;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequest;
import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewRequestFactory;
@@ -29,11 +31,16 @@ import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule;
import org.eclipse.papyrus.junit.framework.classification.rules.MemoryLeakRule.SoftReferenceSensitive;
import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
import org.eclipse.papyrus.junit.utils.rules.PluginResource;
import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
import org.eclipse.papyrus.uml.nattable.menu.util.TableMenuUtils;
import org.eclipse.ui.IEditorPart;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.Package;
+import org.eclipse.uml2.uml.UMLPackage;
import org.junit.Rule;
import org.junit.Test;
@@ -83,7 +90,7 @@ public class EditingScenariosMemoryLeakTest extends AbstractPapyrusTest {
IEditorPart tableEditor = fixture.getActiveEditor();
assertThat("Not a table editor", tableEditor, instanceOf(NatTableEditor.class));
- INattableModelManager manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class);
+ INattableModelManager manager = (INattableModelManager) tableEditor.getAdapter(INattableModelManager.class);
assertThat(manager, notNullValue());
IAxisManager axisManager = manager.getRowAxisManager();
final int originalAxisSize = axisManager.getAllManagedAxis().size();
@@ -107,6 +114,41 @@ public class EditingScenariosMemoryLeakTest extends AbstractPapyrusTest {
}
}
+ /**
+ * Verify that diagrams having active canonical edit policies do not cause leaks.
+ */
+ @Test
+ @SoftReferenceSensitive
+ @PluginResource("model/canonical/css_leaktest.di")
+ @ActiveDiagram("main")
+ public void testCanonicalEditPolicy_bug433206() {
+ memory.add(editor.getModel());
+ memory.add(editor.getActiveDiagramEditor().getDiagram());
+
+ // Cause some views to be created canonically
+ editor.getEditingDomain().getCommandStack().execute(new RecordingCommand(editor.getEditingDomain()) {
+
+ @Override
+ protected void doExecute() {
+ final Package model = editor.getModel();
+
+ final Class class1 = (Class) model.getOwnedType("Class1");
+ class1.createOwnedAttribute("name", null);
+ class1.createOwnedOperation("doIt", null, null);
+ class1.createNestedClassifier("nested", UMLPackage.Literals.PRIMITIVE_TYPE);
+
+ final Enumeration enum1 = (Enumeration) model.getOwnedType("Enumeration1");
+ enum1.createOwnedLiteral("one");
+ enum1.createOwnedLiteral("two");
+
+ final Package package1 = model.getNestedPackage("Package1");
+ package1.createOwnedClass("Foo", false);
+ }
+ });
+ editor.flushDisplayEvents();
+
+ }
+
//
// Test framework
//
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
index 33a2b8542af..bdf2190c572 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/META-INF/MANIFEST.MF
@@ -70,7 +70,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.papyrus.infra.gmfdiag.menu.tests;bundle-version="1.1.0",
org.eclipse.papyrus.infra.nattable.model.tests;bundle-version="1.1.0",
org.eclipse.papyrus.tests.diagramassistants;bundle-version="1.1.0",
- org.eclipse.papyrus.uml.profile.drafter;bundle-version="1.1.0"
+ org.eclipse.papyrus.uml.profile.drafter;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.gmfdiag.canonical.tests;bundle-version="1.1.0"
Bundle-Vendor: %providerName
Bundle-ActivationPolicy: lazy
Bundle-Version: 1.1.0.qualifier
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch
index 570644a76cd..0329d1777df 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus ALL tests.launch
@@ -31,7 +31,7 @@
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.6 -Xms512m -Xmx1024m -DsuppressRawWhenUnchecked=true -XX:MaxPermSize=512M&#10;-XX:SoftRefLRUPolicyMSPerMB=100"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.6 -Xms512m -Xmx1024m -DsuppressRawWhenUnchecked=true -XX:MaxPermSize=512M&#10;-XX:SoftRefLRUPolicyMSPerMB=100&#10;-Doomph.setup.skip=true&#10;-Doomph.setup.questionnaire.skip=true"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch
index 55b6fbd8413..72c6f0010fe 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/Papyrus Core tests (no SysML).launch
@@ -31,7 +31,7 @@
<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.tests"/>
<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
-<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.6 -Xms512m -Xmx768m -DsuppressRawWhenUnchecked=true -XX:MaxPermSize=512M&#10;-Dno.SysML.tests&#10;-XX:SoftRefLRUPolicyMSPerMB=100"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.6 -Xms512m -Xmx768m -DsuppressRawWhenUnchecked=true -XX:MaxPermSize=512M&#10;-Dno.SysML.tests&#10;-XX:SoftRefLRUPolicyMSPerMB=100&#10;-Doomph.setup.skip=true&#10;-Doomph.setup.questionnaire.skip=true"/>
<stringAttribute key="pde.version" value="3.3"/>
<stringAttribute key="product" value="org.eclipse.platform.ide"/>
<booleanAttribute key="run_in_ui_thread" value="true"/>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
index a076a6e9642..92fad633060 100644
--- a/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.tests/test/org/eclipse/papyrus/tests/AllTests.java
@@ -11,6 +11,7 @@
* Christian W. Damus (CEA) - bugs 402525, 323802, 431953, 433310, 434993
* Christian W. Damus - bug 399859
* Christian W. Damus - bug 451230
+ * Christian W. Damus - bug 433206
*
*****************************************************************************/
package org.eclipse.papyrus.tests;
@@ -58,6 +59,7 @@ public class AllTests {
// suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.services.openelement.tests.AllTests.class));
suiteClasses.add(new FragmentTestSuiteClass(org.eclipse.papyrus.commands.Activator.PLUGIN_ID, "org.eclipse.papyrus.infra.gmfdiag.commands.tests.AllTests"));
suiteClasses.add(new FragmentTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.common.Activator.ID, "org.eclipse.papyrus.infra.gmfdiag.common.tests.AllTests"));
+ suiteClasses.add(new PluginTestSuiteClass(org.eclipse.papyrus.infra.gmfdiag.canonical.tests.AllTests.class));
suiteClasses.add(new FragmentTestSuiteClass(org.eclipse.papyrus.infra.emf.readonly.Activator.PLUGIN_ID, "org.eclipse.papyrus.infra.emf.readonly.tests.AllTests"));
/* views */
diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/META-INF/MANIFEST.MF
index ee79e41565c..4c6dfdc1eb9 100644
--- a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/META-INF/MANIFEST.MF
@@ -7,7 +7,8 @@ Require-Bundle: org.eclipse.ui,
org.eclipse.pde.core,
org.eclipse.update.configurator,
org.junit;bundle-version="4.10.0",
- org.eclipse.papyrus.junit.framework;bundle-version="1.1.0"
+ org.eclipse.papyrus.junit.framework;bundle-version="1.1.0",
+ org.eclipse.papyrus.junit.utils;bundle-version="1.1.0"
Export-Package: org.eclipse.papyrus.bundles.tests
Bundle-Vendor: %Bundle-Vendor
Bundle-ActivationPolicy: lazy
diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/Activator.java b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/Activator.java
index d3d6ff03baa..ca011465622 100644
--- a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/Activator.java
+++ b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/Activator.java
@@ -1,21 +1,7 @@
-/*
- * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others.
- *
- * 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
- * http://www.eclipse.org/legal/epl-v10.html
- *
- * Contributors:
- * CEA LIST - Initial API and implementation
- * Christian W. Damus - Skip the feature-version test when not running in the Tycho build
- */
package org.eclipse.papyrus.bundles.tests;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
-import org.osgi.framework.ServiceReference;
-import org.osgi.service.application.ApplicationHandle;
/**
* The activator class controls the plug-in life cycle
@@ -28,33 +14,28 @@ public class Activator extends AbstractUIPlugin {
// The shared instance
private static Activator plugin;
- private String runningApplicationID;
-
/**
* The constructor
*/
public Activator() {
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
-
- // Get the running application ID
- ServiceReference<ApplicationHandle> appRef = context.getServiceReference(ApplicationHandle.class);
- if (appRef != null) {
- ApplicationHandle appHandle = context.getService(appRef);
- if (appHandle != null) {
- try {
- runningApplicationID = appHandle.getApplicationDescriptor().getApplicationId();
- } finally {
- context.ungetService(appRef);
- }
- }
- }
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
@@ -70,7 +51,4 @@ public class Activator extends AbstractUIPlugin {
return plugin;
}
- public String getRunningApplicationID() {
- return (runningApplicationID == null) ? "" : runningApplicationID; //$NON-NLS-1$
- }
}
diff --git a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
index 5f105e17b5e..30f4828cc44 100644
--- a/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
+++ b/tests/junit/plugins/developer/org.eclipse.papyrus.bundles.tests/src/org/eclipse/papyrus/bundles/tests/BundlesTests.java
@@ -10,6 +10,7 @@
* Contributors:
* Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
* Christian W. Damus - Skip the feature-version test when running in development mode
+ * Christian W. Damus - bug 433206
*
*****************************************************************************/
package org.eclipse.papyrus.bundles.tests;
@@ -28,6 +29,7 @@ import org.eclipse.papyrus.junit.framework.classification.NotImplemented;
import org.eclipse.papyrus.junit.framework.classification.rules.Condition;
import org.eclipse.papyrus.junit.framework.classification.rules.Conditional;
import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.junit.utils.JUnitUtils;
import org.eclipse.pde.internal.core.feature.Feature;
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
@@ -62,10 +64,10 @@ public class BundlesTests extends AbstractPapyrusTest {
private static final String PAPYRUS_VERSION = BundleTestsUtils.PAPYRUS_VERSION;
@Condition
- public final boolean isTychoExecution = Activator.getDefault().getRunningApplicationID().startsWith("org.eclipse.tycho."); //$NON-NLS-1$
+ public final boolean isAutomatedBuild = JUnitUtils.isAutomatedBuildExecution();
@Test
- @Conditional(key = "isTychoExecution")
+ @Conditional(key = "isAutomatedBuild")
public void featureVersionNumberTest() {
StringBuffer message = new StringBuffer("Wrong version number for the features:"); //$NON-NLS-1$
int nbProblem = 0;
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.classpath b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.classpath
index 8a8f1668cdc..098194ca4b7 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.classpath
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.classpath
@@ -1,7 +1,7 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
- <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
- <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
- <classpathentry kind="src" path="src"/>
- <classpathentry kind="output" path="bin"/>
-</classpath>
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.project b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.project
index fac87127354..718e1d52780 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.project
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.project
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
- <name>org.eclipse.papyrus.uml.diagram.synchronizeview.test</name>
+ <name>org.eclipse.papyrus.infra.gmfdiag.canonical.tests</name>
<comment></comment>
<projects>
</projects>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.settings/org.eclipse.jdt.core.prefs
index 410244d65a6..9ca8e68231b 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.settings/org.eclipse.jdt.core.prefs
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.settings/org.eclipse.jdt.core.prefs
@@ -1,10 +1,10 @@
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
-org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
-org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
+org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
-org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.compiler.source=1.7
org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.settings/org.eclipse.jdt.ui.prefs b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.settings/org.eclipse.jdt.ui.prefs
index 954281dbc31..954281dbc31 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/.settings/org.eclipse.jdt.ui.prefs
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/.settings/org.eclipse.jdt.ui.prefs
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..ddd399e9ba2
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,31 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.junit.framework;bundle-version="1.1.0",
+ org.eclipse.papyrus.junit.utils;bundle-version="1.1.0",
+ org.junit;bundle-version="4.11.0",
+ org.eclipse.papyrus.infra.gmfdiag.canonical;bundle-version="1.1.0",
+ org.eclipse.gmf.runtime.diagram.ui;bundle-version="1.8.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.1.0",
+ org.eclipse.uml2.uml;bundle-version="5.1.0",
+ org.eclipse.papyrus.uml.diagram.clazz;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.1.0",
+ com.google.guava;bundle-version="11.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.properties;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.gmfdiag.css;bundle-version="1.1.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.model;bundle-version="1.1.0"
+Bundle-Vendor: %providerName
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.1.0.qualifier
+Bundle-Name: %pluginName
+Bundle-Localization: plugin
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.canonical.tests.internal.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.canonical.tests
+Bundle-RequiredExecutionEnvironment: JavaSE-1.7
+Export-Package: org.eclipse.papyrus.infra.gmfdiag.canonical.tests,
+ org.eclipse.papyrus.infra.gmfdiag.canonical.tests.internal;x-internal:=true
+
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/about.html b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/about.html
index 82d49bf5f81..82d49bf5f81 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/about.html
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/about.html
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/build.properties b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/build.properties
index 1b08f841b5e..54e8f43992d 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/build.properties
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/build.properties
@@ -3,5 +3,6 @@ output.. = bin/
bin.includes = META-INF/,\
.,\
about.html,\
- plugin.properties
+ plugin.properties,\
+ models/
src.includes = about.html
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram.css b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram.css
new file mode 100644
index 00000000000..4fb4cab7e1d
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram.css
@@ -0,0 +1,20 @@
+/*
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ */
+
+Class {
+ canonical: true
+}
+
+.synch {
+ canonical: true
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.di b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.di
index 8634d4c00e0..bf9abab340f 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.di
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.di
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.notation b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.notation
new file mode 100644
index 00000000000..c84e2b0d83f
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.notation
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <notation:Diagram xmi:id="_ZuWIwMK3EeSkv8vaizVybg" type="PapyrusUMLClassDiagram" name="canonical" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_dZ-tAMK3EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_daBJQMK3EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_daBJQcK3EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_daBJQsK3EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_daGo0MK3EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_daGo0cK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_daGo0sK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_daGo08K3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_daGo1MK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_daGo1cK3EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_daGo1sK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_daGo18K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_daGo2MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_daGo2cK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_daGo2sK3EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_daGo28K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_daGo3MK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_daGo3cK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_daGo3sK3EeSkv8vaizVybg"/>
+ </children>
+ <styles xmi:type="notation:CanonicalStyle" xmi:id="_dnnq8MK4EeSkv8vaizVybg"/>
+ <element xmi:type="uml:Class" href="classdiagram_canonical.uml#_dZNQ8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dZ-tAcK3EeSkv8vaizVybg" x="85" y="62" width="120" height="122"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_iBjVEMK3EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_iBjVEsK3EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_iBjVE8K3EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_iBjVFMK3EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_iBjVFcK3EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_iBjVFsK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_iBjVF8K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_iBjVGMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iBjVGcK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_iBjVGsK3EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_iBjVG8K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_iBjVHMK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_iBjVHcK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iBjVHsK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_iBjVH8K3EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_iBjVIMK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_iBjVIcK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_iBjVIsK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iBjVI8K3EeSkv8vaizVybg"/>
+ </children>
+ <styles xmi:type="notation:CanonicalStyle" xmi:id="_fPeZkMK4EeSkv8vaizVybg"/>
+ <element xmi:type="uml:Class" href="classdiagram_canonical.uml#_iBhf4MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iBjVEcK3EeSkv8vaizVybg" x="307" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_jhyYwMK3EeSkv8vaizVybg" type="2006">
+ <children xmi:type="notation:DecorationNode" xmi:id="_jhy_0MK3EeSkv8vaizVybg" type="5023"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_jhy_0cK3EeSkv8vaizVybg" type="8508">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_jhy_0sK3EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_jhy_08K3EeSkv8vaizVybg" type="7015">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_jhy_1MK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_jhy_1cK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_jhy_1sK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jhy_18K3EeSkv8vaizVybg"/>
+ </children>
+ <styles xmi:type="notation:CanonicalStyle" xmi:id="_ffa6EMK4EeSkv8vaizVybg"/>
+ <element xmi:type="uml:Enumeration" href="classdiagram_canonical.uml#_jhxKoMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jhyYwcK3EeSkv8vaizVybg" x="697" y="73"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_l5srUMK3EeSkv8vaizVybg" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_l5srUsK3EeSkv8vaizVybg" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_l5srU8K3EeSkv8vaizVybg" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_l5srVMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_l5srVcK3EeSkv8vaizVybg"/>
+ </children>
+ <styles xmi:type="notation:CanonicalStyle" xmi:id="_ftnHEMK4EeSkv8vaizVybg"/>
+ <element xmi:type="uml:Package" href="classdiagram_canonical.uml#_l5pA8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_l5srUcK3EeSkv8vaizVybg" x="93" y="254" width="462" height="337"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_pmuWsMK3EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_pmu9wMK3EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_pmu9wcK3EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_pmu9wsK3EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pmu9w8K3EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pmu9xMK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pmu9xcK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pmu9xsK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pmu9x8K3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pmu9yMK3EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pmu9ycK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pmu9ysK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pmu9y8K3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pmu9zMK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pmu9zcK3EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pmu9zsK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pmu9z8K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pmu90MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pmu90cK3EeSkv8vaizVybg"/>
+ </children>
+ <styles xmi:type="notation:CanonicalStyle" xmi:id="_f7qKIMK4EeSkv8vaizVybg"/>
+ <element xmi:type="uml:Class" href="classdiagram_canonical.uml#_pmtIkMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pmuWscK3EeSkv8vaizVybg" x="498" y="66"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_ZuWIwcK3EeSkv8vaizVybg" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_ZuWIwsK3EeSkv8vaizVybg"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_ZuWIw8K3EeSkv8vaizVybg">
+ <owner xmi:type="uml:Model" href="classdiagram_canonical.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </styles>
+ <element xmi:type="uml:Model" href="classdiagram_canonical.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </notation:Diagram>
+ <css:ModelStyleSheets xmi:id="__5nfEMK5EeSkv8vaizVybg"/>
+ <notation:Diagram xmi:id="_IYESEMK6EeSkv8vaizVybg" type="PapyrusUMLClassDiagram" name="default" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_LcByUMK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_LcCZYMK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_LcCZYcK6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_LcCZYsK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZY8K6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZZMK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZZcK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZZsK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZZ8K6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZaMK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZacK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZasK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZa8K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZbMK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZbcK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZbsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZb8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZcMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZccK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_canonical.uml#_dZNQ8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcByUcK6EeSkv8vaizVybg" x="81" y="59" width="124" height="115"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_L0lcQMK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_L0lcQsK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_L0lcQ8K6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_L0lcRMK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDUMK6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDUcK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDUsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDU8K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDVMK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDVcK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDVsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDV8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDWMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDWcK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDWsK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDW8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDXMK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDXcK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDXsK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_canonical.uml#_iBhf4MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0lcQcK6EeSkv8vaizVybg" x="318" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_MV710MK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_MV8c4MK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_MV8c4cK6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_MV8c4sK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c48K6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c5MK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c5cK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c5sK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c58K6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c6MK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c6cK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c6sK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c68K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c7MK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c7cK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c7sK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c78K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c8MK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c8cK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_canonical.uml#_pmtIkMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV710cK6EeSkv8vaizVybg" x="522" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_N_ueIMK6EeSkv8vaizVybg" type="2006">
+ <children xmi:type="notation:DecorationNode" xmi:id="_N_ueIsK6EeSkv8vaizVybg" type="5023"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_N_ueI8K6EeSkv8vaizVybg" type="8508">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_N_ueJMK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_N_ueJcK6EeSkv8vaizVybg" type="7015">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_N_ueJsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_N_ueJ8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_N_ueKMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_N_ueKcK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Enumeration" href="classdiagram_canonical.uml#_jhxKoMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_N_ueIcK6EeSkv8vaizVybg" x="697" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_Oao4gMK6EeSkv8vaizVybg" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_Oao4gsK6EeSkv8vaizVybg" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_OapfkMK6EeSkv8vaizVybg" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_OapfkcK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OapfksK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Package" href="classdiagram_canonical.uml#_l5pA8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Oao4gcK6EeSkv8vaizVybg" x="97" y="245" width="557" height="323"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_IYESEcK6EeSkv8vaizVybg" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_IYESEsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_IYESE8K6EeSkv8vaizVybg">
+ <owner xmi:type="uml:Model" href="classdiagram_canonical.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </styles>
+ <element xmi:type="uml:Model" href="classdiagram_canonical.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.uml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.uml
new file mode 100644
index 00000000000..cacc06880af
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_canonical.uml
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_ZtEWYMK3EeSkv8vaizVybg" name="Model">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_ZtEWYcK3EeSkv8vaizVybg">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_dZNQ8MK3EeSkv8vaizVybg" name="Foo">
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_XFcBQMLBEeSkv8vaizVybg" name="ok">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_qkfmgMK3EeSkv8vaizVybg" name="bar" type="_iBhf4MK3EeSkv8vaizVybg" association="_qkgNkMK3EeSkv8vaizVybg">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qkfmgcK3EeSkv8vaizVybg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_qkfmgsK3EeSkv8vaizVybg" value="1"/>
+ </ownedAttribute>
+ <ownedOperation xmi:type="uml:Operation" xmi:id="_68S0AMK6EeSkv8vaizVybg" name="doIt"/>
+ <nestedClassifier xmi:type="uml:Class" xmi:id="_88g_UMK6EeSkv8vaizVybg" name="Nested"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_iBhf4MK3EeSkv8vaizVybg" name="Bar">
+ <generalization xmi:type="uml:Generalization" xmi:id="_rYz_YMK3EeSkv8vaizVybg" general="_pmtIkMK3EeSkv8vaizVybg"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Enumeration" xmi:id="_jhxKoMK3EeSkv8vaizVybg" name="YesNo">
+ <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_wXsUMMK3EeSkv8vaizVybg" name="no"/>
+ <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_vemJAMK3EeSkv8vaizVybg" name="yes"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_l5pA8MK3EeSkv8vaizVybg" name="types">
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_sShOkMK3EeSkv8vaizVybg" alias="Foo" importedElement="_dZNQ8MK3EeSkv8vaizVybg"/>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_s2kW0MK3EeSkv8vaizVybg" alias="Bar" importedElement="_iBhf4MK3EeSkv8vaizVybg"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_AINmoMK4EeSkv8vaizVybg" name="SubFoo">
+ <generalization xmi:type="uml:Generalization" xmi:id="_BxHeIMK4EeSkv8vaizVybg" general="_dZNQ8MK3EeSkv8vaizVybg"/>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_MnwQgMK4EeSkv8vaizVybg" name="createdOn" type="_KR5MYMK4EeSkv8vaizVybg"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:DataType" xmi:id="_KR5MYMK4EeSkv8vaizVybg" name="Date"/>
+ <packagedElement xmi:type="uml:Dependency" xmi:id="_mS1QMNCxEeSgLrtEqH-xrA" client="_AINmoMK4EeSkv8vaizVybg" supplier="_KR5MYMK4EeSkv8vaizVybg"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_pmtIkMK3EeSkv8vaizVybg" name="Super"/>
+ <packagedElement xmi:type="uml:Association" xmi:id="_qkgNkMK3EeSkv8vaizVybg" memberEnd="_qkgNkcK3EeSkv8vaizVybg _qkfmgMK3EeSkv8vaizVybg">
+ <name xsi:nil="true"/>
+ <ownedEnd xmi:type="uml:Property" xmi:id="_qkgNkcK3EeSkv8vaizVybg" name="foo" type="_dZNQ8MK3EeSkv8vaizVybg" association="_qkgNkMK3EeSkv8vaizVybg">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qkgNksK3EeSkv8vaizVybg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_qkgNk8K3EeSkv8vaizVybg" value="1"/>
+ </ownedEnd>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Usage" xmi:id="_Y9sG4MLCEeSkv8vaizVybg" client="_pmtIkMK3EeSkv8vaizVybg" supplier="_jhxKoMK3EeSkv8vaizVybg"/>
+</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.di b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.di
index 8634d4c00e0..bf9abab340f 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.di
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.di
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.notation b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.notation
new file mode 100644
index 00000000000..6c5db1466d9
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.notation
@@ -0,0 +1,227 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <notation:Diagram xmi:id="_ZuWIwMK3EeSkv8vaizVybg" type="PapyrusUMLClassDiagram" name="canonical" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_dZ-tAMK3EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_daBJQMK3EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_daBJQcK3EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_daBJQsK3EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_daGo0MK3EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_daGo0cK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_daGo0sK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_daGo08K3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_daGo1MK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_daGo1cK3EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_daGo1sK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_daGo18K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_daGo2MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_daGo2cK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_daGo2sK3EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_daGo28K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_daGo3MK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_daGo3cK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_daGo3sK3EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_css.uml#_dZNQ8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dZ-tAcK3EeSkv8vaizVybg" x="85" y="62" width="120" height="122"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_iBjVEMK3EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_iBjVEsK3EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_iBjVE8K3EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_iBjVFMK3EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_iBjVFcK3EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_iBjVFsK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_iBjVF8K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_iBjVGMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iBjVGcK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_iBjVGsK3EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_iBjVG8K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_iBjVHMK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_iBjVHcK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iBjVHsK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_iBjVH8K3EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_iBjVIMK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_iBjVIcK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_iBjVIsK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iBjVI8K3EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_css.uml#_iBhf4MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_iBjVEcK3EeSkv8vaizVybg" x="307" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_jhyYwMK3EeSkv8vaizVybg" type="2006">
+ <children xmi:type="notation:DecorationNode" xmi:id="_jhy_0MK3EeSkv8vaizVybg" type="5023"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_jhy_0cK3EeSkv8vaizVybg" type="8508">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_jhy_0sK3EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_jhy_08K3EeSkv8vaizVybg" type="7015">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_jhy_1MK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_jhy_1cK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_jhy_1sK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jhy_18K3EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Enumeration" href="classdiagram_css.uml#_jhxKoMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jhyYwcK3EeSkv8vaizVybg" x="697" y="73"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_l5srUMK3EeSkv8vaizVybg" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_l5srUsK3EeSkv8vaizVybg" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_l5srU8K3EeSkv8vaizVybg" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_l5srVMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_l5srVcK3EeSkv8vaizVybg"/>
+ </children>
+ <styles xmi:type="notation:StringListValueStyle" xmi:id="_Tal6kMOaEeSrRZNlIXoDgg" name="cssClass">
+ <stringListValue>synch</stringListValue>
+ </styles>
+ <element xmi:type="uml:Package" href="classdiagram_css.uml#_l5pA8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_l5srUcK3EeSkv8vaizVybg" x="93" y="254" width="462" height="337"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_pmuWsMK3EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_pmu9wMK3EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_pmu9wcK3EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_pmu9wsK3EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pmu9w8K3EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pmu9xMK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pmu9xcK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pmu9xsK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pmu9x8K3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pmu9yMK3EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pmu9ycK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pmu9ysK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pmu9y8K3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pmu9zMK3EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pmu9zcK3EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pmu9zsK3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pmu9z8K3EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pmu90MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pmu90cK3EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_css.uml#_pmtIkMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pmuWscK3EeSkv8vaizVybg" x="498" y="66"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_ZuWIwcK3EeSkv8vaizVybg" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_ZuWIwsK3EeSkv8vaizVybg"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_ZuWIw8K3EeSkv8vaizVybg">
+ <owner xmi:type="uml:Model" href="classdiagram_css.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </styles>
+ <styles xmi:type="notation:EObjectListValueStyle" xmi:id="_Gov_wMOaEeSrRZNlIXoDgg" name="css_stylesheets" eObjectListValue="_GozDEMOaEeSrRZNlIXoDgg"/>
+ <element xmi:type="uml:Model" href="classdiagram_css.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </notation:Diagram>
+ <css:ModelStyleSheets xmi:id="__5nfEMK5EeSkv8vaizVybg"/>
+ <notation:Diagram xmi:id="_IYESEMK6EeSkv8vaizVybg" type="PapyrusUMLClassDiagram" name="default" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_LcByUMK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_LcCZYMK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_LcCZYcK6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_LcCZYsK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZY8K6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZZMK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZZcK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZZsK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZZ8K6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZaMK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZacK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZasK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZa8K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZbMK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZbcK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZbsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZb8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZcMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZccK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_css.uml#_dZNQ8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcByUcK6EeSkv8vaizVybg" x="81" y="59" width="124" height="115"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_L0lcQMK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_L0lcQsK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_L0lcQ8K6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_L0lcRMK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDUMK6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDUcK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDUsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDU8K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDVMK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDVcK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDVsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDV8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDWMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDWcK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDWsK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDW8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDXMK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDXcK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDXsK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_css.uml#_iBhf4MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0lcQcK6EeSkv8vaizVybg" x="318" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_MV710MK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_MV8c4MK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_MV8c4cK6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_MV8c4sK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c48K6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c5MK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c5cK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c5sK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c58K6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c6MK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c6cK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c6sK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c68K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c7MK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c7cK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c7sK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c78K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c8MK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c8cK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_css.uml#_pmtIkMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV710cK6EeSkv8vaizVybg" x="522" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_N_ueIMK6EeSkv8vaizVybg" type="2006">
+ <children xmi:type="notation:DecorationNode" xmi:id="_N_ueIsK6EeSkv8vaizVybg" type="5023"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_N_ueI8K6EeSkv8vaizVybg" type="8508">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_N_ueJMK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_N_ueJcK6EeSkv8vaizVybg" type="7015">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_N_ueJsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_N_ueJ8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_N_ueKMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_N_ueKcK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Enumeration" href="classdiagram_css.uml#_jhxKoMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_N_ueIcK6EeSkv8vaizVybg" x="697" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_Oao4gMK6EeSkv8vaizVybg" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_Oao4gsK6EeSkv8vaizVybg" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_OapfkMK6EeSkv8vaizVybg" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_OapfkcK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OapfksK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Package" href="classdiagram_css.uml#_l5pA8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Oao4gcK6EeSkv8vaizVybg" x="97" y="245" width="557" height="323"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_IYESEcK6EeSkv8vaizVybg" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_IYESEsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_IYESE8K6EeSkv8vaizVybg">
+ <owner xmi:type="uml:Model" href="classdiagram_css.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </styles>
+ <element xmi:type="uml:Model" href="classdiagram_css.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </notation:Diagram>
+ <css:EmbeddedStyleSheet xmi:id="_GozDEMOaEeSrRZNlIXoDgg" label="canonical_styles" content="Class, Enumeration {&#xA;&#x9;canonical: true&#xA;}&#xA;&#xA;.synch {&#xA;&#x9;canonical: true&#xA;}"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.uml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.uml
new file mode 100644
index 00000000000..c8bcc3b8a52
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_css.uml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_ZtEWYMK3EeSkv8vaizVybg" name="Model">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_ZtEWYcK3EeSkv8vaizVybg">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_dZNQ8MK3EeSkv8vaizVybg" name="Foo">
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_XFcBQMLBEeSkv8vaizVybg" name="ok">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_qkfmgMK3EeSkv8vaizVybg" name="bar" type="_iBhf4MK3EeSkv8vaizVybg" association="_qkgNkMK3EeSkv8vaizVybg">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qkfmgcK3EeSkv8vaizVybg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_qkfmgsK3EeSkv8vaizVybg" value="1"/>
+ </ownedAttribute>
+ <ownedOperation xmi:type="uml:Operation" xmi:id="_68S0AMK6EeSkv8vaizVybg" name="doIt"/>
+ <nestedClassifier xmi:type="uml:Class" xmi:id="_88g_UMK6EeSkv8vaizVybg" name="Nested"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_iBhf4MK3EeSkv8vaizVybg" name="Bar">
+ <generalization xmi:type="uml:Generalization" xmi:id="_rYz_YMK3EeSkv8vaizVybg" general="_pmtIkMK3EeSkv8vaizVybg"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Enumeration" xmi:id="_jhxKoMK3EeSkv8vaizVybg" name="YesNo">
+ <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_wXsUMMK3EeSkv8vaizVybg" name="no"/>
+ <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_vemJAMK3EeSkv8vaizVybg" name="yes"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_l5pA8MK3EeSkv8vaizVybg" name="types">
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_sShOkMK3EeSkv8vaizVybg" alias="Foo" importedElement="_dZNQ8MK3EeSkv8vaizVybg"/>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_s2kW0MK3EeSkv8vaizVybg" alias="Bar" importedElement="_iBhf4MK3EeSkv8vaizVybg"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_AINmoMK4EeSkv8vaizVybg" name="SubFoo">
+ <generalization xmi:type="uml:Generalization" xmi:id="_BxHeIMK4EeSkv8vaizVybg" general="_dZNQ8MK3EeSkv8vaizVybg"/>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_MnwQgMK4EeSkv8vaizVybg" name="createdOn" type="_KR5MYMK4EeSkv8vaizVybg"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:DataType" xmi:id="_KR5MYMK4EeSkv8vaizVybg" name="Date"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_pmtIkMK3EeSkv8vaizVybg" name="Super"/>
+ <packagedElement xmi:type="uml:Association" xmi:id="_qkgNkMK3EeSkv8vaizVybg" memberEnd="_qkgNkcK3EeSkv8vaizVybg _qkfmgMK3EeSkv8vaizVybg">
+ <name xsi:nil="true"/>
+ <ownedEnd xmi:type="uml:Property" xmi:id="_qkgNkcK3EeSkv8vaizVybg" name="foo" type="_dZNQ8MK3EeSkv8vaizVybg" association="_qkgNkMK3EeSkv8vaizVybg">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qkgNksK3EeSkv8vaizVybg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_qkgNk8K3EeSkv8vaizVybg" value="1"/>
+ </ownedEnd>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Usage" xmi:id="_Y9sG4MLCEeSkv8vaizVybg" client="_pmtIkMK3EeSkv8vaizVybg" supplier="_jhxKoMK3EeSkv8vaizVybg"/>
+</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.di b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.di
index 8634d4c00e0..bf9abab340f 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.di
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.di
@@ -1,2 +1,2 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.notation b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.notation
new file mode 100644
index 00000000000..12e3a5d91c0
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.notation
@@ -0,0 +1,113 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <css:ModelStyleSheets xmi:id="__5nfEMK5EeSkv8vaizVybg"/>
+ <notation:Diagram xmi:id="_IYESEMK6EeSkv8vaizVybg" type="PapyrusUMLClassDiagram" name="default" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_LcByUMK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_LcCZYMK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_LcCZYcK6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_LcCZYsK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZY8K6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZZMK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZZcK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZZsK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZZ8K6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZaMK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZacK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZasK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZa8K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZbMK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LcCZbcK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LcCZbsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LcCZb8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LcCZcMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcCZccK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_cssext.uml#_dZNQ8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LcByUcK6EeSkv8vaizVybg" x="81" y="59" width="124" height="115"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_L0lcQMK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_L0lcQsK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_L0lcQ8K6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_L0lcRMK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDUMK6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDUcK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDUsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDU8K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDVMK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDVcK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDVsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDV8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDWMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDWcK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_L0mDWsK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_L0mDW8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_L0mDXMK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_L0mDXcK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0mDXsK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_cssext.uml#_iBhf4MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_L0lcQcK6EeSkv8vaizVybg" x="318" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_MV710MK6EeSkv8vaizVybg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_MV8c4MK6EeSkv8vaizVybg" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_MV8c4cK6EeSkv8vaizVybg" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_MV8c4sK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c48K6EeSkv8vaizVybg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c5MK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c5cK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c5sK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c58K6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c6MK6EeSkv8vaizVybg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c6cK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c6sK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c68K6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c7MK6EeSkv8vaizVybg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_MV8c7cK6EeSkv8vaizVybg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_MV8c7sK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_MV8c78K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_MV8c8MK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV8c8cK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Class" href="classdiagram_cssext.uml#_pmtIkMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_MV710cK6EeSkv8vaizVybg" x="522" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_N_ueIMK6EeSkv8vaizVybg" type="2006">
+ <children xmi:type="notation:DecorationNode" xmi:id="_N_ueIsK6EeSkv8vaizVybg" type="5023"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_N_ueI8K6EeSkv8vaizVybg" type="8508">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_N_ueJMK6EeSkv8vaizVybg" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_N_ueJcK6EeSkv8vaizVybg" type="7015">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_N_ueJsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_N_ueJ8K6EeSkv8vaizVybg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_N_ueKMK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_N_ueKcK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Enumeration" href="classdiagram_cssext.uml#_jhxKoMK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_N_ueIcK6EeSkv8vaizVybg" x="697" y="63"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_Oao4gMK6EeSkv8vaizVybg" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_Oao4gsK6EeSkv8vaizVybg" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_OapfkMK6EeSkv8vaizVybg" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_OapfkcK6EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_OapfksK6EeSkv8vaizVybg"/>
+ </children>
+ <element xmi:type="uml:Package" href="classdiagram_cssext.uml#_l5pA8MK3EeSkv8vaizVybg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_Oao4gcK6EeSkv8vaizVybg" x="97" y="245" width="557" height="323"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_IYESEcK6EeSkv8vaizVybg" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_IYESEsK6EeSkv8vaizVybg"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_IYESE8K6EeSkv8vaizVybg">
+ <owner xmi:type="uml:Model" href="classdiagram_cssext.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </styles>
+ <element xmi:type="uml:Model" href="classdiagram_cssext.uml#_ZtEWYMK3EeSkv8vaizVybg"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.uml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.uml
new file mode 100644
index 00000000000..c8bcc3b8a52
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/classdiagram_cssext.uml
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_ZtEWYMK3EeSkv8vaizVybg" name="Model">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_ZtEWYcK3EeSkv8vaizVybg">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_dZNQ8MK3EeSkv8vaizVybg" name="Foo">
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_XFcBQMLBEeSkv8vaizVybg" name="ok">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_qkfmgMK3EeSkv8vaizVybg" name="bar" type="_iBhf4MK3EeSkv8vaizVybg" association="_qkgNkMK3EeSkv8vaizVybg">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qkfmgcK3EeSkv8vaizVybg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_qkfmgsK3EeSkv8vaizVybg" value="1"/>
+ </ownedAttribute>
+ <ownedOperation xmi:type="uml:Operation" xmi:id="_68S0AMK6EeSkv8vaizVybg" name="doIt"/>
+ <nestedClassifier xmi:type="uml:Class" xmi:id="_88g_UMK6EeSkv8vaizVybg" name="Nested"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_iBhf4MK3EeSkv8vaizVybg" name="Bar">
+ <generalization xmi:type="uml:Generalization" xmi:id="_rYz_YMK3EeSkv8vaizVybg" general="_pmtIkMK3EeSkv8vaizVybg"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Enumeration" xmi:id="_jhxKoMK3EeSkv8vaizVybg" name="YesNo">
+ <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_wXsUMMK3EeSkv8vaizVybg" name="no"/>
+ <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_vemJAMK3EeSkv8vaizVybg" name="yes"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_l5pA8MK3EeSkv8vaizVybg" name="types">
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_sShOkMK3EeSkv8vaizVybg" alias="Foo" importedElement="_dZNQ8MK3EeSkv8vaizVybg"/>
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_s2kW0MK3EeSkv8vaizVybg" alias="Bar" importedElement="_iBhf4MK3EeSkv8vaizVybg"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_AINmoMK4EeSkv8vaizVybg" name="SubFoo">
+ <generalization xmi:type="uml:Generalization" xmi:id="_BxHeIMK4EeSkv8vaizVybg" general="_dZNQ8MK3EeSkv8vaizVybg"/>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_MnwQgMK4EeSkv8vaizVybg" name="createdOn" type="_KR5MYMK4EeSkv8vaizVybg"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:DataType" xmi:id="_KR5MYMK4EeSkv8vaizVybg" name="Date"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_pmtIkMK3EeSkv8vaizVybg" name="Super"/>
+ <packagedElement xmi:type="uml:Association" xmi:id="_qkgNkMK3EeSkv8vaizVybg" memberEnd="_qkgNkcK3EeSkv8vaizVybg _qkfmgMK3EeSkv8vaizVybg">
+ <name xsi:nil="true"/>
+ <ownedEnd xmi:type="uml:Property" xmi:id="_qkgNkcK3EeSkv8vaizVybg" name="foo" type="_dZNQ8MK3EeSkv8vaizVybg" association="_qkgNkMK3EeSkv8vaizVybg">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_qkgNksK3EeSkv8vaizVybg" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_qkgNk8K3EeSkv8vaizVybg" value="1"/>
+ </ownedEnd>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Usage" xmi:id="_Y9sG4MLCEeSkv8vaizVybg" client="_pmtIkMK3EeSkv8vaizVybg" supplier="_jhxKoMK3EeSkv8vaizVybg"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.di b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.di
new file mode 100644
index 00000000000..bf9abab340f
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.di
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.notation b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.notation
new file mode 100644
index 00000000000..65687362318
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.notation
@@ -0,0 +1,272 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <notation:Diagram xmi:id="_gwEH0L0AEeSZ7qIHfPXYkw" type="PapyrusUMLClassDiagram" name="classes" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_i7RbIL0AEeSZ7qIHfPXYkw" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_i7TQUL0AEeSZ7qIHfPXYkw" type="5029">
+ <element xmi:type="uml:Class" href="composite.uml#_i7KtcL0AEeSZ7qIHfPXYkw"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_i7T3YL0AEeSZ7qIHfPXYkw" type="8510">
+ <element xmi:type="uml:Class" href="composite.uml#_i7KtcL0AEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_i7T3Yb0AEeSZ7qIHfPXYkw" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_i7T3Yr0AEeSZ7qIHfPXYkw" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_i7T3Y70AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_i7T3ZL0AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_i7T3Zb0AEeSZ7qIHfPXYkw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_i7KtcL0AEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_i7T3Zr0AEeSZ7qIHfPXYkw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_i7T3Z70AEeSZ7qIHfPXYkw" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_i7T3aL0AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_i7T3ab0AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_i7T3ar0AEeSZ7qIHfPXYkw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_i7KtcL0AEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_i7T3a70AEeSZ7qIHfPXYkw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_i7T3bL0AEeSZ7qIHfPXYkw" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_i7T3bb0AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_i7T3br0AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_i7T3b70AEeSZ7qIHfPXYkw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_i7KtcL0AEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_i7T3cL0AEeSZ7qIHfPXYkw"/>
+ </children>
+ <element xmi:type="uml:Class" href="composite.uml#_i7KtcL0AEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_i7RbIb0AEeSZ7qIHfPXYkw" x="69" y="43"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_jbVbQL0AEeSZ7qIHfPXYkw" type="2006">
+ <children xmi:type="notation:DecorationNode" xmi:id="_jbVbQr0AEeSZ7qIHfPXYkw" type="5023">
+ <element xmi:type="uml:Enumeration" href="composite.uml#_jbS_AL0AEeSZ7qIHfPXYkw"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_jbVbQ70AEeSZ7qIHfPXYkw" type="8508">
+ <element xmi:type="uml:Enumeration" href="composite.uml#_jbS_AL0AEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_jbVbRL0AEeSZ7qIHfPXYkw" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_jbVbRb0AEeSZ7qIHfPXYkw" type="7015">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_jbVbRr0AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_jbVbR70AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_jbVbSL0AEeSZ7qIHfPXYkw"/>
+ <element xmi:type="uml:Enumeration" href="composite.uml#_jbS_AL0AEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jbVbSb0AEeSZ7qIHfPXYkw"/>
+ </children>
+ <element xmi:type="uml:Enumeration" href="composite.uml#_jbS_AL0AEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_jbVbQb0AEeSZ7qIHfPXYkw" x="309" y="40"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_ZGFMwL0CEeSZ7qIHfPXYkw" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_ZGFz0L0CEeSZ7qIHfPXYkw" type="5026">
+ <element xmi:type="uml:Package" href="composite.uml#_ZGCwgL0CEeSZ7qIHfPXYkw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_ZGFz0b0CEeSZ7qIHfPXYkw" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_ZGFz0r0CEeSZ7qIHfPXYkw"/>
+ <element xmi:type="uml:Package" href="composite.uml#_ZGCwgL0CEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZGFz070CEeSZ7qIHfPXYkw"/>
+ </children>
+ <element xmi:type="uml:Package" href="composite.uml#_ZGCwgL0CEeSZ7qIHfPXYkw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ZGFMwb0CEeSZ7qIHfPXYkw" x="389" y="211" width="503" height="310"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_LsckEMHiEeSTWuBP4IruAw" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_LsdLIMHiEeSTWuBP4IruAw" type="5029">
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_LsdLIcHiEeSTWuBP4IruAw" type="8510">
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_LsdLIsHiEeSTWuBP4IruAw" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LsdLI8HiEeSTWuBP4IruAw" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LsdLJMHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LsdLJcHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LsdLJsHiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LsdLJ8HiEeSTWuBP4IruAw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LsdLKMHiEeSTWuBP4IruAw" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LsdLKcHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LsdLKsHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LsdLK8HiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LsdLLMHiEeSTWuBP4IruAw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_LsdyMMHiEeSTWuBP4IruAw" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_LsdyMcHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_LsdyMsHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_LsdyM8HiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LsdyNMHiEeSTWuBP4IruAw"/>
+ </children>
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_LsckEcHiEeSTWuBP4IruAw" x="63" y="270"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_dpOSsMHiEeSTWuBP4IruAw" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_dpO5wMHiEeSTWuBP4IruAw" type="5029">
+ <element xmi:type="uml:Class" href="composite.uml#_dpMdgMHiEeSTWuBP4IruAw"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_dpO5wcHiEeSTWuBP4IruAw" type="8510">
+ <element xmi:type="uml:Class" href="composite.uml#_dpMdgMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_dpO5wsHiEeSTWuBP4IruAw" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_dpO5w8HiEeSTWuBP4IruAw" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_dpO5xMHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_dpO5xcHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_dpO5xsHiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_dpMdgMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dpO5x8HiEeSTWuBP4IruAw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_dpO5yMHiEeSTWuBP4IruAw" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_dpO5ycHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_dpO5ysHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_dpO5y8HiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_dpMdgMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dpO5zMHiEeSTWuBP4IruAw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_dpO5zcHiEeSTWuBP4IruAw" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_dpO5zsHiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_dpO5z8HiEeSTWuBP4IruAw"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_dpO50MHiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_dpMdgMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dpO50cHiEeSTWuBP4IruAw"/>
+ </children>
+ <element xmi:type="uml:Class" href="composite.uml#_dpMdgMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_dpOSscHiEeSTWuBP4IruAw" x="229" y="195"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_ad8Q8MddEeSfY4Ck7He7hQ" type="2010">
+ <children xmi:type="notation:DecorationNode" xmi:id="_ad9fEMddEeSfY4Ck7He7hQ" type="5035">
+ <element xmi:type="uml:DataType" href="composite.uml#_ac_OsMddEeSfY4Ck7He7hQ"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_ad-GIMddEeSfY4Ck7He7hQ" type="8502">
+ <element xmi:type="uml:DataType" href="composite.uml#_ac_OsMddEeSfY4Ck7He7hQ"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_ad-GIcddEeSfY4Ck7He7hQ" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_ad-GIsddEeSfY4Ck7He7hQ" type="7020">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_ad-GI8ddEeSfY4Ck7He7hQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_ad-GJMddEeSfY4Ck7He7hQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_ad-GJcddEeSfY4Ck7He7hQ"/>
+ <element xmi:type="uml:DataType" href="composite.uml#_ac_OsMddEeSfY4Ck7He7hQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ad-GJsddEeSfY4Ck7He7hQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_ad-GJ8ddEeSfY4Ck7He7hQ" type="7021">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_ad-GKMddEeSfY4Ck7He7hQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_ad-GKcddEeSfY4Ck7He7hQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_ad-GKsddEeSfY4Ck7He7hQ"/>
+ <element xmi:type="uml:DataType" href="composite.uml#_ac_OsMddEeSfY4Ck7He7hQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ad-GK8ddEeSfY4Ck7He7hQ"/>
+ </children>
+ <element xmi:type="uml:DataType" href="composite.uml#_ac_OsMddEeSfY4Ck7He7hQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_ad8Q8cddEeSfY4Ck7He7hQ" x="583" y="59"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_gwEH0b0AEeSZ7qIHfPXYkw" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_gwEH0r0AEeSZ7qIHfPXYkw"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_gwEH070AEeSZ7qIHfPXYkw">
+ <owner xmi:type="uml:Model" href="composite.uml#_guW3oL0AEeSZ7qIHfPXYkw"/>
+ </styles>
+ <styles xmi:type="notation:EObjectListValueStyle" xmi:id="__OQFIMJ9EeSzcaB9FnIU4g" name="css_stylesheets"/>
+ <element xmi:type="uml:Model" href="composite.uml#_guW3oL0AEeSZ7qIHfPXYkw"/>
+ <edges xmi:type="notation:Connector" xmi:id="_HxbgAMHiEeSTWuBP4IruAw" type="4007" source="_i7RbIL0AEeSZ7qIHfPXYkw" target="_jbVbQL0AEeSZ7qIHfPXYkw">
+ <children xmi:type="notation:DecorationNode" xmi:id="_HxcHEMHiEeSTWuBP4IruAw" type="6016">
+ <element xmi:type="uml:Usage" href="composite.uml#_HxX1oMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_HxcHEcHiEeSTWuBP4IruAw" y="40"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_HxcHEsHiEeSTWuBP4IruAw" type="6017">
+ <element xmi:type="uml:Usage" href="composite.uml#_HxX1oMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_HxcHE8HiEeSTWuBP4IruAw" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_HxbgAcHiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Usage" href="composite.uml#_HxX1oMHiEeSTWuBP4IruAw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_HxbgAsHiEeSTWuBP4IruAw" points="[24, 0, -120, -24]$[164, -26, 20, -50]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Hxtz4MHiEeSTWuBP4IruAw" id="(1.0,0.23)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_Hxua8MHiEeSTWuBP4IruAw" id="(0.0,0.26)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_OttVoMHiEeSTWuBP4IruAw" type="4001" source="_i7RbIL0AEeSZ7qIHfPXYkw" target="_LsckEMHiEeSTWuBP4IruAw">
+ <children xmi:type="notation:DecorationNode" xmi:id="_OttVo8HiEeSTWuBP4IruAw" type="6001">
+ <element xmi:type="uml:Association" href="composite.uml#_OtkLsMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_OttVpMHiEeSTWuBP4IruAw" y="-20"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Ott8sMHiEeSTWuBP4IruAw" visible="false" type="6002">
+ <element xmi:type="uml:Association" href="composite.uml#_OtkLsMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_Ott8scHiEeSTWuBP4IruAw" y="20"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Ott8ssHiEeSTWuBP4IruAw" type="6003">
+ <element xmi:type="uml:Association" href="composite.uml#_OtkLsMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_Ott8s8HiEeSTWuBP4IruAw" y="-20"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Ott8tMHiEeSTWuBP4IruAw" type="6005">
+ <element xmi:type="uml:Association" href="composite.uml#_OtkLsMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_Ott8tcHiEeSTWuBP4IruAw" y="20"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Ott8tsHiEeSTWuBP4IruAw" type="6033">
+ <element xmi:type="uml:Association" href="composite.uml#_OtkLsMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_Ott8t8HiEeSTWuBP4IruAw" y="20"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_Ott8uMHiEeSTWuBP4IruAw" type="6034">
+ <element xmi:type="uml:Association" href="composite.uml#_OtkLsMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_Ott8ucHiEeSTWuBP4IruAw" y="-20"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_OttVocHiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Association" href="composite.uml#_OtkLsMHiEeSTWuBP4IruAw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_OttVosHiEeSTWuBP4IruAw" points="[-5, 11, 0, -150]$[-7, 138, -2, -23]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OuXc8MHiEeSTWuBP4IruAw" id="(0.46,1.0)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_OuYEAMHiEeSTWuBP4IruAw" id="(0.48,0.0)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_dpeKUMHiEeSTWuBP4IruAw" type="4002" source="_LsckEMHiEeSTWuBP4IruAw" target="_dpOSsMHiEeSTWuBP4IruAw">
+ <children xmi:type="notation:DecorationNode" xmi:id="_dpexYMHiEeSTWuBP4IruAw" type="6007">
+ <element xmi:type="uml:Generalization" href="composite.uml#_dpbuEMHiEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_dpexYcHiEeSTWuBP4IruAw" y="40"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_dpeKUcHiEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Generalization" href="composite.uml#_dpbuEMHiEeSTWuBP4IruAw"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_dpeKUsHiEeSTWuBP4IruAw" points="[-28, -100, 72, 270]$[-100, -370, 0, 0]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_dpoiYMHiEeSTWuBP4IruAw" id="(1.0,0.56)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_ekK4AMHiEeSTWuBP4IruAw" id="(0.0,0.84)"/>
+ </edges>
+ <edges xmi:type="notation:Connector" xmi:id="_PeLj8MIcEeSbhqqLzaRcPg" type="4009" source="_ZGFMwL0CEeSZ7qIHfPXYkw" target="_jbVbQL0AEeSZ7qIHfPXYkw">
+ <children xmi:type="notation:DecorationNode" xmi:id="_PeMLAMIcEeSbhqqLzaRcPg" type="6020">
+ <element xmi:type="uml:ElementImport" href="composite.uml#_PeDBEMIcEeSbhqqLzaRcPg"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_PeMLAcIcEeSbhqqLzaRcPg" y="40"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_PeMLAsIcEeSbhqqLzaRcPg" type="6021">
+ <element xmi:type="uml:ElementImport" href="composite.uml#_PeDBEMIcEeSbhqqLzaRcPg"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_PeMLA8IcEeSbhqqLzaRcPg" y="60"/>
+ </children>
+ <styles xmi:type="notation:FontStyle" xmi:id="_PeLj8cIcEeSbhqqLzaRcPg"/>
+ <element xmi:type="uml:ElementImport" href="composite.uml#_PeDBEMIcEeSbhqqLzaRcPg"/>
+ <bendpoints xmi:type="notation:RelativeBendpoints" xmi:id="_PeLj8sIcEeSbhqqLzaRcPg" points="[-6, -13, 52, 134]$[-54, -160, 4, -13]"/>
+ <sourceAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PefF8MIcEeSbhqqLzaRcPg" id="(0.25646123260437376,0.0)"/>
+ <targetAnchor xmi:type="notation:IdentityAnchor" xmi:id="_PefF8cIcEeSbhqqLzaRcPg" id="(0.98,1.0)"/>
+ </edges>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_gmsbUMHgEeSTWuBP4IruAw" type="CompositeStructure" name="main" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_paS-8MHgEeSTWuBP4IruAw" type="2073">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_Lj62kMmrEeSksMS4kafq1w" source="PapyrusCSSForceValue">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_Lj62kcmrEeSksMS4kafq1w" key="mutable" value="true"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_paTmAMHgEeSTWuBP4IruAw" type="5156">
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ </children>
+ <children xmi:type="notation:DecorationNode" xmi:id="_paTmAcHgEeSTWuBP4IruAw" type="6089">
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_paTmAsHgEeSTWuBP4IruAw" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_paTmA8HgEeSTWuBP4IruAw" type="7073">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_6W_QgMmqEeSksMS4kafq1w" source="PapyrusCSSForceValue">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_6W_QgcmqEeSksMS4kafq1w" key="mutable" value="true"/>
+ </eAnnotations>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_paTmBMHgEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_paTmBcHgEeSTWuBP4IruAw"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_paZFkMHgEeSTWuBP4IruAw" type="compartment_shape_display">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_paZFkcHgEeSTWuBP4IruAw"/>
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_paZFksHgEeSTWuBP4IruAw"/>
+ </children>
+ <element xmi:type="uml:Class" href="composite.uml#_paOGcMHgEeSTWuBP4IruAw"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_paS-8cHgEeSTWuBP4IruAw" x="72" y="81" width="461" height="329"/>
+ </children>
+ <styles xmi:type="notation:StringValueStyle" xmi:id="_gmsbUcHgEeSTWuBP4IruAw" name="diagram_compatibility_version" stringValue="1.0.0"/>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_gmsbUsHgEeSTWuBP4IruAw"/>
+ <styles xmi:type="style:PapyrusViewStyle" xmi:id="_gmsbU8HgEeSTWuBP4IruAw">
+ <owner xmi:type="uml:Model" href="composite.uml#_guW3oL0AEeSZ7qIHfPXYkw"/>
+ </styles>
+ <styles xmi:type="notation:EObjectListValueStyle" xmi:id="_nYDgUMm1EeSksMS4kafq1w" name="css_stylesheets"/>
+ <element xmi:type="uml:Model" href="composite.uml#_guW3oL0AEeSZ7qIHfPXYkw"/>
+ </notation:Diagram>
+ <css:ModelStyleSheets xmi:id="_8BYggMJ9EeSzcaB9FnIU4g"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.uml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.uml
new file mode 100644
index 00000000000..fab055a879f
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/composite.uml
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_guW3oL0AEeSZ7qIHfPXYkw" name="Model">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_guW3ob0AEeSZ7qIHfPXYkw">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_i7KtcL0AEeSZ7qIHfPXYkw" name="Foo">
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_rR0PUL0AEeSZ7qIHfPXYkw" name="isOK">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Boolean"/>
+ </ownedAttribute>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_OtodIMHiEeSTWuBP4IruAw" name="blackbox" type="_paOGcMHgEeSTWuBP4IruAw" association="_OtkLsMHiEeSTWuBP4IruAw"/>
+ <nestedClassifier xmi:type="uml:Class" xmi:id="_4PMrwL0AEeSZ7qIHfPXYkw" name="Nested"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Enumeration" xmi:id="_jbS_AL0AEeSZ7qIHfPXYkw" name="YesNo">
+ <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_lc2AAL0AEeSZ7qIHfPXYkw" name="no"/>
+ <ownedLiteral xmi:type="uml:EnumerationLiteral" xmi:id="_nzE3kL0AEeSZ7qIHfPXYkw" name="yes"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_ZGCwgL0CEeSZ7qIHfPXYkw" name="stuff">
+ <elementImport xmi:type="uml:ElementImport" xmi:id="_PeDBEMIcEeSbhqqLzaRcPg" importedElement="_jbS_AL0AEeSZ7qIHfPXYkw"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_cM07QL0CEeSZ7qIHfPXYkw" name="Packaged">
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_eyMGwMDuEeSmA6K_2O402g" name="age">
+ <type xmi:type="uml:PrimitiveType" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Integer"/>
+ </ownedAttribute>
+ <nestedClassifier xmi:type="uml:Class" xmi:id="_eyOjAMDuEeSmA6K_2O402g" name="Nested"/>
+ </packagedElement>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_paOGcMHgEeSTWuBP4IruAw" name="BlackBox">
+ <generalization xmi:type="uml:Generalization" xmi:id="_dpbuEMHiEeSTWuBP4IruAw" general="_dpMdgMHiEeSTWuBP4IruAw"/>
+ <ownedAttribute xmi:type="uml:Port" xmi:id="_s-WUgMHgEeSTWuBP4IruAw" name="output" aggregation="composite"/>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_vci1QMHgEeSTWuBP4IruAw" name="nested" type="_rfD2kMHhEeSTWuBP4IruAw"/>
+ <ownedConnector xmi:type="uml:Connector" xmi:id="_6-pKAMHhEeSTWuBP4IruAw" name="delegateToBlueBox">
+ <end xmi:type="uml:ConnectorEnd" xmi:id="_6-pxEMHhEeSTWuBP4IruAw" partWithPort="_vci1QMHgEeSTWuBP4IruAw" role="_wCatAMHhEeSTWuBP4IruAw">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_6-pxEcHhEeSTWuBP4IruAw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_6-pxEsHhEeSTWuBP4IruAw" value="1"/>
+ </end>
+ <end xmi:type="uml:ConnectorEnd" xmi:id="_6-pxE8HhEeSTWuBP4IruAw" role="_s-WUgMHgEeSTWuBP4IruAw">
+ <lowerValue xmi:type="uml:LiteralInteger" xmi:id="_6-pxFMHhEeSTWuBP4IruAw" value="1"/>
+ <upperValue xmi:type="uml:LiteralUnlimitedNatural" xmi:id="_6-pxFcHhEeSTWuBP4IruAw" value="1"/>
+ </end>
+ </ownedConnector>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_rfD2kMHhEeSTWuBP4IruAw" name="BlueBox">
+ <ownedAttribute xmi:type="uml:Port" xmi:id="_wCatAMHhEeSTWuBP4IruAw" name="output" aggregation="composite"/>
+ <ownedAttribute xmi:type="uml:Property" xmi:id="_kRcucMHjEeSqf97Famh-Ww" name="nested" type="_paOGcMHgEeSTWuBP4IruAw"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Usage" xmi:id="_HxX1oMHiEeSTWuBP4IruAw" client="_i7KtcL0AEeSZ7qIHfPXYkw" supplier="_jbS_AL0AEeSZ7qIHfPXYkw"/>
+ <packagedElement xmi:type="uml:Association" xmi:id="_OtkLsMHiEeSTWuBP4IruAw" name="A_blackbox_foo" memberEnd="_OtodIMHiEeSTWuBP4IruAw _OtpEMMHiEeSTWuBP4IruAw">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_OtnPAMHiEeSTWuBP4IruAw" source="org.eclipse.papyrus">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_OtnPAcHiEeSTWuBP4IruAw" key="nature" value="UML_Nature"/>
+ </eAnnotations>
+ <ownedEnd xmi:type="uml:Property" xmi:id="_OtpEMMHiEeSTWuBP4IruAw" name="foo" type="_i7KtcL0AEeSZ7qIHfPXYkw" association="_OtkLsMHiEeSTWuBP4IruAw"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Class" xmi:id="_dpMdgMHiEeSTWuBP4IruAw" name="Box"/>
+ <packagedElement xmi:type="uml:DataType" xmi:id="_ac_OsMddEeSfY4Ck7He7hQ" name="Date"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/compositediagram.css b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/compositediagram.css
new file mode 100644
index 00000000000..d72e2114f09
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/models/compositediagram.css
@@ -0,0 +1,17 @@
+/*
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ */
+
+/* Make all shapes in a composite structure diagram canonical. */
+Class, Property, Port {
+ canonical: true;
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/org.eclipse.papyrus.infra.gmfdiag.canonical.tests.launch b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/org.eclipse.papyrus.infra.gmfdiag.canonical.tests.launch
new file mode 100644
index 00000000000..f88cb41344e
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/org.eclipse.papyrus.infra.gmfdiag.canonical.tests.launch
@@ -0,0 +1,43 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AllTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<booleanAttribute key="org.eclipse.jdt.launching.ATTR_USE_START_ON_FIRST_THREAD" value="true"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.infra.gmfdiag.canonical.tests.AllTests"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.infra.gmfdiag.canonical.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Xmx1024m -DsuppressRawWhenUnchecked=true -XX:MaxPermSize=512M&#10;-XX:SoftRefLRUPolicyMSPerMB=100&#10;-Doomph.setup.skip=true&#10;-Doomph.setup.questionnaire.skip=true"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}/configuration/config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/plugin.properties b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/plugin.properties
index 6b71a1c9176..283aea4c789 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/plugin.properties
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/plugin.properties
@@ -1,5 +1,5 @@
#################################################################################
-# Copyright (c) 2008 CEA LIST.
+# Copyright (c) 2008, 2015 CEA LIST, Christian W. Damus, and others.
# 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
@@ -7,6 +7,7 @@
#
# Contributors:
# Patrick Tessier (CEA LIST) Patrick.tessier@cea.fr - initial API and implementation
+# Christian W. Damus - bug 433206
##################################################################################
-pluginName=synchronize view test
+pluginName=Canonical Diagram Infrastructure Tests
providerName=Eclipse Modeling Project
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/pom.xml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/pom.xml
new file mode 100644
index 00000000000..087eabc352a
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/pom.xml
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project>
+ <modelVersion>4.0.0</modelVersion>
+ <parent>
+ <artifactId>org.eclipse.papyrus</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <relativePath>../../../../../../releng/top-pom-main-tests.xml</relativePath>
+ </parent>
+ <artifactId>org.eclipse.papyrus.infra.gmfdiag.canonical.tests</artifactId>
+ <groupId>org.eclipse.papyrus</groupId>
+ <version>1.1.0-SNAPSHOT</version>
+ <packaging>eclipse-test-plugin</packaging>
+</project> \ No newline at end of file
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AbstractCSSCanonicalTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AbstractCSSCanonicalTest.java
new file mode 100644
index 00000000000..9a6b36c527d
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AbstractCSSCanonicalTest.java
@@ -0,0 +1,183 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import java.io.InputStream;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.net.URL;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.emf.common.command.Command;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.gmfdiag.common.databinding.custom.AddCustomStyleListValueCommand;
+import org.eclipse.papyrus.infra.gmfdiag.common.helper.DiagramHelper;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.GMFUnsafe;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSStyles;
+import org.eclipse.papyrus.infra.gmfdiag.css.properties.databinding.AddCSSStyleSheetCommand;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.EmbeddedStyleSheet;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StyleSheetReference;
+import org.eclipse.papyrus.infra.gmfdiag.css.stylesheets.StylesheetsFactory;
+import org.eclipse.papyrus.junit.utils.JUnitUtils;
+import org.junit.Rule;
+import org.junit.rules.TestRule;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+import org.osgi.framework.FrameworkUtil;
+
+import com.google.common.collect.Iterables;
+
+/**
+ * Common implementation of canonical test cases for CSS.
+ */
+public class AbstractCSSCanonicalTest extends AbstractCanonicalTest {
+ @Rule
+ public final TestRule stylesheetRule = new StylesheetRule();
+
+ protected IFile cssFile;
+
+ public AbstractCSSCanonicalTest() {
+ super();
+ }
+
+ protected EmbeddedStyleSheet getStylesheet(String name) {
+ EmbeddedStyleSheet result = null;
+
+ for (EmbeddedStyleSheet next : Iterables.filter(getDiagramEditPart().getNotationView().eResource().getContents(), EmbeddedStyleSheet.class)) {
+ if (name.equals(next.getLabel())) {
+ result = next;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ protected void referenceEmbeddedStylesheet(String name) {
+ referenceEmbeddedStylesheet(name, false);
+ }
+
+ private void referenceEmbeddedStylesheet(String name, boolean unsafe) {
+ TransactionalEditingDomain domain = editor.getEditingDomain();
+ View targetView = getDiagramEditPart().getNotationView();
+ EmbeddedStyleSheet css = getStylesheet(name);
+
+ Command command = new AddCSSStyleSheetCommand(domain, targetView,
+ CSSStyles.CSS_DIAGRAM_STYLESHEETS_KEY,
+ NotationPackage.Literals.EOBJECT_LIST_VALUE_STYLE, NotationPackage.Literals.EOBJECT_LIST_VALUE_STYLE__EOBJECT_LIST_VALUE,
+ css);
+
+ if (unsafe) {
+ command = GMFUnsafe.wrap(editor.getEditingDomain(), command);
+ command.execute();
+ domain.getCommandStack().flush(); // Just in case
+ } else {
+ domain.getCommandStack().execute(command);
+ }
+
+ waitForUIEvents();
+ }
+
+ protected void referenceExternalStylesheet(String path) {
+ referenceExternalStylesheet(path, false);
+ }
+
+ private void referenceExternalStylesheet(String path, boolean unsafe) {
+ TransactionalEditingDomain domain = editor.getEditingDomain();
+ View targetView = getDiagramEditPart().getNotationView();
+ StyleSheetReference css = StylesheetsFactory.eINSTANCE.createStyleSheetReference();
+ css.setPath(path);
+
+ Command command = new AddCSSStyleSheetCommand(domain, targetView,
+ CSSStyles.CSS_DIAGRAM_STYLESHEETS_KEY,
+ NotationPackage.Literals.EOBJECT_LIST_VALUE_STYLE, NotationPackage.Literals.EOBJECT_LIST_VALUE_STYLE__EOBJECT_LIST_VALUE,
+ css);
+
+ if (unsafe) {
+ command = GMFUnsafe.wrap(editor.getEditingDomain(), command);
+ command.execute();
+ domain.getCommandStack().flush(); // Just in case
+ } else {
+ domain.getCommandStack().execute(command);
+ }
+
+ waitForUIEvents();
+ }
+
+ protected void addStyleClass(View view, String name) {
+ TransactionalEditingDomain domain = editor.getEditingDomain();
+
+ Command command = new AddCustomStyleListValueCommand(domain, view,
+ CSSStyles.CSS_GMF_CLASS_KEY,
+ NotationPackage.Literals.STRING_LIST_VALUE_STYLE, NotationPackage.Literals.STRING_LIST_VALUE_STYLE__STRING_LIST_VALUE,
+ name);
+
+ domain.getCommandStack().execute(command);
+
+ waitForUIEvents();
+ }
+
+ protected void refreshDiagram() {
+ Diagram diagram = editor.getActiveDiagramEditor().getDiagram();
+ ((CSSDiagram) diagram).getEngine().reset();
+ DiagramHelper.forceRefresh(editor.getActiveDiagramEditor().getDiagramEditPart());
+ }
+
+ //
+ // Nested types
+ //
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ ElementType.TYPE, ElementType.METHOD })
+ protected @interface StylesheetRef {
+ String value();
+ }
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ ElementType.TYPE, ElementType.METHOD })
+ protected @interface CSSResource {
+ String value();
+ }
+
+ private class StylesheetRule extends TestWatcher {
+ @Override
+ protected void starting(Description description) {
+ StylesheetRef ref = JUnitUtils.getAnnotation(description, StylesheetRef.class);
+ if (ref != null) {
+ referenceEmbeddedStylesheet(ref.value(), true);
+ }
+
+ CSSResource css = JUnitUtils.getAnnotation(description, CSSResource.class);
+ if (css != null) {
+ URL url = FrameworkUtil.getBundle(getClass()).getEntry(css.value());
+ try (InputStream contents = url.openStream()) {
+ cssFile = editor.getProject().getProject().getFile(URI.createURI(url.toExternalForm()).lastSegment());
+ cssFile.create(contents, false, null);
+ } catch (Exception e) {
+ throw new WrappedException(e);
+ }
+ referenceExternalStylesheet(cssFile.getFullPath().toString(), true);
+ }
+ }
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AbstractCanonicalTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AbstractCanonicalTest.java
new file mode 100644
index 00000000000..89f968afcce
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AbstractCanonicalTest.java
@@ -0,0 +1,708 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import static org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil.isCanonical;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+import static org.junit.Assert.fail;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
+import java.util.concurrent.Callable;
+import java.util.concurrent.FutureTask;
+
+import org.eclipse.draw2d.geometry.Point;
+import org.eclipse.emf.common.command.CommandStack;
+import org.eclipse.emf.common.util.AbstractTreeIterator;
+import org.eclipse.emf.common.util.TreeIterator;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.ENamedElement;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.edit.command.AddCommand;
+import org.eclipse.emf.edit.command.RemoveCommand;
+import org.eclipse.emf.edit.provider.ComposedAdapterFactory;
+import org.eclipse.emf.edit.provider.IItemLabelProvider;
+import org.eclipse.emf.transaction.RecordingCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.RequestConstants;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gef.requests.GroupRequest;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.common.core.command.UnexecutableCommand;
+import org.eclipse.gmf.runtime.diagram.core.edithelpers.CreateElementRequestAdapter;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IGraphicalEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateConnectionViewAndElementRequest;
+import org.eclipse.gmf.runtime.diagram.ui.requests.CreateViewAndElementRequest;
+import org.eclipse.gmf.runtime.emf.commands.core.command.CompositeTransactionalCommand;
+import org.eclipse.gmf.runtime.emf.type.core.ElementTypeRegistry;
+import org.eclipse.gmf.runtime.emf.type.core.IElementType;
+import org.eclipse.gmf.runtime.emf.type.core.IHintedType;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.Node;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.utils.AdapterUtils;
+import org.eclipse.papyrus.infra.emf.utils.TreeIterators;
+import org.eclipse.papyrus.infra.gmfdiag.common.commands.SetCanonicalCommand;
+import org.eclipse.papyrus.infra.gmfdiag.common.utils.DiagramEditPartsUtil;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.infra.services.edit.utils.ElementTypeUtils;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.eclipse.papyrus.junit.utils.JUnitUtils;
+import org.eclipse.papyrus.junit.utils.rules.HouseKeeper;
+import org.eclipse.papyrus.junit.utils.rules.PapyrusEditorFixture;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassAttributeCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassNestedClassifierCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.ClassOperationCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.EnumerationEnumerationLiteralCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.edit.parts.PackagePackageableElementCompartmentEditPart;
+import org.eclipse.papyrus.uml.diagram.clazz.providers.UMLElementTypes;
+import org.eclipse.uml2.uml.AggregationKind;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.DirectedRelationship;
+import org.eclipse.uml2.uml.LiteralUnlimitedNatural;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Type;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.eclipse.uml2.uml.util.UMLUtil;
+import org.junit.Before;
+import org.junit.Rule;
+import org.junit.rules.TestRule;
+import org.junit.rules.TestWatcher;
+import org.junit.runner.Description;
+
+import com.google.common.base.Function;
+import com.google.common.base.Predicates;
+import com.google.common.collect.Iterables;
+import com.google.common.collect.Iterators;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.util.concurrent.Futures;
+
+/**
+ * Common implementation of canonical test cases.
+ */
+public class AbstractCanonicalTest extends AbstractPapyrusTest {
+ @Rule
+ public final HouseKeeper houseKeeper = new HouseKeeper();
+
+ @Rule
+ public final TestRule annotationRule = new AnnotationRule();
+
+ @Rule
+ public final PapyrusEditorFixture editor = new PapyrusEditorFixture();
+
+ private ComposedAdapterFactory adapterFactory;
+
+ private boolean needUIEvents;
+
+ public AbstractCanonicalTest() {
+ super();
+ }
+
+ @Before
+ public void createAdapterFactory() {
+ houseKeeper.setField("adapterFactory", new ComposedAdapterFactory(ComposedAdapterFactory.Descriptor.Registry.INSTANCE));
+ }
+
+ protected DiagramEditPart getDiagramEditPart() {
+ return editor.getActiveDiagramEditor().getDiagramEditPart();
+ }
+
+ protected TreeIterator<IGraphicalEditPart> allContents(EditPart root, boolean includeRoot) {
+ return TreeIterators.filter(DiagramEditPartsUtil.getAllContents(root, includeRoot), IGraphicalEditPart.class);
+ }
+
+ protected IGraphicalEditPart getEditPart(EObject element) {
+ return getEditPart(element, getDiagramEditPart());
+ }
+
+ protected IGraphicalEditPart getEditPart(EObject element, IGraphicalEditPart scope) {
+ IGraphicalEditPart result = null;
+
+ for (Iterator<IGraphicalEditPart> iter = allContents(scope, true); iter.hasNext();) {
+ IGraphicalEditPart next = iter.next();
+ View view = next.getNotationView();
+ if ((view != null) && (view.getElement() == element)) {
+ result = next;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ protected IGraphicalEditPart requireEditPart(EObject element) {
+ IGraphicalEditPart result = getEditPart(element, getDiagramEditPart());
+ assertThat("No edit part for " + label(element), result, notNullValue());
+ return result;
+ }
+
+ protected IGraphicalEditPart getConnectionEditPart(EObject element) {
+ IGraphicalEditPart result = null;
+
+ for (Iterator<IGraphicalEditPart> iter = Iterators.filter(getDiagramEditPart().getConnections().iterator(), IGraphicalEditPart.class); iter.hasNext();) {
+ IGraphicalEditPart next = iter.next();
+ View view = next.getNotationView();
+ if ((view != null) && (view.getElement() == element)) {
+ result = next;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ protected IGraphicalEditPart requireConnectionEditPart(EObject element) {
+ IGraphicalEditPart result = getConnectionEditPart(element);
+ assertThat("No connection edit part for " + label(element), result, notNullValue());
+ return result;
+ }
+
+ protected View getView(EObject element, View scope) {
+ View result = null;
+
+ for (Iterator<View> iter = Iterators.filter(scope.eAllContents(), View.class); (result == null) && iter.hasNext();) {
+ View next = iter.next();
+ if (next.getElement() == element) {
+ result = next;
+ }
+ }
+
+ return result;
+ }
+
+ protected View requireView(EObject element, View scope) {
+ View result = getView(element, scope);
+ assertThat("View not found: " + label(element), result, notNullValue());
+ return result;
+ }
+
+ protected void assertNoView(EObject element, View scope) {
+ View view = getView(element, scope);
+ assertThat("View exists: " + label(element), view, nullValue());
+ }
+
+ protected IGraphicalEditPart getCompartment(IGraphicalEditPart parent, int type) {
+ return parent.getChildBySemanticHint(Integer.toString(type));
+ }
+
+ protected IGraphicalEditPart getClassAttributeCompartment(IGraphicalEditPart class_) {
+ return getCompartment(class_, ClassAttributeCompartmentEditPart.VISUAL_ID);
+ }
+
+ protected IGraphicalEditPart getClassOperationCompartment(IGraphicalEditPart class_) {
+ return getCompartment(class_, ClassOperationCompartmentEditPart.VISUAL_ID);
+ }
+
+ protected IGraphicalEditPart getClassNestedClassifierCompartment(IGraphicalEditPart class_) {
+ return getCompartment(class_, ClassNestedClassifierCompartmentEditPart.VISUAL_ID);
+ }
+
+ protected IGraphicalEditPart getEnumerationLiteralCompartment(IGraphicalEditPart enumeration) {
+ return getCompartment(enumeration, EnumerationEnumerationLiteralCompartmentEditPart.VISUAL_ID);
+ }
+
+ protected IGraphicalEditPart getPackageContentsCompartment(IGraphicalEditPart package_) {
+ return getCompartment(package_, PackagePackageableElementCompartmentEditPart.VISUAL_ID);
+ }
+
+ protected <T extends DirectedRelationship> T getRelationship(NamedElement from, NamedElement to, Class<T> type) {
+ T result = null;
+
+ for (T next : Iterables.filter(from.getSourceDirectedRelationships(), type)) {
+ if (next.getTargets().contains(to)) {
+ result = next;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ protected void execute(ICommand command) {
+ execute(GMFtoEMFCommandWrapper.wrap(command));
+ }
+
+ protected void execute(Command command) {
+ execute(GEFtoEMFCommandWrapper.wrap(command));
+ }
+
+ protected void execute(org.eclipse.emf.common.command.Command command) {
+ assertThat("Cannot execute command", command.canExecute(), is(true));
+ editor.getEditingDomain().getCommandStack().execute(command);
+ waitForUIEvents();
+ }
+
+ protected final void waitForUIEvents() {
+ // If we're running the tests in the IDE, we should see what's happening. Or, it could be that a
+ // particular test actually needs UI events to be processed before proceeding
+ if (!JUnitUtils.isAutomatedBuildExecution() || isNeedUIEvents()) {
+ editor.flushDisplayEvents();
+ }
+ }
+
+ protected final boolean isNeedUIEvents() {
+ return needUIEvents;
+ }
+
+ protected void execute(final Runnable writeOperation) {
+ execute(new RecordingCommand(editor.getEditingDomain()) {
+
+ @Override
+ protected void doExecute() {
+ writeOperation.run();
+ }
+ });
+ }
+
+ protected <V> V execute(final Callable<V> writeOperation) {
+ final FutureTask<V> result = new FutureTask<>(writeOperation);
+ execute(result);
+ return Futures.getUnchecked(result);
+ }
+
+ protected void undo() {
+ CommandStack stack = editor.getEditingDomain().getCommandStack();
+ assertThat("Cannot undo", stack.canUndo(), is(true));
+ stack.undo();
+ waitForUIEvents();
+ }
+
+ protected void redo() {
+ CommandStack stack = editor.getEditingDomain().getCommandStack();
+ assertThat("Cannot redo", stack.canRedo(), is(true));
+ stack.redo();
+ waitForUIEvents();
+ }
+
+ protected void setEditPartsCanonical(boolean canonical, Iterable<? extends EditPart> editParts) {
+ final TransactionalEditingDomain domain = editor.getEditingDomain();
+
+ ICommand command = new CompositeTransactionalCommand(domain, "Toggle Synchronize with Model");
+ for (EditPart editPart : editParts) {
+ if (canonical != isCanonical(editPart)) {
+ command = command.compose(new SetCanonicalCommand(domain, (View) editPart.getModel(), canonical));
+ } else {
+ command = UnexecutableCommand.INSTANCE;
+ break;
+ }
+ }
+
+ command = command.reduce();
+
+ execute(command);
+ }
+
+ protected void setCanonical(boolean canonical, EditPart first, EditPart second, EditPart... rest) {
+ setEditPartsCanonical(canonical, Lists.asList(first, second, rest));
+ }
+
+ protected void setCanonical(boolean canonical, EditPart editPart) {
+ final TransactionalEditingDomain domain = editor.getEditingDomain();
+
+ ICommand command = UnexecutableCommand.INSTANCE;
+ if (canonical != isCanonical(editPart)) {
+ command = new SetCanonicalCommand(domain, (View) editPart.getModel(), canonical);
+ }
+
+ execute(command);
+ }
+
+ protected void setElementsCanonical(boolean canonical, Iterable<? extends EObject> elements) {
+ List<EditPart> editParts = Lists.newArrayList();
+ for (EObject next : elements) {
+ editParts.add(requireEditPart(next));
+ }
+ setEditPartsCanonical(canonical, editParts);
+ }
+
+ protected void setCanonical(boolean canonical, EObject first, EObject second, EObject... rest) {
+ setElementsCanonical(canonical, Lists.asList(first, second, rest));
+ }
+
+ protected void setCanonical(boolean canonical, EObject element) {
+ setCanonical(canonical, requireEditPart(element));
+ }
+
+ /**
+ * Adds a new semantic {@code element} to the model.
+ * Relies on canonical edit policy to create the notation view.
+ */
+ protected void add(EObject owner, EObject element, EReference feature) {
+ execute(AddCommand.create(editor.getEditingDomain(), owner, feature, element));
+ }
+
+ /**
+ * Creates a new semantic element in the model with its notation view. So, not a canonical scenario, but intended to regression-test this behaviour
+ * in a canonical context.
+ */
+ protected <T extends EObject> T createWithView(EObject owner, EClass metaclass, Class<T> type) {
+ IGraphicalEditPart editPart = requireEditPart(owner);
+ if (owner instanceof org.eclipse.uml2.uml.Package) {
+ // Package edit parts don't implement getTargetEditPart API
+ editPart = getPackageContentsCompartment(editPart);
+ }
+
+ Command command = findNodeCreationCommand(editPart, owner, metaclass);
+ assertThat("No executable command provided to create " + label(metaclass), command, notNullValue());
+ execute(command);
+
+ return getNewObject(command, type);
+ }
+
+ private Command findNodeCreationCommand(EditPart editPart, EObject owner, EClass metaclass) {
+ Command result = null;
+
+ for (IElementType next : getClassDiagramElementTypes(metaclass)) {
+ Command command = getNodeCreationCommand(editPart, owner, next);
+ if ((command != null) && command.canExecute()) {
+ result = command;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ private Command getNodeCreationCommand(EditPart editPart, EObject owner, IElementType elementType) {
+ CreateElementRequestAdapter adapter = new CreateElementRequestAdapter(new CreateElementRequest(owner, elementType));
+ String hint = (elementType instanceof IHintedType) ? ((IHintedType) elementType).getSemanticHint() : null;
+ CreateViewAndElementRequest.ViewAndElementDescriptor descriptor = new CreateViewAndElementRequest.ViewAndElementDescriptor(adapter, Node.class, hint, editor.getPreferencesHint());
+ CreateViewAndElementRequest request = new CreateViewAndElementRequest(descriptor);
+
+ EditPart targetEditPart = editPart.getTargetEditPart(request);
+ return targetEditPart.getCommand(request);
+ }
+
+ private List<? extends IElementType> getClassDiagramElementTypes(EClass metaclass) {
+ List<IElementType> result = Lists.newArrayListWithExpectedSize(3);
+ IElementType base = ElementTypeRegistry.getInstance().getElementType(metaclass, ElementTypeUtils.getEditContext());
+
+ // Filter for class diagram types matching the exact metaclass (e.g., no Usage for Dependency or Port for Property)
+ for (IElementType next : ElementTypeRegistry.getInstance().getSpecializationsOf(base.getId())) {
+ if ((next.getEClass() == metaclass) && UMLElementTypes.isKnownElementType(next)) {
+ result.add(next);
+ }
+ }
+
+ return result;
+ }
+
+ private <T extends EObject> T getNewObject(Command command, Class<T> type) {
+ Iterator<ICommandProxy> proxies = Iterators.filter(leafCommands(command), ICommandProxy.class);
+
+ Object adapter = Iterators.find(Iterators.transform(proxies, new Function<ICommandProxy, Object>() {
+ @Override
+ public Object apply(ICommandProxy input) {
+ CommandResult result = input.getICommand().getCommandResult();
+ Object resultValue = (result == null) ? null : result.getReturnValue();
+ if (resultValue instanceof Iterable<?>) {
+ for (Object next : (Iterable<?>) resultValue) {
+ resultValue = AdapterUtils.adapt(next, EObject.class, null);
+ if (resultValue != null) {
+ break;
+ }
+ }
+ } else {
+ resultValue = AdapterUtils.adapt(resultValue, EObject.class, null);
+ }
+ return resultValue;
+ }
+ }), Predicates.notNull());
+
+ T result;
+
+ EObject eObject = AdapterUtils.adapt(adapter, EObject.class, null);
+ if (eObject instanceof View) {
+ result = type.cast(((View) eObject).getElement());
+ } else {
+ result = type.cast(eObject);
+ }
+
+ return result;
+ }
+
+ private Iterator<Command> leafCommands(Command command) {
+ return new AbstractTreeIterator<Command>(command, true) {
+ private static final long serialVersionUID = 1L;
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected Iterator<? extends Command> getChildren(Object object) {
+ if (object instanceof CompoundCommand) {
+ return ((Iterable<? extends Command>) ((CompoundCommand) object).getCommands()).iterator();
+ } else {
+ return Collections.emptyIterator();
+ }
+ }
+ };
+ }
+
+ /**
+ * Adds a new association to the model, which is slightly more complex than owned directed relationships.
+ * Relies on canonical edit policy to create the notation view.
+ */
+ protected Dependency addDependency(final NamedElement client, final NamedElement supplier) {
+ return execute(new Callable<Dependency>() {
+
+ @Override
+ public Dependency call() throws Exception {
+ return client.createDependency(supplier);
+ }
+ });
+ }
+
+ /**
+ * Adds a new association to the model, which is more complex than owned directed relationships.
+ * Relies on canonical edit policy to create the notation view.
+ */
+ protected Association addAssociation(final Type end1, final Type end2) {
+ return execute(new Callable<Association>() {
+
+ @Override
+ public Association call() throws Exception {
+ String end1Name = end2.getName().substring(0, 1).toLowerCase() + end2.getName().substring(1);
+ String end2Name = end1.getName().substring(0, 1).toLowerCase() + end1.getName().substring(1);
+ return end1.createAssociation(true, AggregationKind.NONE_LITERAL, end1Name, 0, 1, end2,
+ false, AggregationKind.NONE_LITERAL, end2Name, 0, LiteralUnlimitedNatural.UNLIMITED);
+ }
+ });
+ }
+
+ /**
+ * Creates a new dependency in the model with its notation view. So, not a canonical scenario, but intended to regression-test this behaviour
+ * in a canonical context.
+ */
+ protected Dependency createDependencyWithView(NamedElement client, NamedElement supplier) {
+ EditPart sourceEditPart = requireEditPart(client);
+ EditPart targetEditPart = requireEditPart(supplier);
+
+ Command command = findConnectionCreationCommand(sourceEditPart, targetEditPart, UMLPackage.Literals.DEPENDENCY);
+
+ assertThat("No executable command provided to create dependency", command, notNullValue());
+ execute(command);
+
+ return getNewObject(command, Dependency.class);
+ }
+
+ private Command findConnectionCreationCommand(EditPart sourceEditPart, EditPart targetEditPart, EClass metaclass) {
+ Command result = null;
+
+ for (IElementType next : getClassDiagramElementTypes(metaclass)) {
+ Command command = getConnectionCreationCommand(sourceEditPart, targetEditPart, next);
+ if ((command != null) && command.canExecute()) {
+ result = command;
+ break;
+ }
+ }
+
+ return result;
+ }
+
+ private Command getConnectionCreationCommand(EditPart sourceEditPart, EditPart targetEditPart, IElementType elementType) {
+ Command result = null;
+
+ String hint = (elementType instanceof IHintedType) ? ((IHintedType) elementType).getSemanticHint() : null;
+ // Don't attempt to create relationship "nodes" like the DependencyNode or AssociationNode
+ if ((hint != null) && Integer.parseInt(hint) >= 4000) {
+ CreateConnectionViewAndElementRequest request = new CreateConnectionViewAndElementRequest(elementType, hint, editor.getPreferencesHint());
+ request.setType(RequestConstants.REQ_CONNECTION_START);
+ request.setLocation(new Point(0, 0));
+
+ Command command = sourceEditPart.getCommand(request);
+ if ((command != null) && command.canExecute()) {
+ request.setSourceEditPart(sourceEditPart);
+ request.setTargetEditPart(targetEditPart);
+ request.setType(RequestConstants.REQ_CONNECTION_END);
+ request.setLocation(new Point(0, 0));
+
+ result = targetEditPart.getCommand(request);
+ }
+ }
+
+ return result;
+ }
+
+ /**
+ * Simply removes a semantic {@code element} from the model.
+ * Relies on canonical edit policy to remove the notation view.
+ */
+ protected void remove(EObject element) {
+ execute(RemoveCommand.create(editor.getEditingDomain(), element.eContainer(), element.eContainmentFeature(), element));
+ }
+
+ /**
+ * Uses the edit-service {@linkplain #DestroyElementRequest destroy} command to effect deletion of the semantic {@code element} and all of its views. So, not a canonical scenario, but intended to regression-test this behaviour
+ * in a canonical context.
+ */
+ protected void removeWithView(EObject element) {
+ IElementEditService service = ElementEditServiceUtils.getCommandProvider(element.eContainer());
+ ICommand command = service.getEditCommand(new DestroyElementRequest(element, false));
+ assertThat("No command provided to delete " + label(element), command, notNullValue());
+ assertThat("Cannot execute command to delete " + label(element), command.canExecute(), is(true));
+ execute(command);
+ }
+
+ protected void delete(EditPart editPart) {
+ Command command = editPart.getCommand(new GroupRequest(RequestConstants.REQ_DELETE));
+ assertThat("No view deletion command provided", command, notNullValue());
+ assertThat("Cannot execute view deletion command", command.canExecute(), is(true));
+ execute(command);
+ }
+
+ protected String label(EObject object) {
+ String result;
+
+ if (object instanceof ENamedElement) {
+ result = ((UMLUtil.getQualifiedName((ENamedElement) object, NamedElement.SEPARATOR)));
+ } else {
+ IItemLabelProvider labels = (IItemLabelProvider) adapterFactory.adapt(object, IItemLabelProvider.class);
+ result = (labels == null) ? String.valueOf(object) : labels.getText(object);
+ }
+
+ return result;
+ }
+
+ protected View getView(EObject object) {
+ IGraphicalEditPart editPart = getEditPart(object);
+ if (editPart == null) {
+ // Maybe it's an edge
+ editPart = getConnectionEditPart(object);
+ }
+ return (editPart == null) ? null : editPart.getNotationView();
+ }
+
+ protected View requireView(EObject object) {
+ View result = getView(object);
+ assertThat("No view for " + label(object), result, notNullValue());
+ return result;
+ }
+
+ protected void assertNoView(EObject object) {
+ View view = getView(object);
+ assertThat("View exists for " + label(object), view, nullValue());
+ }
+
+ protected Map<EObject, View> getViews(Iterable<? extends EObject> objects) {
+ Map<EObject, View> result = Maps.newHashMap();
+
+ for (EObject object : objects) {
+ IGraphicalEditPart editPart = getEditPart(object);
+ if (editPart == null) {
+ // Maybe it's an edge
+ editPart = getConnectionEditPart(object);
+ }
+ if ((editPart != null) && (editPart.getNotationView() != null)) {
+ result.put(object, editPart.getNotationView());
+ }
+ }
+
+ return result;
+ }
+
+ protected Map<EObject, View> getViews(EObject first, EObject second, EObject... rest) {
+ return getViews(Lists.asList(first, second, rest));
+ }
+
+ protected Map<EObject, View> requireViews(Iterable<? extends EObject> objects) {
+ Map<EObject, View> result = Maps.newHashMap();
+
+ for (EObject object : objects) {
+ result.put(object, requireView(object));
+ }
+
+ return result;
+ }
+
+ protected Map<EObject, View> requireViews(EObject first, EObject second, EObject... rest) {
+ return requireViews(Lists.asList(first, second, rest));
+ }
+
+ protected void assertNoViews(Iterable<? extends EObject> objects) {
+ Map<EObject, View> views = getViews(objects);
+
+ if (!views.isEmpty()) {
+ fail("View exists for " + label(Iterables.getFirst(views.keySet(), null)));
+ }
+ }
+
+ protected void assertNoViews(EObject first, EObject second, EObject... rest) {
+ assertNoViews(Lists.asList(first, second, rest));
+ }
+
+ protected void assertAttached(EObject element) {
+ assertThat("Model does not contain " + label(element), element.eResource(), notNullValue());
+ }
+
+ protected void assertAttached(Iterable<? extends EObject> elements) {
+ for (EObject next : elements) {
+ assertAttached(next);
+ }
+ }
+
+ protected void assertAttached(EObject first, EObject second, EObject... rest) {
+ assertAttached(Lists.asList(first, second, rest));
+ }
+
+ protected void assertDetached(EObject element) {
+ assertThat("Model must not contain " + label(element), element.eResource(), nullValue());
+ }
+
+ protected void assertDetached(Iterable<? extends EObject> elements) {
+ for (EObject next : elements) {
+ assertDetached(next);
+ }
+ }
+
+ protected void assertDetached(EObject first, EObject second, EObject... rest) {
+ assertDetached(Lists.asList(first, second, rest));
+ }
+
+ //
+ // Nested types
+ //
+
+ @Retention(RetentionPolicy.RUNTIME)
+ @Target({ ElementType.TYPE, ElementType.METHOD })
+ protected @interface NeedsUIEvents {
+ // Empty
+ }
+
+ private class AnnotationRule extends TestWatcher {
+ @Override
+ protected void starting(Description description) {
+ needUIEvents = JUnitUtils.getAnnotation(description, NeedsUIEvents.class) != null;
+ }
+ }
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AllTests.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AllTests.java
new file mode 100644
index 00000000000..6c6b76c39d2
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/AllTests.java
@@ -0,0 +1,40 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+/**
+ * Test suite for the {@code org.eclipse.papyrus.infra.gmfdiag.canonical} plug-in.
+ */
+@RunWith(Suite.class)
+@SuiteClasses({
+ BasicCanonicalClassDiagramTest.class,
+ CanonicalStateInClassDiagramTest.class,
+ EditingInModelInClassDiagramTest.class,
+ CanonicalViewDeletionInClassDiagramTest.class,
+ EditingInClassDiagramRegressionTest.class,
+ CSSCanonicalClassDiagramTest.class,
+ CSSCanonicalStateInClassDiagramTest.class,
+ CSSExternalStylesheetInClassDiagramTest.class,
+ CSSCanonicalCompositeDiagramTest.class })
+public class AllTests {
+
+ public AllTests() {
+ super();
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/BasicCanonicalClassDiagramTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/BasicCanonicalClassDiagramTest.java
new file mode 100644
index 00000000000..8b870a1df8a
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/BasicCanonicalClassDiagramTest.java
@@ -0,0 +1,136 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Usage;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests the presentation of canonical content in a class diagram that has persisted
+ * the canonical style on various views.
+ */
+@PluginResource("models/classdiagram_canonical.di")
+@ActiveDiagram("canonical")
+public class BasicCanonicalClassDiagramTest extends AbstractCanonicalTest {
+
+ private org.eclipse.uml2.uml.Class foo;
+ private Property foo_ok;
+ private Operation foo_doit;
+ private org.eclipse.uml2.uml.Class foo_nested;
+ private org.eclipse.uml2.uml.Class bar;
+ private org.eclipse.uml2.uml.Class super_;
+ private Enumeration yesno;
+ private EnumerationLiteral yesno_no;
+ private EnumerationLiteral yesno_yes;
+
+ private Association foo_bar;
+ private Generalization bar_super;
+ private Usage super_yesno;
+
+ private org.eclipse.uml2.uml.Package types;
+ private org.eclipse.uml2.uml.Class types_subfoo;
+ private Property types_subfoo_createdon;
+ private DataType types_date;
+
+ private Generalization types_subfoo_foo;
+ private ElementImport types_foo;
+ private ElementImport types_bar;
+ private Dependency types_subfoo_date;
+
+ public BasicCanonicalClassDiagramTest() {
+ super();
+ }
+
+ @Test
+ public void canonicalNodesInClassDiagram() {
+ requireView(foo_ok);
+ requireView(foo_doit);
+ requireView(foo_nested);
+
+ requireView(yesno_no);
+ requireView(yesno_yes);
+
+ requireView(types_subfoo);
+ requireView(types_date);
+ }
+
+ @Test
+ public void noCanonicalViewInCanonicalView() {
+ assertNoView(types_subfoo_createdon);
+ }
+
+ @Test
+ public void canonicalEdgesInClassDiagram() {
+ requireView(foo_bar);
+ requireView(bar_super);
+ requireView(super_yesno);
+
+ requireView(types_foo);
+ requireView(types_bar);
+ }
+
+ @Test
+ public void noCanonicalEdgeOnCanonicalView() {
+ // This is an edge on a synchronized view (and an unsynchronized view)
+ requireView(types_subfoo_foo);
+
+ // This is an edge between two unsynchronized views
+ assertNoView(types_subfoo_date);
+ }
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void getModelElements() {
+ org.eclipse.uml2.uml.Package root = editor.getModel();
+ foo = (org.eclipse.uml2.uml.Class) root.getOwnedType("Foo");
+ foo_ok = foo.getOwnedAttribute("ok", null);
+ foo_doit = foo.getOwnedOperation("doIt", null, null);
+ foo_nested = (org.eclipse.uml2.uml.Class) foo.getNestedClassifier("Nested");
+ bar = (org.eclipse.uml2.uml.Class) root.getOwnedType("Bar");
+ super_ = (org.eclipse.uml2.uml.Class) root.getOwnedType("Super");
+ yesno = (Enumeration) root.getOwnedType("YesNo");
+ yesno_no = yesno.getOwnedLiteral("no");
+ yesno_yes = yesno.getOwnedLiteral("yes");
+
+ foo_bar = foo.getOwnedAttribute("bar", null).getAssociation();
+ bar_super = bar.getGeneralization(super_);
+ super_yesno = getRelationship(super_, yesno, Usage.class);
+
+ types = root.getNestedPackage("types");
+ types_subfoo = (org.eclipse.uml2.uml.Class) types.getOwnedType("SubFoo");
+ types_subfoo_createdon = types_subfoo.getOwnedAttribute("createdOn", null);
+ types_date = (DataType) types.getOwnedType("Date");
+
+ types_subfoo_foo = types_subfoo.getGeneralization(foo);
+ types_subfoo_date = getRelationship(types_subfoo, types_date, Dependency.class);
+ types_foo = types.getElementImport(foo);
+ types_bar = types.getElementImport(bar);
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalClassDiagramTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalClassDiagramTest.java
new file mode 100644
index 00000000000..d39d574ea91
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalClassDiagramTest.java
@@ -0,0 +1,132 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Usage;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests the presentation of canonical content in a class diagram that has implied
+ * the canonical style via CSS stylesheets.
+ */
+@PluginResource("models/classdiagram_css.di")
+@ActiveDiagram("canonical")
+public class CSSCanonicalClassDiagramTest extends AbstractCSSCanonicalTest {
+
+ private org.eclipse.uml2.uml.Class foo;
+ private Property foo_ok;
+ private Operation foo_doit;
+ private org.eclipse.uml2.uml.Class foo_nested;
+ private org.eclipse.uml2.uml.Class bar;
+ private org.eclipse.uml2.uml.Class super_;
+ private Enumeration yesno;
+ private EnumerationLiteral yesno_no;
+ private EnumerationLiteral yesno_yes;
+
+ private Association foo_bar;
+ private Generalization bar_super;
+ private Usage super_yesno;
+
+ private org.eclipse.uml2.uml.Package types;
+ private org.eclipse.uml2.uml.Class types_subfoo;
+ private Property types_subfoo_createdon;
+ private DataType types_date;
+
+ private Generalization types_subfoo_foo;
+ private ElementImport types_foo;
+ private ElementImport types_bar;
+
+ public CSSCanonicalClassDiagramTest() {
+ super();
+ }
+
+ @Test
+ public void canonicalNodesByMetaclassSelectorInClassDiagram() {
+ requireView(foo_ok);
+ requireView(foo_doit);
+ requireView(foo_nested);
+
+ requireView(yesno_no);
+ requireView(yesno_yes);
+ }
+
+ @Test
+ public void canonicalNodesByExplicitStyleClassInClassDiagram() {
+ requireView(types_subfoo);
+ requireView(types_date);
+ }
+
+ @Test
+ public void nestedCanonicalNodesByMetaclassSelectorInCanonicalView() {
+ requireView(types_subfoo_createdon);
+ }
+
+ @Test
+ public void canonicalEdgesInClassDiagram() {
+ requireView(foo_bar);
+ requireView(bar_super);
+ requireView(super_yesno);
+
+ requireView(types_foo);
+ requireView(types_bar);
+ }
+
+ @Test
+ public void nestedCanonicalEdgesInCanonicalView() {
+ requireView(types_subfoo_foo);
+ }
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void getModelElements() {
+ org.eclipse.uml2.uml.Package root = editor.getModel();
+ foo = (org.eclipse.uml2.uml.Class) root.getOwnedType("Foo");
+ foo_ok = foo.getOwnedAttribute("ok", null);
+ foo_doit = foo.getOwnedOperation("doIt", null, null);
+ foo_nested = (org.eclipse.uml2.uml.Class) foo.getNestedClassifier("Nested");
+ bar = (org.eclipse.uml2.uml.Class) root.getOwnedType("Bar");
+ super_ = (org.eclipse.uml2.uml.Class) root.getOwnedType("Super");
+ yesno = (Enumeration) root.getOwnedType("YesNo");
+ yesno_no = yesno.getOwnedLiteral("no");
+ yesno_yes = yesno.getOwnedLiteral("yes");
+
+ foo_bar = foo.getOwnedAttribute("bar", null).getAssociation();
+ bar_super = bar.getGeneralization(super_);
+ super_yesno = getRelationship(super_, yesno, Usage.class);
+
+ types = root.getNestedPackage("types");
+ types_subfoo = (org.eclipse.uml2.uml.Class) types.getOwnedType("SubFoo");
+ types_subfoo_createdon = types_subfoo.getOwnedAttribute("createdOn", null);
+ types_date = (DataType) types.getOwnedType("Date");
+
+ types_subfoo_foo = types_subfoo.getGeneralization(foo);
+ types_foo = types.getElementImport(foo);
+ types_bar = types.getElementImport(bar);
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalCompositeDiagramTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalCompositeDiagramTest.java
new file mode 100644
index 00000000000..304a3cd6a08
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalCompositeDiagramTest.java
@@ -0,0 +1,133 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.Map;
+
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Connector;
+import org.eclipse.uml2.uml.Port;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests the CSS-based canonical presentation of composite structures.
+ */
+@PluginResource("models/composite.di")
+@ActiveDiagram("main")
+public class CSSCanonicalCompositeDiagramTest extends AbstractCSSCanonicalTest {
+
+ private org.eclipse.uml2.uml.Class blackBox;
+ private Property blackBox_nested;
+ private Port blackBox_output;
+ private Connector blackBox_delegateToBlueBox;
+
+ private org.eclipse.uml2.uml.Class blueBox;
+ private Property blueBox_nested;
+ private Port blueBox_output;
+
+ public CSSCanonicalCompositeDiagramTest() {
+ super();
+ }
+
+ /**
+ * Tests that recursive structures are "safe" in a fully canonical presentation (that they
+ * do not induce unbounded recursion in creation of nested visuals).
+ */
+ @CSSResource("models/compositediagram.css")
+ @NeedsUIEvents
+ @Test
+ public void recursiveStructureCanonical() {
+ Map<EObject, View> views = requireViews(blackBox_nested, blackBox_output, blueBox_nested, blueBox_output, blackBox_delegateToBlueBox);
+
+ // The blueBox part in the blackBox structure shows nested structure
+ requireView(blueBox_nested, views.get(blackBox_nested));
+ requireView(blueBox_output, views.get(blackBox_nested));
+
+ // But, the blackBox part nested inside of the blueBox part in the blackBox structure
+ // does not show recursive structure
+ assertNoView(blackBox_nested, views.get(blueBox_nested));
+ assertNoView(blackBox_output, views.get(blueBox_nested));
+
+ // All ports show the connectors that they should
+ View blackBoxPortView = requireView(blackBox_output, requireView(blackBox));
+ assertThat("Wrong number of edges attached to class's port", blackBoxPortView.getSourceEdges().size() + blackBoxPortView.getTargetEdges().size(), is(1));
+ View blueBoxPortView = requireView(blueBox_output, requireView(blackBox_nested));
+ assertThat("Wrong number of edges attached to part's port", blueBoxPortView.getSourceEdges().size() + blueBoxPortView.getTargetEdges().size(), is(1));
+ }
+
+ /**
+ * Tests that parts and connectors added to a composite structure are correctly reflected
+ * in the diagram.
+ */
+ @CSSResource("models/compositediagram.css")
+ @NeedsUIEvents
+ @Test
+ public void addPartAndConnector() {
+ // Create a new part and a connector between it and the existing part
+ final Property otherBox = UMLFactory.eINSTANCE.createProperty();
+ otherBox.setName("otherBox");
+ otherBox.setType(blueBox);
+
+ final Connector assembly = UMLFactory.eINSTANCE.createConnector();
+ assembly.createEnd().setRole(blackBox_nested);
+ assembly.createEnd().setRole(otherBox);
+
+ add(blackBox, otherBox, UMLPackage.Literals.STRUCTURED_CLASSIFIER__OWNED_ATTRIBUTE);
+ add(blackBox, assembly, UMLPackage.Literals.STRUCTURED_CLASSIFIER__OWNED_CONNECTOR);
+
+ // Views should have been created for these new things
+ Map<EObject, View> newViews = requireViews(otherBox, assembly);
+ View otherPartView = newViews.get(otherBox);
+
+ // And the new part of BlueBox type also has canonical contents (because of the CSS stylesheet)
+ requireView(blueBox_nested, otherPartView);
+ View otherPartPortView = requireView(blueBox_output, otherPartView);
+
+ // All ports show the connectors that they should
+ View blackBoxPortView = requireView(blackBox_output, requireView(blackBox));
+ assertThat("Wrong number of edges attached to class's port", blackBoxPortView.getSourceEdges().size() + blackBoxPortView.getTargetEdges().size(), is(1));
+ View blueBoxPortView = requireView(blueBox_output, requireView(blackBox_nested));
+ assertThat("Wrong number of edges attached to part's port", blueBoxPortView.getSourceEdges().size() + blueBoxPortView.getTargetEdges().size(), is(1));
+
+ // This one has none, of course, because we haven't connected to this part via this port
+ assertThat("Wrong number of edges attached to otherPart's port", otherPartPortView.getSourceEdges().size() + otherPartPortView.getTargetEdges().size(), is(0));
+ }
+
+ //
+ // Test framework
+ //
+ @Before
+ public void getModelElements() {
+ org.eclipse.uml2.uml.Package root = editor.getModel();
+ blackBox = (org.eclipse.uml2.uml.Class) root.getOwnedType("BlackBox");
+ blackBox_nested = blackBox.getOwnedAttribute("nested", null);
+ blackBox_output = blackBox.getOwnedPort("output", null);
+ blackBox_delegateToBlueBox = blackBox.getOwnedConnector("delegateToBlueBox");
+
+ blueBox = (org.eclipse.uml2.uml.Class) root.getOwnedType("BlueBox");
+ blueBox_nested = blueBox.getOwnedAttribute("nested", null);
+ blueBox_output = blueBox.getOwnedPort("output", null);
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalStateInClassDiagramTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalStateInClassDiagramTest.java
new file mode 100644
index 00000000000..ed18d8640dc
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSCanonicalStateInClassDiagramTest.java
@@ -0,0 +1,233 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Usage;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests the manipulation of canonical state in various views by CSS in a class diagram
+ * that has not persisted the canonical style on anything.
+ */
+@PluginResource("models/classdiagram_css.di")
+@ActiveDiagram("default")
+public class CSSCanonicalStateInClassDiagramTest extends AbstractCSSCanonicalTest {
+
+ private org.eclipse.uml2.uml.Class foo;
+ private Property foo_ok;
+ private Operation foo_doit;
+ private org.eclipse.uml2.uml.Class foo_nested;
+ private org.eclipse.uml2.uml.Class bar;
+ private org.eclipse.uml2.uml.Class super_;
+ private Enumeration yesno;
+ private EnumerationLiteral yesno_no;
+ private EnumerationLiteral yesno_yes;
+
+ private Association foo_bar;
+ private Generalization bar_super;
+ private Usage super_yesno;
+
+ private org.eclipse.uml2.uml.Package types;
+ private org.eclipse.uml2.uml.Class types_subfoo;
+ private Property types_subfoo_createdon;
+ private DataType types_date;
+
+ private Generalization types_subfoo_foo;
+ private ElementImport types_foo;
+ private ElementImport types_bar;
+
+ public CSSCanonicalStateInClassDiagramTest() {
+ super();
+ }
+
+ @Test
+ public void controlTestForNothingCanonical() {
+ // Nodes
+ assertNoViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes,
+ types_subfoo, types_date);
+
+ // Edges
+ assertNoViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar);
+ }
+
+ @Test
+ public void addStylesheet() {
+ referenceEmbeddedStylesheet("canonical_styles");
+
+ // Nodes
+ requireViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes);
+
+ // Edges
+ requireViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar);
+
+ // These require an explicit style on the package
+ assertNoViews(types_subfoo_createdon, types_subfoo_foo);
+ }
+
+ @Test
+ public void addStylesheet_undo() {
+ referenceEmbeddedStylesheet("canonical_styles");
+
+ undo();
+
+ // Nodes
+ assertNoViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes);
+
+ // Edges
+ assertNoViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar);
+ }
+
+ @Test
+ public void addStylesheet_redo() {
+ referenceEmbeddedStylesheet("canonical_styles");
+
+ undo();
+ redo();
+
+ // Nodes
+ requireViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes);
+
+ // Edges
+ requireViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar);
+
+ // These require an explicit style on the package
+ assertNoViews(types_subfoo_createdon, types_subfoo_foo);
+ }
+
+ @StylesheetRef("canonical_styles")
+ @Test
+ public void addStyleClass() {
+ addStyleClass(requireView(types), "synch");
+
+ // Nodes
+ requireViews(types_subfoo, types_date,
+ types_subfoo_createdon);
+
+ // Edges
+ requireView(types_subfoo_foo);
+ }
+
+ @StylesheetRef("canonical_styles")
+ @Test
+ public void addStyleClass_undo() {
+ addStyleClass(requireView(types), "synch");
+
+ undo();
+
+ // Nodes
+ assertNoViews(types_subfoo, types_date,
+ types_subfoo_createdon);
+
+ // Edges
+ assertNoView(types_subfoo_foo);
+ }
+
+ @StylesheetRef("canonical_styles")
+ @Test
+ public void addStyleClass_redo() {
+ addStyleClass(requireView(types), "synch");
+
+ undo();
+ redo();
+
+ // Nodes
+ requireViews(types_subfoo, types_date,
+ types_subfoo_createdon);
+
+ // Edges
+ requireView(types_subfoo_foo);
+ }
+
+ @StylesheetRef("canonical_styles")
+ @Test
+ public void overrideSelectorRule() {
+ // Override the canonical style
+ setCanonical(false, requireEditPart(foo));
+
+ // Delete some child views that were created canonically
+ delete(requireEditPart(foo_ok));
+ delete(requireEditPart(foo_doit));
+ delete(requireEditPart(foo_nested));
+
+ // The elements still exist (no canonical synch)
+ assertAttached(foo_ok, foo_doit, foo_nested);
+ }
+
+ @StylesheetRef("canonical_styles")
+ @Test
+ public void overrideExplicitClassRule() {
+ addStyleClass(requireView(types), "synch");
+
+ // Override the canonical style
+ setCanonical(false, requireEditPart(types));
+
+ // Delete some child views that were created canonically
+ delete(requireEditPart(types_subfoo));
+ delete(requireEditPart(types_date));
+
+ // The elements still exist (no canonical synch)
+ assertAttached(types_subfoo, types_date);
+ }
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void getModelElements() {
+ org.eclipse.uml2.uml.Package root = editor.getModel();
+ foo = (org.eclipse.uml2.uml.Class) root.getOwnedType("Foo");
+ foo_ok = foo.getOwnedAttribute("ok", null);
+ foo_doit = foo.getOwnedOperation("doIt", null, null);
+ foo_nested = (org.eclipse.uml2.uml.Class) foo.getNestedClassifier("Nested");
+ bar = (org.eclipse.uml2.uml.Class) root.getOwnedType("Bar");
+ super_ = (org.eclipse.uml2.uml.Class) root.getOwnedType("Super");
+ yesno = (Enumeration) root.getOwnedType("YesNo");
+ yesno_no = yesno.getOwnedLiteral("no");
+ yesno_yes = yesno.getOwnedLiteral("yes");
+
+ foo_bar = foo.getOwnedAttribute("bar", null).getAssociation();
+ bar_super = bar.getGeneralization(super_);
+ super_yesno = getRelationship(super_, yesno, Usage.class);
+
+ types = root.getNestedPackage("types");
+ types_subfoo = (org.eclipse.uml2.uml.Class) types.getOwnedType("SubFoo");
+ types_subfoo_createdon = types_subfoo.getOwnedAttribute("createdOn", null);
+ types_date = (DataType) types.getOwnedType("Date");
+
+ types_subfoo_foo = types_subfoo.getGeneralization(foo);
+ types_foo = types.getElementImport(foo);
+ types_bar = types.getElementImport(bar);
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSExternalStylesheetInClassDiagramTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSExternalStylesheetInClassDiagramTest.java
new file mode 100644
index 00000000000..4c762e8bed2
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CSSExternalStylesheetInClassDiagramTest.java
@@ -0,0 +1,195 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.io.ByteArrayInputStream;
+
+import org.eclipse.emf.common.util.WrappedException;
+import org.eclipse.papyrus.infra.gmfdiag.canonical.tests.AbstractCSSCanonicalTest.CSSResource;
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.common.base.Charsets;
+
+/**
+ * Tests the manipulation of canonical state by non-transactional operations and that undo/redo
+ * maintain sanity of the diagrams.
+ */
+@PluginResource("models/classdiagram_cssext.di")
+@CSSResource("models/classdiagram.css")
+@ActiveDiagram("default")
+public class CSSExternalStylesheetInClassDiagramTest extends AbstractCSSCanonicalTest {
+
+ private org.eclipse.uml2.uml.Class foo;
+ private Property foo_ok;
+ private Operation foo_doit;
+ private org.eclipse.uml2.uml.Class foo_nested;
+ private Enumeration yesno;
+ private EnumerationLiteral yesno_no;
+ private EnumerationLiteral yesno_yes;
+
+ public CSSExternalStylesheetInClassDiagramTest() {
+ super();
+ }
+
+ @Test
+ public void editStylesheetRefresh() {
+ editStylesheetRefresh(true);
+ }
+
+ private EnumerationLiteral editStylesheetRefresh(boolean assertions) {
+ // The classes are canonical
+ if (assertions) {
+ requireViews(foo_ok, foo_doit, foo_nested);
+ }
+
+ // Add an enumeration literal
+ EnumerationLiteral yesno_maybe = UMLFactory.eINSTANCE.createEnumerationLiteral();
+ yesno_maybe.setName("maybe");
+ add(yesno, yesno_maybe, UMLPackage.Literals.ENUMERATION__OWNED_LITERAL);
+
+ // The enumeration is not yet canonically synchronized
+ if (assertions) {
+ assertNoViews(yesno_no, yesno_yes, yesno_maybe);
+ }
+
+ addEnumerationRule();
+ refreshDiagram();
+
+ // The enumeration is now canonical after the non-transactional refresh
+ if (assertions) {
+ requireViews(yesno_no, yesno_yes, yesno_maybe);
+ }
+
+ return yesno_maybe;
+ }
+
+ @Test
+ public void editStylesheetRefresh_undo() {
+ EnumerationLiteral yesno_maybe = editStylesheetRefresh(false);
+ assertThat(yesno_maybe, notNullValue());
+
+ // Revert the stylesheet resource and refresh
+ revertStylesheet();
+ refreshDiagram();
+
+ // Undo creation of the new literal
+ undo();
+
+ assertDetached(yesno_maybe);
+
+ // No view any longer
+ assertNoView(yesno_maybe);
+
+ // And only two enumeration literal views in the compartment
+ assertThat(getEnumerationLiteralCompartment(requireEditPart(yesno)).getChildren().size(), is(2));
+ }
+
+ @Test
+ public void editStylesheetRefresh_redo() {
+ EnumerationLiteral yesno_maybe = editStylesheetRefresh(false);
+ assertThat(yesno_maybe, notNullValue());
+
+ // Revert the stylesheet resource and refresh
+ revertStylesheet();
+ refreshDiagram();
+
+ // Undo and redo creation of the new literal
+ undo();
+ redo();
+
+ assertAttached(yesno_maybe);
+
+ // No view any longer
+ assertNoView(yesno_maybe);
+ }
+
+ /**
+ * Verify that correctly handling of undo creation of semantic element that was presented canonically
+ * after the canonical edit policy is deactivated doesn't depend on the same edit part managing the
+ * view as before.
+ */
+ @Test
+ public void editStylesheetRefresh_closeReopenDiagram_undo() {
+ EnumerationLiteral yesno_maybe = editStylesheetRefresh(false);
+ assertThat(yesno_maybe, notNullValue());
+
+ // Revert the stylesheet resource and refresh
+ revertStylesheet();
+ refreshDiagram();
+
+ // Close the diagram and re-open it
+ String diagramName = editor.closeDiagram();
+ editor.openDiagram(diagramName);
+
+ // The view is still there, of course, but it would have a new edit part
+
+
+ // Undo creation of the new literal
+ undo();
+
+ assertDetached(yesno_maybe);
+
+ // No view any longer
+ assertNoView(yesno_maybe);
+
+ // And only two enumeration literal views in the compartment
+ assertThat(getEnumerationLiteralCompartment(requireEditPart(yesno)).getChildren().size(), is(2));
+ }
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void getModelElements() {
+ org.eclipse.uml2.uml.Package root = editor.getModel();
+ foo = (org.eclipse.uml2.uml.Class) root.getOwnedType("Foo");
+ foo_ok = foo.getOwnedAttribute("ok", null);
+ foo_doit = foo.getOwnedOperation("doIt", null, null);
+ foo_nested = (org.eclipse.uml2.uml.Class) foo.getNestedClassifier("Nested");
+ yesno = (Enumeration) root.getOwnedType("YesNo");
+ yesno_no = yesno.getOwnedLiteral("no");
+ yesno_yes = yesno.getOwnedLiteral("yes");
+ }
+
+ protected void addEnumerationRule() {
+ try {
+ ByteArrayInputStream bais = new ByteArrayInputStream(String.format("%nEnumeration {%n canonical: true;%n}%n").getBytes(Charsets.UTF_8));
+ cssFile.appendContents(bais, false, true, null);
+ } catch (Exception e) {
+ throw new WrappedException(e);
+ }
+ }
+
+ protected void revertStylesheet() {
+ try {
+ cssFile.setContents(cssFile.getHistory(null)[0], false, true, null);
+ } catch (Exception e) {
+ throw new WrappedException(e);
+ }
+ }
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CanonicalStateInClassDiagramTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CanonicalStateInClassDiagramTest.java
new file mode 100644
index 00000000000..4140c3510dd
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CanonicalStateInClassDiagramTest.java
@@ -0,0 +1,193 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.Usage;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests the manipulation of canonical state in various views in a class diagram that has not persisted
+ * the canonical style on anything.
+ */
+@PluginResource("models/classdiagram_canonical.di")
+@ActiveDiagram("default")
+public class CanonicalStateInClassDiagramTest extends AbstractCanonicalTest {
+
+ private org.eclipse.uml2.uml.Class foo;
+ private Property foo_ok;
+ private Operation foo_doit;
+ private org.eclipse.uml2.uml.Class foo_nested;
+ private org.eclipse.uml2.uml.Class bar;
+ private org.eclipse.uml2.uml.Class super_;
+ private Enumeration yesno;
+ private EnumerationLiteral yesno_no;
+ private EnumerationLiteral yesno_yes;
+
+ private Association foo_bar;
+ private Generalization bar_super;
+ private Usage super_yesno;
+
+ private org.eclipse.uml2.uml.Package types;
+ private org.eclipse.uml2.uml.Class types_subfoo;
+ private Property types_subfoo_createdon;
+ private DataType types_date;
+
+ private Generalization types_subfoo_foo;
+ private Dependency types_subfoo_date;
+ private ElementImport types_foo;
+ private ElementImport types_bar;
+
+ public CanonicalStateInClassDiagramTest() {
+ super();
+ }
+
+ @Test
+ public void controlTestForNothingCanonical() {
+ // Nodes
+ assertNoViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes,
+ types_subfoo, types_date);
+
+ // Edges
+ assertNoViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar);
+ }
+
+ @Test
+ public void toggleCanonicalOn() {
+ setCanonical(true, foo, bar, super_, yesno, types);
+
+ // Nodes
+ requireViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes,
+ types_subfoo, types_date);
+
+ // Edges
+ requireViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar, types_subfoo_foo);
+
+ // Nested in canonical views
+ assertNoViews(types_subfoo_createdon, types_subfoo_date);
+ }
+
+ @Test
+ public void undoToggleCanonicalOn() {
+ setCanonical(true, foo, bar, super_, yesno, types);
+
+ undo();
+
+ // Nodes
+ assertNoViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes,
+ types_subfoo, types_date);
+
+ // Edges
+ assertNoViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar);
+ }
+
+ @Test
+ public void redoToggleCanonicalOn() {
+ setCanonical(true, foo, bar, super_, yesno, types);
+
+ undo();
+ redo();
+
+ // Nodes
+ requireViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes,
+ types_subfoo, types_date);
+
+ // Edges
+ requireViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar, types_subfoo_foo);
+
+ // Nested in canonical views
+ assertNoViews(types_subfoo_createdon, types_subfoo_date);
+ }
+
+ @Test
+ public void toggleCanonicalOff() {
+ setCanonical(true, foo, bar, super_, yesno, types);
+ setCanonical(false, foo, bar, super_, yesno, types);
+
+ // Nodes are still there
+ requireViews(foo_ok, foo_doit, foo_nested,
+ yesno_no, yesno_yes,
+ types_subfoo, types_date);
+
+ // Edges are still there
+ requireViews(foo_bar, bar_super, super_yesno,
+ types_foo, types_bar, types_subfoo_foo);
+
+ // Nested in canonical views never were there
+ assertNoViews(types_subfoo_createdon, types_subfoo_date);
+ }
+
+ @Test
+ public void toggleCanonicalInCanonicalNestedViews() {
+ setCanonical(true, types);
+
+ requireViews(types_subfoo, types_date);
+
+ setCanonical(true, types_subfoo, types_date);
+
+ requireViews(types_subfoo_createdon, types_subfoo_foo);
+ }
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void getModelElements() {
+ org.eclipse.uml2.uml.Package root = editor.getModel();
+ foo = (org.eclipse.uml2.uml.Class) root.getOwnedType("Foo");
+ foo_ok = foo.getOwnedAttribute("ok", null);
+ foo_doit = foo.getOwnedOperation("doIt", null, null);
+ foo_nested = (org.eclipse.uml2.uml.Class) foo.getNestedClassifier("Nested");
+ bar = (org.eclipse.uml2.uml.Class) root.getOwnedType("Bar");
+ super_ = (org.eclipse.uml2.uml.Class) root.getOwnedType("Super");
+ yesno = (Enumeration) root.getOwnedType("YesNo");
+ yesno_no = yesno.getOwnedLiteral("no");
+ yesno_yes = yesno.getOwnedLiteral("yes");
+
+ foo_bar = foo.getOwnedAttribute("bar", null).getAssociation();
+ bar_super = bar.getGeneralization(super_);
+ super_yesno = getRelationship(super_, yesno, Usage.class);
+
+ types = root.getNestedPackage("types");
+ types_subfoo = (org.eclipse.uml2.uml.Class) types.getOwnedType("SubFoo");
+ types_subfoo_createdon = types_subfoo.getOwnedAttribute("createdOn", null);
+ types_date = (DataType) types.getOwnedType("Date");
+
+ types_subfoo_foo = types_subfoo.getGeneralization(foo);
+ types_subfoo_date = getRelationship(types_subfoo, types_date, Dependency.class);
+ types_foo = types.getElementImport(foo);
+ types_bar = types.getElementImport(bar);
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CanonicalViewDeletionInClassDiagramTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CanonicalViewDeletionInClassDiagramTest.java
new file mode 100644
index 00000000000..9bdbb86e64d
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/CanonicalViewDeletionInClassDiagramTest.java
@@ -0,0 +1,185 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Operation;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests various add/delete scenarios on canonical views in the diagram, with undo and redo.
+ * These scenarios perform the equivalent of "hide element" to request deletion of the view
+ * only, but because it's canonical, the semantic element is deleted, too.
+ */
+@PluginResource("models/classdiagram_canonical.di")
+@ActiveDiagram("canonical")
+public class CanonicalViewDeletionInClassDiagramTest extends AbstractCanonicalTest {
+ private org.eclipse.uml2.uml.Package root;
+
+ private org.eclipse.uml2.uml.Class foo;
+ private Operation foo_doit;
+ private Association foo_bar;
+
+ private org.eclipse.uml2.uml.Package types;
+ private org.eclipse.uml2.uml.Class types_subfoo;
+ private Generalization types_subfoo_foo;
+
+ public CanonicalViewDeletionInClassDiagramTest() {
+ super();
+ }
+
+ @Test
+ public void deleteOperationViewFromClass() {
+ delete(requireEditPart(foo_doit));
+
+ assertDetached(foo_doit);
+ }
+
+ @Test
+ public void deleteOperationViewFromClass_undo() {
+ delete(requireEditPart(foo_doit));
+
+ undo();
+
+ requireEditPart(foo_doit);
+ assertAttached(foo_doit);
+ }
+
+ @Test
+ public void deleteOperationViewFromClass_undo_redo() {
+ delete(requireEditPart(foo_doit));
+
+ undo();
+ redo();
+
+ assertDetached(foo_doit);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteClassViewFromPackage() {
+ delete(requireEditPart(types_subfoo));
+
+ assertDetached(types_subfoo);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteClassViewFromPackage_undo() {
+ delete(requireEditPart(types_subfoo));
+
+ undo();
+
+ requireEditPart(types_subfoo);
+ assertAttached(types_subfoo);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteClassViewFromPackage_undo_redo() {
+ delete(requireEditPart(types_subfoo));
+
+ undo();
+ redo();
+
+ assertDetached(types_subfoo);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteGeneralizationViewFromClass() {
+ delete(requireConnectionEditPart(types_subfoo_foo));
+
+ assertDetached(types_subfoo_foo);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteGeneralizationViewFromClass_undo() {
+ delete(requireConnectionEditPart(types_subfoo_foo));
+
+ undo();
+
+ requireConnectionEditPart(types_subfoo_foo);
+ assertAttached(types_subfoo_foo);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteGeneralizationViewFromClass_undo_redo() {
+ delete(requireConnectionEditPart(types_subfoo_foo));
+
+ undo();
+ redo();
+
+ assertDetached(types_subfoo_foo);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteAssociationViewFromClass() {
+ delete(requireConnectionEditPart(foo_bar));
+
+ assertDetached(foo_bar);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteAssociationViewFromClass_undo() {
+ delete(requireConnectionEditPart(foo_bar));
+
+ undo();
+
+ requireConnectionEditPart(foo_bar);
+ assertAttached(foo_bar);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteAssociationViewFromClass_undo_redo() {
+ delete(requireConnectionEditPart(foo_bar));
+
+ undo();
+ redo();
+
+ assertDetached(foo_bar);
+ }
+
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void getModelElementsAndEnsureCanonicalConnections() {
+ root = editor.getModel();
+
+ foo = (org.eclipse.uml2.uml.Class) root.getOwnedType("Foo");
+ foo_doit = foo.getOwnedOperation("doIt", null, null);
+ foo_bar = foo.getOwnedAttribute("bar", null).getAssociation();
+
+ types = root.getNestedPackage("types");
+ types_subfoo = (org.eclipse.uml2.uml.Class) types.getOwnedType("SubFoo");
+ types_subfoo_foo = types_subfoo.getGeneralization(foo);
+
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_subfoo));
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/EditingInClassDiagramRegressionTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/EditingInClassDiagramRegressionTest.java
new file mode 100644
index 00000000000..e05a72b7c4d
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/EditingInClassDiagramRegressionTest.java
@@ -0,0 +1,269 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.EnumerationLiteral;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Regression tests for add/delete scenarios in the diagram using the palette tools that operate on notation
+ * and semantics together (usual non-canonical work), with undo and redo.
+ */
+@PluginResource("models/classdiagram_canonical.di")
+@ActiveDiagram("canonical")
+public class EditingInClassDiagramRegressionTest extends AbstractCanonicalTest {
+ private org.eclipse.uml2.uml.Package root;
+
+ private org.eclipse.uml2.uml.Class foo;
+ private org.eclipse.uml2.uml.Class bar;
+ private Enumeration yesno;
+ private EnumerationLiteral yesno_no;
+
+ private Association foo_bar;
+
+ private org.eclipse.uml2.uml.Package types;
+ private DataType types_date;
+
+ public EditingInClassDiagramRegressionTest() {
+ super();
+ }
+
+ @Test
+ public void createPropertyInClass() {
+ Property property = createWithView(bar, UMLPackage.Literals.PROPERTY, Property.class);
+
+ EditPart editPart = requireEditPart(property);
+ assertThat(getClassAttributeCompartment(requireEditPart(bar)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void createPropertyInClass_undo() {
+ Property property = createWithView(bar, UMLPackage.Literals.PROPERTY, Property.class);
+
+ undo();
+
+ assertNoView(property);
+ }
+
+ @Test
+ public void createPropertyInClass_undo_redo() {
+ Property property = createWithView(bar, UMLPackage.Literals.PROPERTY, Property.class);
+
+ undo();
+ redo();
+
+ EditPart editPart = requireEditPart(property);
+ assertThat(getClassAttributeCompartment(requireEditPart(bar)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void deleteLiteralInEnumeration() {
+ removeWithView(yesno_no);
+
+ assertNoView(yesno_no);
+ }
+
+ @Test
+ public void deleteLiteralInEnumeration_undo() {
+ removeWithView(yesno_no);
+
+ undo();
+
+ EditPart editPart = requireEditPart(yesno_no);
+ assertThat(getEnumerationLiteralCompartment(requireEditPart(yesno)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void deleteLiteralInEnumeration_undo_redo() {
+ removeWithView(yesno_no);
+
+ undo();
+ redo();
+
+ assertNoView(yesno_no);
+ }
+
+ @Test
+ public void createInterfaceInPackage() {
+ Interface interface_ = createWithView(types, UMLPackage.Literals.INTERFACE, Interface.class);
+
+ EditPart editPart = requireEditPart(interface_);
+ assertThat(getPackageContentsCompartment(requireEditPart(types)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void createInterfaceInPackage_undo() {
+ Interface interface_ = createWithView(types, UMLPackage.Literals.INTERFACE, Interface.class);
+
+ undo();
+
+ assertNoView(interface_);
+ }
+
+ @Test
+ public void createInterfaceInPackage_undo_redo() {
+ Interface interface_ = createWithView(types, UMLPackage.Literals.INTERFACE, Interface.class);
+
+ undo();
+ redo();
+
+ EditPart editPart = requireEditPart(interface_);
+ assertThat(getPackageContentsCompartment(requireEditPart(types)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void deleteDataTypeFromPackage() {
+ removeWithView(types_date);
+
+ assertNoView(types_date);
+ }
+
+ @Test
+ public void deleteDataTypeFromPackage_undo() {
+ removeWithView(types_date);
+
+ undo();
+
+ EditPart editPart = requireEditPart(types_date);
+ assertThat(getPackageContentsCompartment(requireEditPart(types)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void deleteDataTypeFromPackage_undo_redo() {
+ removeWithView(types_date);
+
+ undo();
+ redo();
+
+ assertNoView(types_date);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void createDependencyInClass() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_date));
+
+ Dependency dependency = createDependencyWithView(bar, types_date);
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(dependency);
+ assertThat(editPart.getSource(), is((EditPart) requireEditPart(bar)));
+ assertThat(editPart.getTarget(), is((EditPart) requireEditPart(types_date)));
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void createDependencyInClass_undo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_date));
+
+ Dependency dependency = createDependencyWithView(bar, types_date);
+
+ undo();
+
+ assertNoView(dependency);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void createDependencyInClass_undo_redo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_date));
+
+ Dependency dependency = createDependencyWithView(bar, types_date);
+
+ undo();
+ redo();
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(dependency);
+ assertThat(editPart.getSource(), is((EditPart) requireEditPart(bar)));
+ assertThat(editPart.getTarget(), is((EditPart) requireEditPart(types_date)));
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteAssociationFromClass() {
+ removeWithView(foo_bar);
+
+ assertNoView(foo_bar);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteAssociationFromClass_undo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+
+ removeWithView(foo_bar);
+
+ undo();
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(foo_bar);
+ assertThat(editPart.getSource(), is((EditPart) requireEditPart(foo)));
+ assertThat(editPart.getTarget(), is((EditPart) requireEditPart(bar)));
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void deleteAssociationFromClass_undo_redo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+
+ removeWithView(foo_bar);
+
+ undo();
+ redo();
+
+ assertNoView(foo_bar);
+ }
+
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void getModelElements() {
+ root = editor.getModel();
+
+ foo = (org.eclipse.uml2.uml.Class) root.getOwnedType("Foo");
+ bar = (org.eclipse.uml2.uml.Class) root.getOwnedType("Bar");
+ yesno = (Enumeration) root.getOwnedType("YesNo");
+ yesno_no = yesno.getOwnedLiteral("no");
+
+ foo_bar = foo.getOwnedAttribute("bar", null).getAssociation();
+
+ types = root.getNestedPackage("types");
+ types_date = (DataType) types.getOwnedType("Date");
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/EditingInModelInClassDiagramTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/EditingInModelInClassDiagramTest.java
new file mode 100644
index 00000000000..a27f7aa97bd
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/EditingInModelInClassDiagramTest.java
@@ -0,0 +1,387 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests;
+
+import static org.hamcrest.CoreMatchers.either;
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import org.eclipse.gef.ConnectionEditPart;
+import org.eclipse.gef.EditPart;
+import org.eclipse.papyrus.junit.utils.rules.ActiveDiagram;
+import org.eclipse.papyrus.junit.utils.rules.PluginResource;
+import org.eclipse.uml2.uml.Association;
+import org.eclipse.uml2.uml.DataType;
+import org.eclipse.uml2.uml.Dependency;
+import org.eclipse.uml2.uml.ElementImport;
+import org.eclipse.uml2.uml.Enumeration;
+import org.eclipse.uml2.uml.Generalization;
+import org.eclipse.uml2.uml.Interface;
+import org.eclipse.uml2.uml.Operation;
+import org.eclipse.uml2.uml.Property;
+import org.eclipse.uml2.uml.UMLFactory;
+import org.eclipse.uml2.uml.UMLPackage;
+import org.junit.Before;
+import org.junit.Test;
+
+/**
+ * Tests various add/delete/destroy scenarios on elements in the semantic model, with undo and redo.
+ */
+@PluginResource("models/classdiagram_canonical.di")
+@ActiveDiagram("canonical")
+public class EditingInModelInClassDiagramTest extends AbstractCanonicalTest {
+ private org.eclipse.uml2.uml.Package root;
+
+ private org.eclipse.uml2.uml.Class foo;
+ private Operation foo_doit;
+ private org.eclipse.uml2.uml.Class bar;
+ private org.eclipse.uml2.uml.Class super_;
+ private Enumeration yesno;
+
+ private org.eclipse.uml2.uml.Package types;
+ private org.eclipse.uml2.uml.Class types_subfoo;
+ private DataType types_date;
+
+ private Generalization types_subfoo_foo;
+
+ public EditingInModelInClassDiagramTest() {
+ super();
+ }
+
+ @Test
+ public void addPropertyToClass() {
+ Property property = UMLFactory.eINSTANCE.createProperty();
+ property.setName("newProperty");
+ property.setType(yesno);
+ add(bar, property, UMLPackage.Literals.STRUCTURED_CLASSIFIER__OWNED_ATTRIBUTE);
+
+ EditPart editPart = requireEditPart(property);
+ assertThat(getClassAttributeCompartment(requireEditPart(bar)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void addPropertyToClass_undo_redo() {
+ Property property = UMLFactory.eINSTANCE.createProperty();
+ property.setName("newProperty");
+ property.setType(yesno);
+ add(bar, property, UMLPackage.Literals.STRUCTURED_CLASSIFIER__OWNED_ATTRIBUTE);
+
+ undo();
+
+ assertNoView(property);
+
+ redo();
+
+ EditPart editPart = requireEditPart(property);
+ assertThat(getClassAttributeCompartment(requireEditPart(bar)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void removeOperationFromClass() {
+ remove(foo_doit);
+
+ assertNoView(foo_doit);
+ }
+
+ @Test
+ public void removeOperationFromClass_undo_redo() {
+ remove(foo_doit);
+
+ undo();
+
+ EditPart editPart = requireEditPart(foo_doit);
+ assertThat(getClassOperationCompartment(requireEditPart(foo)), is(editPart.getParent()));
+
+ redo();
+
+ assertNoView(foo_doit);
+ }
+
+ @Test
+ public void addInterfaceToPackage() {
+ Interface interface_ = UMLFactory.eINSTANCE.createInterface();
+ interface_.setName("IClaudius");
+ add(types, interface_, UMLPackage.Literals.PACKAGE__PACKAGED_ELEMENT);
+
+ EditPart editPart = requireEditPart(interface_);
+ assertThat(getPackageContentsCompartment(requireEditPart(types)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void addInterfaceToPackage_undo_redo() {
+ Interface interface_ = UMLFactory.eINSTANCE.createInterface();
+ interface_.setName("IClaudius");
+ add(types, interface_, UMLPackage.Literals.PACKAGE__PACKAGED_ELEMENT);
+
+ undo();
+
+ assertNoView(interface_);
+
+ redo();
+
+ EditPart editPart = requireEditPart(interface_);
+ assertThat(getPackageContentsCompartment(requireEditPart(types)), is(editPart.getParent()));
+ }
+
+ @Test
+ public void removeClassFromPackage() {
+ remove(types_subfoo);
+
+ assertNoView(types_subfoo);
+ }
+
+ @Test
+ public void removeClassFromPackage_undo_redo() {
+ remove(types_subfoo);
+
+ undo();
+
+ EditPart editPart = requireEditPart(types_subfoo);
+ assertThat(getPackageContentsCompartment(requireEditPart(types)), is(editPart.getParent()));
+
+ redo();
+
+ assertNoView(types_subfoo);
+ }
+
+ /**
+ * A relationship that is an element owned by the source (easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addElementImportToPackage() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+
+ ElementImport import_ = UMLFactory.eINSTANCE.createElementImport();
+ import_.setImportedElement(yesno);
+ add(types, import_, UMLPackage.Literals.NAMESPACE__ELEMENT_IMPORT);
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(import_);
+ assertThat(editPart.getSource(), is((EditPart) requireEditPart(types)));
+ assertThat(editPart.getTarget(), is((EditPart) requireEditPart(yesno)));
+ }
+
+ /**
+ * A relationship that is an element owned by the source (easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addElementImportToPackage_undo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+
+ ElementImport import_ = UMLFactory.eINSTANCE.createElementImport();
+ import_.setImportedElement(yesno);
+ add(types, import_, UMLPackage.Literals.NAMESPACE__ELEMENT_IMPORT);
+
+ undo();
+
+ assertNoView(import_);
+ }
+
+ /**
+ * A relationship that is an element owned by the source (easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addElementImportToPackage_undo_redo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+
+ ElementImport import_ = UMLFactory.eINSTANCE.createElementImport();
+ import_.setImportedElement(yesno);
+ add(types, import_, UMLPackage.Literals.NAMESPACE__ELEMENT_IMPORT);
+
+ undo();
+ redo();
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(import_);
+ assertThat(editPart.getSource(), is((EditPart) requireEditPart(types)));
+ assertThat(editPart.getTarget(), is((EditPart) requireEditPart(yesno)));
+ }
+
+ /**
+ * A relationship that is an element owned by neither source nor target
+ * and the construction of which doesn't alter either end (less easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addDependencyToClass() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_date));
+
+ Dependency dependency = addDependency(bar, types_date);
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(dependency);
+ assertThat(editPart.getSource(), is((EditPart) requireEditPart(bar)));
+ assertThat(editPart.getTarget(), is((EditPart) requireEditPart(types_date)));
+ }
+
+ /**
+ * A relationship that is an element owned by neither source nor target
+ * and the construction of which doesn't alter either end (less easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addDependencyToClass_undo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_date));
+
+ Dependency dependency = addDependency(bar, types_date);
+
+ undo();
+
+ assertNoView(dependency);
+ }
+
+ /**
+ * A relationship that is an element owned by neither source nor target
+ * and the construction of which doesn't alter either end (less easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addDependencyToClass_undo_redo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_date));
+
+ Dependency dependency = addDependency(bar, types_date);
+
+ undo();
+ redo();
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(dependency);
+ assertThat(editPart.getSource(), is((EditPart) requireEditPart(bar)));
+ assertThat(editPart.getTarget(), is((EditPart) requireEditPart(types_date)));
+ }
+
+ /**
+ * A relationship that is an element owned by neither source nor target
+ * but the construction of which does alter the ends (middling easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addAssociationToClass() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+
+ Association association = addAssociation(super_, foo);
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(association);
+ assertThat(editPart.getSource(), either(is((EditPart) requireEditPart(super_))).or(is((EditPart) requireEditPart(foo))));
+ assertThat(editPart.getTarget(), either(is((EditPart) requireEditPart(foo))).or(is((EditPart) requireEditPart(super_))));
+ }
+
+ /**
+ * A relationship that is an element owned by neither source nor target
+ * but the construction of which does alter the ends (middling easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addAssociationToClass_undo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+
+ Association association = addAssociation(super_, foo);
+
+ undo();
+
+ assertNoView(association);
+ }
+
+ /**
+ * A relationship that is an element owned by neither source nor target
+ * but the construction of which does alter the ends (middling easy case).
+ */
+ @NeedsUIEvents
+ @Test
+ public void addAssociationToClass_undo_redo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+
+ Association association = addAssociation(super_, foo);
+
+ undo();
+ redo();
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(association);
+ assertThat(editPart.getSource(), either(is((EditPart) requireEditPart(super_))).or(is((EditPart) requireEditPart(foo))));
+ assertThat(editPart.getTarget(), either(is((EditPart) requireEditPart(foo))).or(is((EditPart) requireEditPart(super_))));
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void removeGeneralizationFromClass() {
+ remove(types_subfoo_foo);
+
+ assertNoView(types_subfoo_foo);
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void removeGeneralizationFromClass_undo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_subfoo));
+
+ remove(types_subfoo_foo);
+
+ undo();
+
+ ConnectionEditPart editPart = (ConnectionEditPart) requireConnectionEditPart(types_subfoo_foo);
+ assertThat(editPart.getSource(), is((EditPart) requireEditPart(types_subfoo)));
+ assertThat(editPart.getTarget(), is((EditPart) requireEditPart(foo)));
+ }
+
+ @NeedsUIEvents
+ @Test
+ public void removeGeneralizationFromClass_undo_redo() {
+ // Ensure canonical connections
+ setCanonical(true, requireEditPart(root));
+ setCanonical(true, requireEditPart(types_subfoo));
+
+ remove(types_subfoo_foo);
+
+ undo();
+ redo();
+
+ assertNoView(types_subfoo_foo);
+ }
+
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void getModelElements() {
+ root = editor.getModel();
+
+ foo = (org.eclipse.uml2.uml.Class) root.getOwnedType("Foo");
+ foo_doit = foo.getOwnedOperation("doIt", null, null);
+ bar = (org.eclipse.uml2.uml.Class) root.getOwnedType("Bar");
+ super_ = (org.eclipse.uml2.uml.Class) root.getOwnedType("Super");
+ yesno = (Enumeration) root.getOwnedType("YesNo");
+
+ types = root.getNestedPackage("types");
+ types_subfoo = (org.eclipse.uml2.uml.Class) types.getOwnedType("SubFoo");
+ types_date = (DataType) types.getOwnedType("Date");
+
+ types_subfoo_foo = types_subfoo.getGeneralization(foo);
+ }
+
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/src/org/eclipse/papyrus/uml/diagram/synchronizeview/test/Activator.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/internal/Activator.java
index 8e4cde26888..a7a6a3c9e4f 100644
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/src/org/eclipse/papyrus/uml/diagram/synchronizeview/test/Activator.java
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.canonical.tests/src/org/eclipse/papyrus/infra/gmfdiag/canonical/tests/internal/Activator.java
@@ -1,4 +1,4 @@
-package org.eclipse.papyrus.uml.diagram.synchronizeview.test;
+package org.eclipse.papyrus.infra.gmfdiag.canonical.tests.internal;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
@@ -9,30 +9,24 @@ import org.osgi.framework.BundleContext;
public class Activator extends AbstractUIPlugin {
// The plug-in ID
- public static final String PLUGIN_ID = "org.eclipse.papyrus.uml.diagram.synchronizeview.test"; //$NON-NLS-1$
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.gmfdiag.canonical.tests"; //$NON-NLS-1$
// The shared instance
private static Activator plugin;
-
+
/**
* The constructor
*/
public Activator() {
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
+ @Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
- /*
- * (non-Javadoc)
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
+ @Override
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/commands/util/CommandTreeIteratorTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/commands/util/CommandTreeIteratorTest.java
new file mode 100644
index 00000000000..e24e3388c33
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/commands/util/CommandTreeIteratorTest.java
@@ -0,0 +1,194 @@
+/*****************************************************************************
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ *****************************************************************************/
+
+package org.eclipse.papyrus.commands.util;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.hamcrest.MatcherAssert.assertThat;
+
+import java.util.Iterator;
+import java.util.Set;
+
+import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.core.runtime.IAdaptable;
+import org.eclipse.core.runtime.IProgressMonitor;
+import org.eclipse.emf.common.command.AbstractCommand;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.commands.CompoundCommand;
+import org.eclipse.gmf.runtime.common.core.command.CommandResult;
+import org.eclipse.gmf.runtime.common.core.command.CompositeCommand;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.diagram.ui.commands.CommandProxy;
+import org.eclipse.gmf.runtime.diagram.ui.commands.ICommandProxy;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGEFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.EMFtoGMFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.junit.framework.classification.tests.AbstractPapyrusTest;
+import org.junit.Before;
+import org.junit.Test;
+
+import com.google.common.collect.Sets;
+
+/**
+ * Test suite for the {@link CommandTreeIterator} class.
+ */
+public class CommandTreeIteratorTest extends AbstractPapyrusTest {
+
+ private Object fixture;
+
+ private int gefCount;
+
+ private int emfCount;
+
+ private int gmfCount;
+
+ public CommandTreeIteratorTest() {
+ super();
+ }
+
+ @Test
+ public void gefCompoundsAndWrappers() {
+ assertThat(collectAll(fixture, Command.class).size(), is(gefCount));
+ }
+
+ @Test
+ public void emfCompoundsAndWrappers() {
+ assertThat(collectAll(fixture, org.eclipse.emf.common.command.Command.class).size(), is(emfCount));
+ }
+
+ @Test
+ public void gmfCompoundsAndWrappers() {
+ assertThat(collectAll(fixture, ICommand.class).size(), is(gmfCount));
+ }
+
+ @Test
+ public void genericCompoundsAndWrappers() {
+ assertThat(collectAll(fixture).size(), is(gefCount + emfCount + gmfCount));
+ }
+
+ //
+ // Test framework
+ //
+
+ @Before
+ public void createFixture() {
+ CompoundCommand compoundGEFCommand = new CompoundCommand();
+
+ // Add a simple EMF command wrapped
+ compoundGEFCommand.add(EMFtoGEFCommandWrapper.wrap(new TestEMFCommand()));
+
+ // Add a double-wrapped GMF command
+ compoundGEFCommand.add(EMFtoGEFCommandWrapper.wrap(GMFtoEMFCommandWrapper.wrap(new TestGMFCommand())));
+
+ // Add a (wrapped differently) GMF compound
+ CompositeCommand compoundGMFCommand = new CompositeCommand("composite");
+ compoundGEFCommand.add(new ICommandProxy(compoundGMFCommand));
+
+ // Add a GEF command (wrapped) to the GMF compound
+ compoundGMFCommand.add(new CommandProxy(new TestGEFCommand()));
+ compoundGMFCommand.add(EMFtoGMFCommandWrapper.wrap(GEFtoEMFCommandWrapper.wrap(new TestGEFCommand())));
+
+ // And now an EMF compound
+ org.eclipse.emf.common.command.CompoundCommand compoundEMFCommand = new org.eclipse.emf.common.command.CompoundCommand();
+ compoundGMFCommand.add(EMFtoGMFCommandWrapper.wrap(compoundEMFCommand));
+
+ // And an EMF command to the EMF compound
+ compoundEMFCommand.append(new TestEMFCommand());
+
+ // and a GEF command
+ compoundEMFCommand.append(GEFtoEMFCommandWrapper.wrap(new TestGEFCommand()));
+
+ // Top it off with a GMF command on the GMF compound
+ compoundGMFCommand.add(new TestGMFCommand());
+
+ fixture = compoundGEFCommand;
+ }
+
+ <C> Set<C> collectAll(Object command, Class<C> type) {
+ Set<C> result = Sets.newLinkedHashSet();
+
+ for (Iterator<C> iter = CommandTreeIterator.iterate(command, type); iter.hasNext();) {
+ result.add(iter.next());
+ }
+
+ return result;
+ }
+
+ Set<?> collectAll(Object command) {
+ Set<Object> result = Sets.newLinkedHashSet();
+
+ for (Iterator<?> iter = CommandTreeIterator.iterate(command); iter.hasNext();) {
+ result.add(iter.next());
+ }
+
+ return result;
+ }
+
+ //
+ // Nested types
+ //
+
+ private class TestEMFCommand extends AbstractCommand {
+ TestEMFCommand() {
+ super();
+
+ if (fixture == null) {
+ emfCount++;
+ }
+ }
+
+ public void execute() {
+ // Pass
+ }
+
+ public void redo() {
+ // Pass
+ }
+ }
+
+ private class TestGEFCommand extends Command {
+ TestGEFCommand() {
+ super();
+
+ if (fixture == null) {
+ gefCount++;
+ }
+ }
+ }
+
+ private class TestGMFCommand extends org.eclipse.gmf.runtime.common.core.command.AbstractCommand {
+ TestGMFCommand() {
+ super("test");
+
+ if (fixture == null) {
+ gmfCount++;
+ }
+ }
+
+ @Override
+ protected CommandResult doExecuteWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ @Override
+ protected CommandResult doRedoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ return CommandResult.newCancelledCommandResult();
+ }
+
+ @Override
+ protected CommandResult doUndoWithResult(IProgressMonitor progressMonitor, IAdaptable info) throws ExecutionException {
+ return CommandResult.newCancelledCommandResult();
+ }
+ }
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/infra/gmfdiag/commands/tests/AllTests.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/infra/gmfdiag/commands/tests/AllTests.java
index b73b4fde80d..8d4fcbd7195 100644
--- a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/infra/gmfdiag/commands/tests/AllTests.java
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.commands.tests/src/org/eclipse/papyrus/infra/gmfdiag/commands/tests/AllTests.java
@@ -9,11 +9,13 @@
* Contributors:
* Christian W. Damus (CEA) - initial API and implementation
* Christian W. Damus - bug 459746
+ * Christian W. Damus - bug 433206
*/
package org.eclipse.papyrus.infra.gmfdiag.commands.tests;
import org.eclipse.papyrus.commands.NestingNotifyingWorkspaceCommandStackTest;
import org.eclipse.papyrus.commands.NotifyingWorkspaceCommandStackTest;
+import org.eclipse.papyrus.commands.util.CommandTreeIteratorTest;
import org.junit.runner.RunWith;
import org.junit.runners.Suite;
import org.junit.runners.Suite.SuiteClasses;
@@ -25,7 +27,9 @@ import org.junit.runners.Suite.SuiteClasses;
@RunWith(Suite.class)
@SuiteClasses({
// {oep.commands}
- NotifyingWorkspaceCommandStackTest.class, NestingNotifyingWorkspaceCommandStackTest.class })
+ NotifyingWorkspaceCommandStackTest.class, NestingNotifyingWorkspaceCommandStackTest.class,
+ // {oep.commands.util}
+ CommandTreeIteratorTest.class })
public class AllTests {
}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java
index 703f0b176b3..c51d331687a 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/Activator.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012 CEA LIST.
+ * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others.
*
*
* All rights reserved. This program and the accompanying materials
@@ -9,6 +9,7 @@
*
* Contributors:
* Vincent Lorenzo (CEA LIST) Vincent.Lorenzo@cea.fr - Initial API and implementation
+ * Christian W. Damus - bug 433206
*
*****************************************************************************/
package org.eclipse.papyrus.junit.utils;
@@ -16,6 +17,8 @@ package org.eclipse.papyrus.junit.utils;
import org.eclipse.papyrus.infra.core.log.LogHelper;
import org.eclipse.ui.plugin.AbstractUIPlugin;
import org.osgi.framework.BundleContext;
+import org.osgi.framework.ServiceReference;
+import org.osgi.service.application.ApplicationHandle;
/**
* The activator class controls the plug-in life cycle
@@ -30,29 +33,34 @@ public class Activator extends AbstractUIPlugin {
public static LogHelper log;
+ private String runningApplicationID;
+
/**
* The constructor
*/
public Activator() {
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
- */
@Override
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
log = new LogHelper(this);
+
+ // Get the running application ID
+ ServiceReference<ApplicationHandle> appRef = context.getServiceReference(ApplicationHandle.class);
+ if (appRef != null) {
+ ApplicationHandle appHandle = context.getService(appRef);
+ if (appHandle != null) {
+ try {
+ runningApplicationID = appHandle.getApplicationDescriptor().getApplicationId();
+ } finally {
+ context.ungetService(appRef);
+ }
+ }
+ }
}
- /*
- * (non-Javadoc)
- *
- * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
- */
@Override
public void stop(BundleContext context) throws Exception {
plugin = null;
@@ -68,4 +76,8 @@ public class Activator extends AbstractUIPlugin {
return plugin;
}
+ public String getRunningApplicationID() {
+ return (runningApplicationID == null) ? "" : runningApplicationID; //$NON-NLS-1$
+ }
+
}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java
index 17bfadc190c..0982ea9fc29 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/JUnitUtils.java
@@ -19,7 +19,7 @@ import org.junit.rules.TestRule;
import org.junit.runner.Description;
/**
- * Utilities for working with the JUnit data model.
+ * Utilities for working with the JUnit data model and execution environment.
*/
public class JUnitUtils {
@@ -113,4 +113,14 @@ public class JUnitUtils {
return result;
}
+
+ /**
+ * Queries whether the current JUnit test execution is running in the automated build environment
+ * (whether actually on the build server or not; users can run local builds on their development systems, too).
+ *
+ * @return whether the tests are running in the automated build environment
+ */
+ public static boolean isAutomatedBuildExecution() {
+ return Activator.getDefault().getRunningApplicationID().startsWith("org.eclipse.tycho."); //$NON-NLS-1$
+ }
}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java
new file mode 100644
index 00000000000..5ae3344d156
--- /dev/null
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/ActiveDiagram.java
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015 Christian W. Damus and others.
+ *
+ * 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
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Christian W. Damus - Initial API and implementation
+ *
+ */
+package org.eclipse.papyrus.junit.utils.rules;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+
+/**
+ * Annotation on a test indicating the diagram to activate.
+ *
+ * @see PapyrusEditorFixture
+ */
+@Target({ ElementType.METHOD, ElementType.TYPE })
+@Retention(RetentionPolicy.RUNTIME)
+public @interface ActiveDiagram {
+ /**
+ * The name of the diagram to activate.
+ */
+ String value();
+}
diff --git a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java
index 959005b38de..fbc377f5de2 100644
--- a/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java
+++ b/tests/junit/plugins/junit/org.eclipse.papyrus.junit.utils/src/org/eclipse/papyrus/junit/utils/rules/PapyrusEditorFixture.java
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2014 CEA and others.
+ * Copyright (c) 2014, 2015 CEA, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -8,6 +8,7 @@
*
* Contributors:
* Christian W. Damus (CEA) - Initial API and implementation
+ * Christian W. Damus - bug 433206
*
*/
package org.eclipse.papyrus.junit.utils.rules;
@@ -41,11 +42,15 @@ import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.transaction.TransactionalEditingDomain;
import org.eclipse.gef.EditPart;
import org.eclipse.gef.GraphicalEditPart;
+import org.eclipse.gef.RootEditPart;
import org.eclipse.gef.ui.palette.PaletteViewer;
+import org.eclipse.gmf.runtime.diagram.core.preferences.PreferencesHint;
import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.IDiagramPreferenceSupport;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditor;
import org.eclipse.gmf.runtime.diagram.ui.parts.DiagramEditorWithFlyOutPalette;
import org.eclipse.gmf.runtime.diagram.ui.parts.IDiagramWorkbenchPart;
+import org.eclipse.gmf.runtime.notation.Diagram;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.papyrus.editor.PapyrusMultiDiagramEditor;
import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
@@ -59,7 +64,10 @@ import org.eclipse.papyrus.infra.core.sasheditor.editor.ISashWindowsContainer;
import org.eclipse.papyrus.infra.core.services.ServiceException;
import org.eclipse.papyrus.infra.core.services.ServicesRegistry;
import org.eclipse.papyrus.infra.core.utils.AdapterUtils;
+import org.eclipse.papyrus.infra.core.utils.ServiceUtils;
+import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationModel;
import org.eclipse.papyrus.junit.utils.EditorUtils;
+import org.eclipse.papyrus.junit.utils.JUnitUtils;
import org.eclipse.papyrus.junit.utils.tests.AbstractEditorTest;
import org.eclipse.papyrus.uml.tools.model.UmlModel;
import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPage;
@@ -146,6 +154,16 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
openAll(description);
+ ActiveDiagram activeDiagram = JUnitUtils.getAnnotation(description, ActiveDiagram.class);
+ if (activeDiagram != null) {
+ String name = activeDiagram.value();
+ activateDiagram(name);
+ if ((activeDiagramEditor == null) || !name.equals(getActiveDiagramEditor().getDiagram().getName())) {
+ // OK, we need to open it, then
+ openDiagram(name);
+ }
+ }
+
super.starting(description);
}
@@ -218,6 +236,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
try {
editor = EditorUtils.openPapyrusEditor(modelFile);
@@ -233,6 +252,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
final IWorkbenchPage page = editor.getSite().getPage();
page.addPartListener(new IPartListener() {
+ @Override
public void partClosed(IWorkbenchPart part) {
editorsToClose.remove(part);
@@ -245,18 +265,22 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
}
}
+ @Override
public void partOpened(IWorkbenchPart part) {
// Pass
}
+ @Override
public void partDeactivated(IWorkbenchPart part) {
// Pass
}
+ @Override
public void partBroughtToTop(IWorkbenchPart part) {
// Pass
}
+ @Override
public void partActivated(IWorkbenchPart part) {
// Pass
}
@@ -332,6 +356,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
Display.getDefault().syncExec(new Runnable() {
+ @Override
public void run() {
ModelExplorerPageBookView view;
try {
@@ -426,6 +451,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
sashContainer.visit(new IPageVisitor() {
+ @Override
public void accept(IEditorPage page) {
if (name.equals(page.getPageTitle()) && (page.getIEditorPart() instanceof DiagramEditorWithFlyOutPalette)) {
select[0] = page;
@@ -433,6 +459,7 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
}
}
+ @Override
public void accept(IComponentPage page) {
// Pass
}
@@ -446,6 +473,54 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
return this;
}
+ public PapyrusEditorFixture openDiagram(String name) {
+ return openDiagram(editor, name);
+ }
+
+ public PapyrusEditorFixture openDiagram(IMultiDiagramEditor editor, final String name) {
+ activate(editor);
+
+ try {
+ ModelSet modelSet = ServiceUtils.getInstance().getModelSet(editor.getServicesRegistry());
+ NotationModel notation = (NotationModel) modelSet.getModel(NotationModel.MODEL_ID);
+ Diagram diagram = notation.getDiagram(name);
+ ServiceUtils.getInstance().getIPageManager(editor.getServicesRegistry()).openPage(diagram);
+ flushDisplayEvents();
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot initialize test", e);
+ }
+
+ return this;
+ }
+
+ public String closeDiagram() {
+ String result = getActiveDiagramEditor().getDiagram().getName();
+ closeDiagram(editor, result);
+ return result;
+ }
+
+ public PapyrusEditorFixture closeDiagram(String name) {
+ return closeDiagram(editor, name);
+ }
+
+ public PapyrusEditorFixture closeDiagram(IMultiDiagramEditor editor, final String name) {
+ try {
+ ModelSet modelSet = ServiceUtils.getInstance().getModelSet(editor.getServicesRegistry());
+ NotationModel notation = (NotationModel) modelSet.getModel(NotationModel.MODEL_ID);
+ Diagram diagram = notation.getDiagram(name);
+
+ // If the diagram was deleted, then so too was its page
+ if (diagram != null) {
+ ServiceUtils.getInstance().getIPageManager(editor.getServicesRegistry()).closePage(diagram);
+ flushDisplayEvents();
+ }
+ } catch (Exception e) {
+ throw new IllegalStateException("Cannot close diagram", e);
+ }
+
+ return this;
+ }
+
public DiagramEditorWithFlyOutPalette getActiveDiagramEditor() {
DiagramEditorWithFlyOutPalette result = activeDiagramEditor;
@@ -821,4 +896,18 @@ public class PapyrusEditorFixture extends AbstractModelFixture<TransactionalEdit
return ((location != null) ? location : (relativeTo == null) ? DEFAULT_LOCATION_EDITORS : DEFAULT_LOCATION_VIEW).toModelServiceLocation();
}
}
+
+ public PreferencesHint getPreferencesHint() {
+ PreferencesHint result = PreferencesHint.USE_DEFAULTS;
+
+ if (activeDiagramEditor != null) {
+ RootEditPart rootEditPart = activeDiagramEditor.getDiagramGraphicalViewer().getRootEditPart();
+ if (rootEditPart instanceof IDiagramPreferenceSupport) {
+ result = ((IDiagramPreferenceSupport) rootEditPart).getPreferencesHint();
+ }
+ }
+
+ return result;
+ }
+
}
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/META-INF/MANIFEST.MF
index e886af9fe89..d193b7a0457 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/META-INF/MANIFEST.MF
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/META-INF/MANIFEST.MF
@@ -2,7 +2,8 @@ Manifest-Version: 1.0
Require-Bundle: org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="1.1.0",
org.junit;bundle-version="4.10.0",
org.eclipse.papyrus.junit.framework;bundle-version="1.1.0",
- org.eclipse.papyrus.junit.utils;bundle-version="1.1.0"
+ org.eclipse.papyrus.junit.utils;bundle-version="1.1.0",
+ com.google.guava;bundle-version="11.0.0"
Export-Package: org.eclipse.papyrus.sysml.diagram.internalblock.tests.
suites
Bundle-Vendor: %providerName
diff --git a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
index 665df992cf6..7d2829c3102 100644
--- a/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
+++ b/tests/junit/plugins/sysml/diagram/org.eclipse.papyrus.sysml.diagram.internalblock.tests/src/org/eclipse/papyrus/sysml/diagram/internalblock/tests/utils/TestUtils.java
@@ -1,5 +1,5 @@
/*****************************************************************************
- * Copyright (c) 2012, 2014 CEA LIST and others.
+ * Copyright (c) 2012, 2015 CEA LIST, Christian W. Damus, and others.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
@@ -7,9 +7,9 @@
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
- *
* CEA LIST - Initial API and implementation
* Christian W. Damus (CEA) - bug 436047
+ * Christian W. Damus - bug 433206
*
*****************************************************************************/
package org.eclipse.papyrus.sysml.diagram.internalblock.tests.utils;
@@ -86,6 +86,8 @@ import org.eclipse.uml2.uml.Property;
import org.eclipse.uml2.uml.util.UMLUtil;
import org.junit.Assert;
+import com.google.common.collect.Iterables;
+
public class TestUtils {
public static void deleteView(IElementType elementType, View containerView, boolean isAllowed) throws Exception {
@@ -99,14 +101,14 @@ public class TestUtils {
// Get delete view command
Command command = containerEditPart.getCommand(new GroupRequest(RequestConstants.REQ_DELETE));
// if the view deletion is not allowed the command should not be executable
- if(!isAllowed) {
- if((command == null) || (!command.canExecute())) {
+ if (!isAllowed) {
+ if ((command == null) || (!command.canExecute())) {
// Ok the command cannot be executed.
} else {
fail("The command should not be executable.");
}
} else {
- if((command == null) || (!command.canExecute())) {
+ if ((command == null) || (!command.canExecute())) {
fail("The command should be executable.");
} else {
// Ok the command can be executed.
@@ -130,14 +132,14 @@ public class TestUtils {
// Get delete command
Command command = containerEditPart.getCommand(new EditCommandRequestWrapper(destroyRequest));
// if the deletion is not allowed the command should not be executable
- if(!isAllowed) {
- if((command == null) || (!command.canExecute())) {
+ if (!isAllowed) {
+ if ((command == null) || (!command.canExecute())) {
// Ok the command cannot be executed.
} else {
fail("The command should not be executable.");
}
} else {
- if((command == null) || (!command.canExecute())) {
+ if ((command == null) || (!command.canExecute())) {
fail("The command should be executable.");
} else {
// Ok the command can be executed.
@@ -165,14 +167,14 @@ public class TestUtils {
// Get drop command
Command command = containerEditPart.getCommand(dropRequest);
// if the drop is not allowed the command should not be executable
- if(!isAllowed) {
- if((command == null) || (!command.canExecute())) {
+ if (!isAllowed) {
+ if ((command == null) || (!command.canExecute())) {
// Ok the command cannot be executed.
} else {
fail("The command should not be executable.");
}
} else {
- if((command == null) || (!command.canExecute())) {
+ if ((command == null) || (!command.canExecute())) {
fail("The command should be executable.");
} else {
// Ok the command can be executed.
@@ -195,19 +197,19 @@ public class TestUtils {
// Get drop command
Command command = containerEditPart.getCommand(dropRequest);
// if the drop is not allowed the command should not be executable
- if(!isAllowed) {
- if((command == null) || (!command.canExecute())) {
+ if (!isAllowed) {
+ if ((command == null) || (!command.canExecute())) {
// Ok the command cannot be executed.
} else {
fail("The command should not be executable.");
}
} else {
- if((command == null) || (!command.canExecute())) {
+ if ((command == null) || (!command.canExecute())) {
fail("The command should be executable.");
} else {
// Simple command
- if(expectedCommandNames.size() == 1) {
- if(expectedCommandNames.get(0).equals(command.getLabel())) {
+ if (expectedCommandNames.size() == 1) {
+ if (expectedCommandNames.get(0).equals(command.getLabel())) {
// Ok the command can be executed.
defaultExecutionTest(command);
// Test the results then
@@ -216,30 +218,39 @@ public class TestUtils {
} else {
fail("The expected kind of command was {" + expectedCommandNames.get(0) + "}, but was {" + command.getLabel() + "}");
}
- } else if(expectedCommandNames.size() > 1) {
- ICommand tmpCommand = (command instanceof ICommandProxy) ? ((ICommandProxy)command).getICommand() : null;
- if((tmpCommand == null) || !(tmpCommand instanceof SelectAndExecuteCommand)) {
+ } else if (expectedCommandNames.size() > 1) {
+ ICommandProxy proxy = null;
+ if (command instanceof ICommandProxy) {
+ proxy = (ICommandProxy) command;
+ } else if (command instanceof CompoundCommand) {
+ // Search for the nested ICommandProxy (there could be ToggleCanonicalModeCommands bracketing it)
+ proxy = Iterables.getFirst(Iterables.filter(((CompoundCommand) command).getCommands(), ICommandProxy.class), null);
+ }
+ ICommand tmpCommand = (proxy != null) ? proxy.getICommand() : null;
+ if ((tmpCommand == null) || !(tmpCommand instanceof SelectAndExecuteCommand)) {
fail("The drop command is not a selact and execute command.");
}
// Field accessibility modification to review elementary drop command available as
// SelectAndExecuteCommand choices.
- SelectAndExecuteCommand selectCommand = (SelectAndExecuteCommand)tmpCommand;
+ SelectAndExecuteCommand selectCommand = (SelectAndExecuteCommand) tmpCommand;
Field popupField = PopupMenuCommand.class.getDeclaredField("popupMenu");
popupField.setAccessible(true);
- PopupMenu menu = (PopupMenu)popupField.get(selectCommand);
+ PopupMenu menu = (PopupMenu) popupField.get(selectCommand);
Field content = PopupMenu.class.getDeclaredField("content");
content.setAccessible(true);
- List<CompoundCommand> commandList = (List<CompoundCommand>)content.get(menu);
- if(commandList.size() != expectedCommandNames.size()) {
+ @SuppressWarnings("unchecked")
+ List<CompoundCommand> commandList = (List<CompoundCommand>) content.get(menu);
+ if (commandList.size() != expectedCommandNames.size()) {
fail("Unexpected number of possible alternate drop command.");
}
- for(int i = 0; i < commandList.size(); i++) {
+ for (int i = 0; i < commandList.size(); i++) {
CompoundCommand subCommand = commandList.get(i);
- if(expectedCommandNames.get(i).equals(subCommand.getLabel())) {
+ if (expectedCommandNames.get(i).equals(subCommand.getLabel())) {
// Ok the command can be executed.
defaultExecutionTest(subCommand);
// Add one more undo to go back in initial state before testing next command
- EditorUtils.getCommandStack().undo();;
+ EditorUtils.getCommandStack().undo();
+ ;
// Test the results then
// fail("Result tests not implemented.");
} else {
@@ -252,7 +263,7 @@ public class TestUtils {
}
public static void createNodeFromPalette(String toolId, View containerView, boolean isAllowed) throws Exception {
- if(isAllowed) {
+ if (isAllowed) {
createNodeFromPalette(toolId, containerView, isAllowed, true);
} else {
createNodeFromPalette(toolId, containerView, isAllowed, false);
@@ -268,18 +279,18 @@ public class TestUtils {
// Get creation command for request
Command command = containerEditPart.getCommand(createRequest);
// if the creation is not allowed the command should not be executable
- if(!isAllowed) {
- if((command == null) || (!command.canExecute())) {
+ if (!isAllowed) {
+ if ((command == null) || (!command.canExecute())) {
// Ok the command cannot be executed.
} else {
fail("The command should not be executable.");
}
} else {
- if((command == null) || (!command.canExecute())) {
+ if ((command == null) || (!command.canExecute())) {
fail("The command should be executable.");
} else {
// Ok the command can be executed.
- if(execute) {
+ if (execute) {
defaultExecutionTest(command);
}
// Test the results then
@@ -304,11 +315,11 @@ public class TestUtils {
}
});
- if(tool instanceof AspectUnspecifiedTypeCreationTool) {
- AspectUnspecifiedTypeCreationTool creationTool = (AspectUnspecifiedTypeCreationTool)tool;
+ if (tool instanceof AspectUnspecifiedTypeCreationTool) {
+ AspectUnspecifiedTypeCreationTool creationTool = (AspectUnspecifiedTypeCreationTool) tool;
return creationTool.createCreateRequest();
- } else if(tool instanceof AspectUnspecifiedTypeConnectionTool) {
- AspectUnspecifiedTypeConnectionTool connectionTool = (AspectUnspecifiedTypeConnectionTool)tool;
+ } else if (tool instanceof AspectUnspecifiedTypeConnectionTool) {
+ AspectUnspecifiedTypeConnectionTool connectionTool = (AspectUnspecifiedTypeConnectionTool) tool;
return connectionTool.new CreateAspectUnspecifiedTypeConnectionRequest(connectionTool.getElementTypes(), false, Activator.DIAGRAM_PREFERENCES_HINT);
}
@@ -323,15 +334,15 @@ public class TestUtils {
public static EObject createEdgeFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, boolean execute) throws Exception {
// Find palette tool to simulate element creation and prepare request
Tool tool = getPaletteTool(toolId);
- CreateAspectUnspecifiedTypeConnectionRequest createRequest = (CreateAspectUnspecifiedTypeConnectionRequest)getCreateRequest(tool);
+ CreateAspectUnspecifiedTypeConnectionRequest createRequest = (CreateAspectUnspecifiedTypeConnectionRequest) getCreateRequest(tool);
// Test source creation command
createRequest.setSourceEditPart(getEditPart(sourceView));
createRequest.setType(RequestConstants.REQ_CONNECTION_START);
Command srcCommand = getEditPart(sourceView).getCommand(createRequest);
// Test source command
- if((srcCommand == null) || !(srcCommand.canExecute())) { // Non-executable command
- if(targetView == null) { // Only test behavior on source
- if(!isAllowed) {
+ if ((srcCommand == null) || !(srcCommand.canExecute())) { // Non-executable command
+ if (targetView == null) { // Only test behavior on source
+ if (!isAllowed) {
// Current behavior matches the expected results
return null;
} else {
@@ -341,8 +352,8 @@ public class TestUtils {
fail("The command should be executable.");
}
} else { // Executable command
- if(targetView == null) { // Only test behavior on source
- if(!isAllowed) {
+ if (targetView == null) { // Only test behavior on source
+ if (!isAllowed) {
fail("The command should not be executable.");
} else {
// Current behavior matches the expected results - no execution test.
@@ -355,28 +366,28 @@ public class TestUtils {
createRequest.setType(RequestConstants.REQ_CONNECTION_END);
Command tgtCommand = getEditPart(targetView).getCommand(createRequest);
// Test the target command
- if((tgtCommand == null) || !(tgtCommand.canExecute())) { // Non-executable command
- if(!isAllowed) {
+ if ((tgtCommand == null) || !(tgtCommand.canExecute())) { // Non-executable command
+ if (!isAllowed) {
// Current behavior matches the expected results
return null;
} else {
fail("The command should be executable.");
}
} else { // Executable command
- if(!isAllowed) {
+ if (!isAllowed) {
fail("The command should not be executable.");
} else {
// Current behavior matches the expected results
- if(execute) { // Test command execution
+ if (execute) { // Test command execution
defaultExecutionTest(tgtCommand);
// Retrieve created object via nested ElementAndViewCreationRequest.
View newView = null;
Iterator<?> it = createRequest.getAllRequests().iterator();
- while(it.hasNext() && newView == null) {
- CreateConnectionViewAndElementRequest subRequest = (CreateConnectionViewAndElementRequest)it.next();
- newView = (View)subRequest.getConnectionViewDescriptor().getAdapter(View.class);
+ while (it.hasNext() && newView == null) {
+ CreateConnectionViewAndElementRequest subRequest = (CreateConnectionViewAndElementRequest) it.next();
+ newView = (View) subRequest.getConnectionViewDescriptor().getAdapter(View.class);
}
- if(newView != null) {
+ if (newView != null) {
return newView.getElement();
} else {
fail("No edge seem to have been created.");
@@ -398,35 +409,35 @@ public class TestUtils {
public static void createEdgeConnectorFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, boolean execute, List<Property> nestedSourcePath, List<Property> nestedTargetPath) throws Exception {
EObject newLink = createEdgeFromPalette(toolId, sourceView, targetView, isAllowed, execute);
// Abort if the command is not supposed to be executable
- if(!isAllowed) {
+ if (!isAllowed) {
return;
}
- if((newLink == null) || (!(newLink instanceof org.eclipse.uml2.uml.Connector))) {
+ if ((newLink == null) || (!(newLink instanceof org.eclipse.uml2.uml.Connector))) {
fail("No edge or unexpected kind of edge created.");
}
// If previous test have not failed the execution / undo / re-do has been done
- org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector)newLink;
- // Test source connector end
+ org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector) newLink;
+ // Test source connector end
NestedConnectorEnd sourceNestedConnectorEnd = UMLUtil.getStereotypeApplication(connector.getEnds().get(0), NestedConnectorEnd.class);
- if(nestedSourcePath.isEmpty()) {
+ if (nestedSourcePath.isEmpty()) {
Assert.assertNull("No nested connector end stereotype should be applied on source.", sourceNestedConnectorEnd);
} else {
Assert.assertNotNull("Nested connector end stereotype should be applied on source.", sourceNestedConnectorEnd);
Assert.assertEquals("Nested property path is incorrect for source", nestedSourcePath, sourceNestedConnectorEnd.getPropertyPath());
- // if(!sourceNestedConnectorEnd.getPropertyPath().equals(nestedSourcePath)) {
- // fail("The nested property path is incorrect for source.");
- // }
+ // if(!sourceNestedConnectorEnd.getPropertyPath().equals(nestedSourcePath)) {
+ // fail("The nested property path is incorrect for source.");
+ // }
}
- // Test target connector end
+ // Test target connector end
NestedConnectorEnd targetNestedConnectorEnd = UMLUtil.getStereotypeApplication(connector.getEnds().get(1), NestedConnectorEnd.class);
- if(nestedTargetPath.isEmpty()) {
+ if (nestedTargetPath.isEmpty()) {
Assert.assertNull("No nested connector end stereotype should be applied on target.", targetNestedConnectorEnd);
} else {
Assert.assertNotNull("Nested connector end stereotype should be applied on target.", targetNestedConnectorEnd);
Assert.assertEquals("Nested property path is incorrect for target", nestedTargetPath, targetNestedConnectorEnd.getPropertyPath());
- // if(!targetNestedConnectorEnd.getPropertyPath().equals(nestedTargetPath)) {
- // fail("The nested property path is incorrect for target.");
- // }
+ // if(!targetNestedConnectorEnd.getPropertyPath().equals(nestedTargetPath)) {
+ // fail("The nested property path is incorrect for target.");
+ // }
}
}
@@ -434,35 +445,36 @@ public class TestUtils {
createEdgeConnectorAndTestDelegateFromPalette(toolId, sourceView, targetView, isAllowed, isAllowed, expectedSourcePartWithPort, expectedTargetPartWithPort);
}
- public static void createEdgeConnectorAndTestDelegateFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, boolean execute, ConnectableElement expectedSourcePartWithPort, ConnectableElement expectedTargetPartWithPort) throws Exception {
+ public static void createEdgeConnectorAndTestDelegateFromPalette(String toolId, View sourceView, View targetView, boolean isAllowed, boolean execute, ConnectableElement expectedSourcePartWithPort, ConnectableElement expectedTargetPartWithPort)
+ throws Exception {
EObject newLink = createEdgeFromPalette(toolId, sourceView, targetView, isAllowed, execute);
// Abort if the command is not supposed to be executable
- if(!isAllowed) {
+ if (!isAllowed) {
return;
}
- if((newLink == null) || (!(newLink instanceof org.eclipse.uml2.uml.Connector))) {
+ if ((newLink == null) || (!(newLink instanceof org.eclipse.uml2.uml.Connector))) {
fail("No edge or unexpected kind of edge created.");
}
// If previous test have not failed the execution / undo / re-do has been done
- org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector)newLink;
- // Test source connector end
+ org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector) newLink;
+ // Test source connector end
ConnectorEnd sourceConnectorEnd = connector.getEnds().get(0);
- if(sourceConnectorEnd.getPartWithPort() != expectedSourcePartWithPort) {
+ if (sourceConnectorEnd.getPartWithPort() != expectedSourcePartWithPort) {
fail("The partWithPort is incorrect for source.");
}
- // Test target connector end
+ // Test target connector end
ConnectorEnd targetConnectorEnd = connector.getEnds().get(1);
- if(targetConnectorEnd.getPartWithPort() != expectedTargetPartWithPort) {
+ if (targetConnectorEnd.getPartWithPort() != expectedTargetPartWithPort) {
fail("The partWithPort is incorrect for target.");
}
}
public static void reorientRelationshipSource(View relationshipView, View newSourceView, boolean isAllowed) throws Exception {
- reorientRelationship((Connector)relationshipView, newSourceView, ReorientRelationshipRequest.REORIENT_SOURCE, isAllowed);
+ reorientRelationship((Connector) relationshipView, newSourceView, ReorientRelationshipRequest.REORIENT_SOURCE, isAllowed);
}
public static void reorientRelationshipTarget(View relationshipView, View newTargetView, boolean isAllowed) throws Exception {
- reorientRelationship((Connector)relationshipView, newTargetView, ReorientRelationshipRequest.REORIENT_TARGET, isAllowed);
+ reorientRelationship((Connector) relationshipView, newTargetView, ReorientRelationshipRequest.REORIENT_TARGET, isAllowed);
}
public static void reorientRelationship(Connector relationshipView, View newEndView, int reorientDirection, boolean isAllowed) throws Exception {
@@ -470,20 +482,20 @@ public class TestUtils {
String reconnectDirection = (ReorientRelationshipRequest.REORIENT_SOURCE == reorientDirection) ? RequestConstants.REQ_RECONNECT_SOURCE : RequestConstants.REQ_RECONNECT_TARGET;
ReconnectRequest reconnectRequest = new ReconnectRequest(relationshipView);
reconnectRequest.setTargetEditPart(getEditPart(newEndView));
- reconnectRequest.setConnectionEditPart((ConnectionEditPart)getEditPart(relationshipView));
+ reconnectRequest.setConnectionEditPart((ConnectionEditPart) getEditPart(relationshipView));
reconnectRequest.setType(reconnectDirection);
// Get command
Command reorientCommand = getEditPart(newEndView).getCommand(reconnectRequest);
// Test the target command
- if((reorientCommand == null) || !(reorientCommand.canExecute())) { // Non-executable command
- if(!isAllowed) {
+ if ((reorientCommand == null) || !(reorientCommand.canExecute())) { // Non-executable command
+ if (!isAllowed) {
// Current behavior matches the expected results
return;
} else {
fail("The command should be executable.");
}
} else { // Executable command
- if(!isAllowed) {
+ if (!isAllowed) {
fail("The command should not be executable.");
} else {
defaultExecutionTest(reorientCommand);
@@ -504,98 +516,98 @@ public class TestUtils {
}
public static void reorientConnectorSource(View relationshipView, View newSourceView, boolean isAllowed, List<Property> nestedPath) throws Exception {
- reorientConnector((Connector)relationshipView, newSourceView, ReorientRelationshipRequest.REORIENT_SOURCE, isAllowed, nestedPath);
+ reorientConnector((Connector) relationshipView, newSourceView, ReorientRelationshipRequest.REORIENT_SOURCE, isAllowed, nestedPath);
}
public static void reorientConnectorTarget(View relationshipView, View newTargetView, boolean isAllowed, List<Property> nestedPath) throws Exception {
- reorientConnector((Connector)relationshipView, newTargetView, ReorientRelationshipRequest.REORIENT_TARGET, isAllowed, nestedPath);
+ reorientConnector((Connector) relationshipView, newTargetView, ReorientRelationshipRequest.REORIENT_TARGET, isAllowed, nestedPath);
}
public static void reorientConnector(Connector relationshipView, View newEndView, int reorientDirection, boolean isAllowed, List<Property> nestedPath) throws Exception {
reorientRelationship(relationshipView, newEndView, reorientDirection, isAllowed);
// Abort if the command is not supposed to be executable
- if(!isAllowed) {
+ if (!isAllowed) {
return;
}
// If previous test have not failed the execution / undo / re-do has been done
- org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector)relationshipView.getElement();
+ org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector) relationshipView.getElement();
ConnectorEnd modifiedConnectorEnd = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? connector.getEnds().get(0) : connector.getEnds().get(1);
NestedConnectorEnd nestedConnectorEnd = UMLUtil.getStereotypeApplication(modifiedConnectorEnd, NestedConnectorEnd.class);
- if(nestedPath.isEmpty()) {
+ if (nestedPath.isEmpty()) {
Assert.assertNull("No nested connector end stereotype should be applied.", nestedConnectorEnd);
} else {
Assert.assertNotNull("Nested connector end stereotype should be applied.", nestedConnectorEnd);
- Assert.assertEquals("Invalid nested path", nestedPath, nestedConnectorEnd.getPropertyPath());
+ Assert.assertEquals("Invalid nested path", nestedPath, nestedConnectorEnd.getPropertyPath());
}
}
public static void reorientConnectorSourceAndTestDelegate(View relationshipView, View newSourceView, boolean isAllowed, ConnectableElement expectedSourcePartWithPort, ConnectableElement expectedTargetPartWithPort) throws Exception {
- reorientConnectorAndTestDelegate((Connector)relationshipView, newSourceView, ReorientRelationshipRequest.REORIENT_SOURCE, isAllowed, expectedSourcePartWithPort, expectedTargetPartWithPort);
+ reorientConnectorAndTestDelegate((Connector) relationshipView, newSourceView, ReorientRelationshipRequest.REORIENT_SOURCE, isAllowed, expectedSourcePartWithPort, expectedTargetPartWithPort);
}
public static void reorientConnectorTargetAndTestDelegate(View relationshipView, View newTargetView, boolean isAllowed, ConnectableElement expectedSourcePartWithPort, ConnectableElement expectedTargetPartWithPort) throws Exception {
- reorientConnectorAndTestDelegate((Connector)relationshipView, newTargetView, ReorientRelationshipRequest.REORIENT_TARGET, isAllowed, expectedSourcePartWithPort, expectedTargetPartWithPort);
+ reorientConnectorAndTestDelegate((Connector) relationshipView, newTargetView, ReorientRelationshipRequest.REORIENT_TARGET, isAllowed, expectedSourcePartWithPort, expectedTargetPartWithPort);
}
public static void reorientConnectorAndTestDelegate(Connector relationshipView, View newEndView, int reorientDirection, boolean isAllowed, ConnectableElement expectedSourcePartWithPort, ConnectableElement expectedTargetPartWithPort) throws Exception {
reorientRelationship(relationshipView, newEndView, reorientDirection, isAllowed);
// Abort if the command is not supposed to be executable
- if(!isAllowed) {
+ if (!isAllowed) {
return;
}
// If previous test have not failed the execution / undo / re-do has been done
- org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector)relationshipView.getElement();
+ org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector) relationshipView.getElement();
ConnectorEnd modifiedConnectorEnd = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? connector.getEnds().get(0) : connector.getEnds().get(1);
ConnectorEnd oppositeConnectorEnd = (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) ? connector.getEnds().get(1) : connector.getEnds().get(0);
- if(reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { // re-orient source
+ if (reorientDirection == ReorientRelationshipRequest.REORIENT_SOURCE) { // re-orient source
// Test source connector end
Assert.assertEquals("The partWithPort is incorrect for source (re-oriented).", expectedSourcePartWithPort, modifiedConnectorEnd.getPartWithPort());
- // if(modifiedConnectorEnd.getPartWithPort() != expectedSourcePartWithPort) {
- // fail("The partWithPort is incorrect for source (re-oriented).");
- // }
+ // if(modifiedConnectorEnd.getPartWithPort() != expectedSourcePartWithPort) {
+ // fail("The partWithPort is incorrect for source (re-oriented).");
+ // }
// Test target connector end
Assert.assertEquals("The partWithPort is incorrect for target (opposite end).", expectedTargetPartWithPort, oppositeConnectorEnd.getPartWithPort());
- // if(oppositeConnectorEnd.getPartWithPort() != expectedTargetPartWithPort) {
- // fail("The partWithPort is incorrect for target (opposite end).");
- // }
+ // if(oppositeConnectorEnd.getPartWithPort() != expectedTargetPartWithPort) {
+ // fail("The partWithPort is incorrect for target (opposite end).");
+ // }
} else { // re-orient target
// Test source connector end
Assert.assertEquals("The partWithPort is incorrect for target (re-oriented).", expectedTargetPartWithPort, modifiedConnectorEnd.getPartWithPort());
- // if(modifiedConnectorEnd.getPartWithPort() != expectedTargetPartWithPort) {
- // fail("The partWithPort is incorrect for target .");
- // }
+ // if(modifiedConnectorEnd.getPartWithPort() != expectedTargetPartWithPort) {
+ // fail("The partWithPort is incorrect for target .");
+ // }
// Test target connector end
Assert.assertEquals("The partWithPort is incorrect for source (opposite end).", expectedSourcePartWithPort, oppositeConnectorEnd.getPartWithPort());
- // if(oppositeConnectorEnd.getPartWithPort() != expectedSourcePartWithPort) {
- // fail("The partWithPort is incorrect for source (opposite end).");
- // }
+ // if(oppositeConnectorEnd.getPartWithPort() != expectedSourcePartWithPort) {
+ // fail("The partWithPort is incorrect for source (opposite end).");
+ // }
}
}
public static void setEncapsulationDeleteConnectorTest(Element block, View sourceView, View targetView, boolean canCreateConnector, boolean isConnectorDestroyExpected) throws Exception {
- if(!canCreateConnector) {
+ if (!canCreateConnector) {
return; // abort
}
// Make sure the block is not encapsulated before Connector creation.
TestPrepareUtils.setBlockIsEncapsulated(block, false);
// Create connector
- org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector)createEdgeFromPalette("internalblock.tool.connector", sourceView, targetView, true, true);
+ org.eclipse.uml2.uml.Connector connector = (org.eclipse.uml2.uml.Connector) createEdgeFromPalette("internalblock.tool.connector", sourceView, targetView, true, true);
// Prepare set encapsulated command and execute (with undo, re-do).
Block blockApp = UMLUtil.getStereotypeApplication(block, Block.class);
IElementEditService provider = ElementEditServiceUtils.getCommandProvider(blockApp);
- if(provider == null) {
+ if (provider == null) {
fail("Could not get IElementEditService for Block stereotype application.");
}
IEditCommandRequest setEncapsulationRequest = new SetRequest(getTransactionalEditingDomain(), blockApp, BlocksPackage.eINSTANCE.getBlock_IsEncapsulated(), true);
ICommand setEncapsulationCommand = provider.getEditCommand(setEncapsulationRequest);
defaultExecutionTest(new ICommandProxy(setEncapsulationCommand));
// Test if the Connector have been destroyed
- if(isConnectorDestroyExpected) {
- if(connector.eResource() != null) { // connector destroyed has no container
+ if (isConnectorDestroyExpected) {
+ if (connector.eResource() != null) { // connector destroyed has no container
fail("Connector was expected to be destroyed.");
}
} else {
- if(connector.eResource() == null) { // connector destroyed has no container
+ if (connector.eResource() == null) { // connector destroyed has no container
fail("Connector was not expected to be destroyed.");
}
}
@@ -605,9 +617,9 @@ public class TestUtils {
* Copy the list of objects into the Clipboard
*
* @param objectsToCopy
- * the list of objects to copy. should not be <code>null</code>, at least an empty list
+ * the list of objects to copy. should not be <code>null</code>, at least an empty list
* @throws Exception
- * exception thrown in case of problems
+ * exception thrown in case of problems
*/
public static void copyEditParts(List<Object> objectsToCopy) throws Exception {
// select elements to copy
@@ -615,16 +627,16 @@ public class TestUtils {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().bringToTop(EditorUtils.getEditor());
EditorUtils.getDiagramEditor().getEditorSite().getSelectionProvider().setSelection(new StructuredSelection(objectsToCopy));
ISelection selection = EditorUtils.getEditor().getSite().getSelectionProvider().getSelection();
- Assert.assertEquals("Selection size should be " + objectsToCopy.size(), objectsToCopy.size(), ((IStructuredSelection)selection).size());
+ Assert.assertEquals("Selection size should be " + objectsToCopy.size(), objectsToCopy.size(), ((IStructuredSelection) selection).size());
// retrieve the command for copy
- ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class);
commandService.refreshElements(IWorkbenchCommandConstants.EDIT_COPY, null);
org.eclipse.core.commands.Command copyCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_COPY);
- ((GlobalCopyAction)((ActionHandler)copyCommand.getHandler()).getAction()).setEnabled(true);
+ ((GlobalCopyAction) ((ActionHandler) copyCommand.getHandler()).getAction()).setEnabled(true);
Assert.assertNotNull("Impossible to find copy command", copyCommand);
- //EditorUtils.getDiagramEditor().getEditingDomain().setClipboard(objectsToCopy);
+ // EditorUtils.getDiagramEditor().getEditingDomain().setClipboard(objectsToCopy);
// retrieve handler service for the copy command
- IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+ IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class);
Assert.assertNotNull("Impossible to find handler service", handlerService);
final ParameterizedCommand parameterizedCommand = new ParameterizedCommand(copyCommand, null);
// retrieve the command and set some parameters on it
@@ -639,27 +651,27 @@ public class TestUtils {
* paste the list of objects into the Clipboard into the current diagram
*
* @param target
- * object on which content of the clipboard should be added
+ * object on which content of the clipboard should be added
* @param executable
- * indicates if the paste command should be executable.
+ * indicates if the paste command should be executable.
*
* @throws Exception
- * exception thrown in case of problems
+ * exception thrown in case of problems
*/
public static void pasteEditParts(Object target, boolean executable) throws Exception {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(EditorUtils.getEditor());
EditorUtils.getDiagramEditor().getEditorSite().getSelectionProvider().setSelection(new StructuredSelection(target));
// retrieve the command for copy
- ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class);
commandService.refreshElements(IWorkbenchCommandConstants.EDIT_PASTE, null);
org.eclipse.core.commands.Command pasteCommand = commandService.getCommand(IWorkbenchCommandConstants.EDIT_PASTE);
Assert.assertNotNull("Impossible to find paste command", pasteCommand);
- ((GlobalAction)((ActionHandler)pasteCommand.getHandler()).getAction()).refresh();
- IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+ ((GlobalAction) ((ActionHandler) pasteCommand.getHandler()).getAction()).refresh();
+ IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class);
Assert.assertNotNull("Impossible to find handler service", handlerService);
final ParameterizedCommand parameterizedCommand = new ParameterizedCommand(pasteCommand, null);
Assert.assertEquals("Command is not executable as expected", pasteCommand.isEnabled(), executable);
- if(executable) {
+ if (executable) {
// execute the copy command
handlerService.executeCommand(parameterizedCommand, null);
}
@@ -669,27 +681,27 @@ public class TestUtils {
* paste with model element the list of objects into the Clipboard into the current diagram
*
* @param target
- * object on which content of the clipboard should be added
+ * object on which content of the clipboard should be added
* @param executable
- * indicates if the paste command should be executable.
+ * indicates if the paste command should be executable.
*
* @throws Exception
- * exception thrown in case of problems
+ * exception thrown in case of problems
*/
public static void pasteWithModelEditParts(Object target, boolean executable) throws Exception {
PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().activate(EditorUtils.getEditor());
EditorUtils.getDiagramEditor().getEditorSite().getSelectionProvider().setSelection(new StructuredSelection(target));
// retrieve the command for copy
- ICommandService commandService = (ICommandService)PlatformUI.getWorkbench().getService(ICommandService.class);
+ ICommandService commandService = PlatformUI.getWorkbench().getService(ICommandService.class);
commandService.refreshElements(IWorkbenchCommandConstants.EDIT_PASTE, null);
org.eclipse.core.commands.Command pasteWithModelCommand = commandService.getCommand("org.eclipse.papyrus.uml.diagram.common.commands.PasteWithModelCommand");
Assert.assertNotNull("Impossible to find paste command", pasteWithModelCommand);
// ((GlobalAction)((AbstractHandlerWithState)pasteWithModelCommand.getHandler()).getAction()).refresh();
- IHandlerService handlerService = (IHandlerService)PlatformUI.getWorkbench().getService(IHandlerService.class);
+ IHandlerService handlerService = PlatformUI.getWorkbench().getService(IHandlerService.class);
Assert.assertNotNull("Impossible to find handler service", handlerService);
final ParameterizedCommand parameterizedCommand = new ParameterizedCommand(pasteWithModelCommand, null);
Assert.assertEquals("Command is not executable as expected", pasteWithModelCommand.isEnabled(), executable);
- if(executable) {
+ if (executable) {
// execute the copy command
handlerService.executeCommand(parameterizedCommand, null);
}
@@ -702,13 +714,13 @@ public class TestUtils {
* Test execution, undo, redo of the given command.
*
* @param command
- * the command to test.
+ * the command to test.
* @throws Exception
*/
public static void defaultExecutionTest(Command command) throws Exception {
// Execution in the diagram command stack (like Papyrus usual execution for GEF commands). This is important especially for
// composed command like Drop links which create intermediate view during execution. With EMF command stack, the whole command
- // tries to execute and the edit part of the intermediate created views are not created before the command ends.
+ // tries to execute and the edit part of the intermediate created views are not created before the command ends.
// The diagram command stack let edit part being created after each view creation.
// The problem in using the DiagramCommandStack (vs EMF CommandStack) is that it hides any exception that can possibly occur during
// command execution. This would let the test finish without error (the command result is not tested currently) while the execution failed.
@@ -723,24 +735,24 @@ public class TestUtils {
}
};
history.addOperationHistoryListener(historyChange);
-
+
try {
// Test execution
historyEventType = OperationHistoryEvent.DONE;
EditorUtils.getDiagramCommandStack().execute(command);
- if(historyEventType == OperationHistoryEvent.OPERATION_NOT_OK) {
+ if (historyEventType == OperationHistoryEvent.OPERATION_NOT_OK) {
fail("Command execution failed ()");
}
// Test undo
historyEventType = OperationHistoryEvent.DONE;
EditorUtils.getDiagramCommandStack().undo();
- if(historyEventType == OperationHistoryEvent.OPERATION_NOT_OK) {
+ if (historyEventType == OperationHistoryEvent.OPERATION_NOT_OK) {
fail("Command undo failed ()");
}
// Test redo
historyEventType = OperationHistoryEvent.DONE;
EditorUtils.getDiagramCommandStack().redo();
- if(historyEventType == OperationHistoryEvent.OPERATION_NOT_OK) {
+ if (historyEventType == OperationHistoryEvent.OPERATION_NOT_OK) {
fail("Command redo failed ()");
}
} finally {
@@ -748,4 +760,4 @@ public class TestUtils {
history.removeOperationHistoryListener(historyChange);
}
}
-} \ No newline at end of file
+}
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/META-INF/MANIFEST.MF b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/META-INF/MANIFEST.MF
deleted file mode 100644
index d0bcb193259..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/META-INF/MANIFEST.MF
+++ /dev/null
@@ -1,15 +0,0 @@
-Manifest-Version: 1.0
-Require-Bundle: org.eclipse.ui,
- org.eclipse.core.runtime
-Bundle-Vendor: %providerName
-Bundle-ActivationPolicy: lazy
-Bundle-Version: 1.1.0.qualifier
-Bundle-Name: %pluginName
-Bundle-Localization: plugin
-Bundle-ManifestVersion: 2
-Bundle-Activator: org.eclipse.papyrus.uml.diagram.synchronizeview.test
- .Activator
-Bundle-SymbolicName: org.eclipse.papyrus.uml.diagram.synchronizeview.t
- est
-Bundle-RequiredExecutionEnvironment: JavaSE-1.6
-
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.notation
deleted file mode 100644
index 8861ac988b0..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.notation
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_PEf-wNXyEeO4Ts63-0amCA" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
- <children xmi:type="notation:Shape" xmi:id="_DTicsNXzEeO4Ts63-0amCA" type="2007">
- <children xmi:type="notation:DecorationNode" xmi:id="_DTjDwNXzEeO4Ts63-0amCA" type="5026"/>
- <children xmi:type="notation:DecorationNode" xmi:id="_DTjDwdXzEeO4Ts63-0amCA" type="7016">
- <styles xmi:type="notation:TitleStyle" xmi:id="_DTjDwtXzEeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_M9Fw4NXzEeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DTjDw9XzEeO4Ts63-0amCA"/>
- </children>
- <element xmi:type="uml:Package" href="AddAClassIntoAPackageInTheDiagram.uml#_DTeyUNXzEeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DTicsdXzEeO4Ts63-0amCA" x="255" y="81" width="542" height="251"/>
- </children>
- <styles xmi:type="notation:DiagramStyle" xmi:id="_PEf-wdXyEeO4Ts63-0amCA"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_PEf-wtXyEeO4Ts63-0amCA">
- <owner xmi:type="uml:Model" href="AddAClassIntoAPackageInTheDiagram.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </styles>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_W2EdoNXyEeO4Ts63-0amCA"/>
- <element xmi:type="uml:Model" href="AddAClassIntoAPackageInTheDiagram.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
-</notation:Diagram>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.uml
deleted file mode 100644
index 270a881c137..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInTheDiagram.uml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NW6bkNXyEeO4Ts63-0amCA" name="model">
- <packagedElement xmi:type="uml:Package" xmi:id="_DTeyUNXzEeO4Ts63-0amCA" name="Package1"/>
-</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.notation
deleted file mode 100644
index 18da1d2bc54..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.notation
+++ /dev/null
@@ -1,19 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_PEf-wNXyEeO4Ts63-0amCA" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
- <children xmi:type="notation:Shape" xmi:id="_DTicsNXzEeO4Ts63-0amCA" type="2007">
- <children xmi:type="notation:DecorationNode" xmi:id="_DTjDwNXzEeO4Ts63-0amCA" type="5026"/>
- <children xmi:type="notation:DecorationNode" xmi:id="_DTjDwdXzEeO4Ts63-0amCA" type="7016">
- <styles xmi:type="notation:TitleStyle" xmi:id="_DTjDwtXzEeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_M9Fw4NXzEeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DTjDw9XzEeO4Ts63-0amCA"/>
- </children>
- <element xmi:type="uml:Package" href="AddAClassIntoAPackageInThemodel.uml#_DTeyUNXzEeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_DTicsdXzEeO4Ts63-0amCA" x="255" y="81" width="542" height="251"/>
- </children>
- <styles xmi:type="notation:DiagramStyle" xmi:id="_PEf-wdXyEeO4Ts63-0amCA"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_PEf-wtXyEeO4Ts63-0amCA">
- <owner xmi:type="uml:Model" href="AddAClassIntoAPackageInThemodel.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </styles>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_W2EdoNXyEeO4Ts63-0amCA"/>
- <element xmi:type="uml:Model" href="AddAClassIntoAPackageInThemodel.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
-</notation:Diagram>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.uml
deleted file mode 100644
index 270a881c137..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAClassIntoAPackageInThemodel.uml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NW6bkNXyEeO4Ts63-0amCA" name="model">
- <packagedElement xmi:type="uml:Package" xmi:id="_DTeyUNXzEeO4Ts63-0amCA" name="Package1"/>
-</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.notation
deleted file mode 100644
index 9b6c3f5a67f..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.notation
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
- <css:ModelStyleSheets xmi:id="_ix6IENXzEeO4Ts63-0amCA"/>
- <notation:Diagram xmi:id="_k2QlcNXzEeO4Ts63-0amCA" type="CompositeStructure" name="CompositeDiagram" measurementUnit="Pixel">
- <children xmi:type="notation:Shape" xmi:id="_l5oG8NXzEeO4Ts63-0amCA" type="2073">
- <children xmi:type="notation:DecorationNode" xmi:id="_l5ouANXzEeO4Ts63-0amCA" type="5156"/>
- <children xmi:type="notation:BasicCompartment" xmi:id="_l5ouAdXzEeO4Ts63-0amCA" type="7073">
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_wlNf4NXzEeO4Ts63-0amCA" source="PapyrusCSSForceValue">
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_wlNf4dXzEeO4Ts63-0amCA" key="mutable" value="true"/>
- </eAnnotations>
- <styles xmi:type="notation:TitleStyle" xmi:id="_l5ouAtXzEeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_uUlhENXzEeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_l5ouA9XzEeO4Ts63-0amCA"/>
- </children>
- <element xmi:type="uml:Class" href="AddAPartIntoACompositeInTheDiagram.uml#_l5iAUNXzEeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_l5oG8dXzEeO4Ts63-0amCA" x="376" y="60" width="606" height="378"/>
- </children>
- <styles xmi:type="notation:DiagramStyle" xmi:id="_k2QlcdXzEeO4Ts63-0amCA"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_k2QlctXzEeO4Ts63-0amCA">
- <owner xmi:type="uml:Model" href="AddAPartIntoACompositeInTheDiagram.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </styles>
- <element xmi:type="uml:Model" href="AddAPartIntoACompositeInTheDiagram.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </notation:Diagram>
-</xmi:XMI>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.uml
deleted file mode 100644
index b593535bcfc..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInTheDiagram.uml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NW6bkNXyEeO4Ts63-0amCA" name="model">
- <packagedElement xmi:type="uml:Class" xmi:id="_l5iAUNXzEeO4Ts63-0amCA" name="Class1"/>
-</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.notation
deleted file mode 100644
index 1337c6545da..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.notation
+++ /dev/null
@@ -1,24 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:css="http://www.eclipse.org/papyrus/infra/gmfdiag/css" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML">
- <css:ModelStyleSheets xmi:id="_ix6IENXzEeO4Ts63-0amCA"/>
- <notation:Diagram xmi:id="_k2QlcNXzEeO4Ts63-0amCA" type="CompositeStructure" name="CompositeDiagram" measurementUnit="Pixel">
- <children xmi:type="notation:Shape" xmi:id="_l5oG8NXzEeO4Ts63-0amCA" type="2073">
- <children xmi:type="notation:DecorationNode" xmi:id="_l5ouANXzEeO4Ts63-0amCA" type="5156"/>
- <children xmi:type="notation:BasicCompartment" xmi:id="_l5ouAdXzEeO4Ts63-0amCA" type="7073">
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_wlNf4NXzEeO4Ts63-0amCA" source="PapyrusCSSForceValue">
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_wlNf4dXzEeO4Ts63-0amCA" key="mutable" value="true"/>
- </eAnnotations>
- <styles xmi:type="notation:TitleStyle" xmi:id="_l5ouAtXzEeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_uUlhENXzEeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_l5ouA9XzEeO4Ts63-0amCA"/>
- </children>
- <element xmi:type="uml:Class" href="AddAPartIntoACompositeInThemodel.uml#_l5iAUNXzEeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="_l5oG8dXzEeO4Ts63-0amCA" x="376" y="60" width="606" height="378"/>
- </children>
- <styles xmi:type="notation:DiagramStyle" xmi:id="_k2QlcdXzEeO4Ts63-0amCA"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_k2QlctXzEeO4Ts63-0amCA">
- <owner xmi:type="uml:Model" href="AddAPartIntoACompositeInThemodel.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </styles>
- <element xmi:type="uml:Model" href="AddAPartIntoACompositeInThemodel.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </notation:Diagram>
-</xmi:XMI>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.uml
deleted file mode 100644
index b593535bcfc..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddAChildNode/AddAPartIntoACompositeInThemodel.uml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NW6bkNXyEeO4Ts63-0amCA" name="model">
- <packagedElement xmi:type="uml:Class" xmi:id="_l5iAUNXzEeO4Ts63-0amCA" name="Class1"/>
-</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.di b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.di
deleted file mode 100644
index 8634d4c00e0..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.di
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.notation
deleted file mode 100644
index e3b38325569..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.notation
+++ /dev/null
@@ -1,36 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_PEf-wNXyEeO4Ts63-0amCA" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
- <children xmi:type="notation:Shape" xmi:id="__C2_wNX0EeO4Ts63-0amCA" type="2008">
- <children xmi:type="notation:DecorationNode" xmi:id="__C2_wtX0EeO4Ts63-0amCA" type="5029"/>
- <children xmi:type="notation:BasicCompartment" xmi:id="__C2_w9X0EeO4Ts63-0amCA" type="7017">
- <styles xmi:type="notation:TitleStyle" xmi:id="__C2_xNX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="__C2_xdX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="__C2_xtX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_E4NpkNX1EeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__C2_x9X0EeO4Ts63-0amCA"/>
- </children>
- <children xmi:type="notation:BasicCompartment" xmi:id="__C2_yNX0EeO4Ts63-0amCA" type="7018">
- <styles xmi:type="notation:TitleStyle" xmi:id="__C2_ydX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="__C2_ytX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="__C2_y9X0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_FoB88NX1EeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__C2_zNX0EeO4Ts63-0amCA"/>
- </children>
- <children xmi:type="notation:BasicCompartment" xmi:id="__C2_zdX0EeO4Ts63-0amCA" type="7019">
- <styles xmi:type="notation:TitleStyle" xmi:id="__C2_ztX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="__C2_z9X0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="__C2_0NX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_Ga158NX1EeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__C2_0dX0EeO4Ts63-0amCA"/>
- </children>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_HSdecNX1EeO4Ts63-0amCA"/>
- <element xmi:type="uml:Class" href="AddAPropertyIntoAClassInTheDiagram.uml#__C0jgNX0EeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__C2_wdX0EeO4Ts63-0amCA" x="419" y="171"/>
- </children>
- <styles xmi:type="notation:DiagramStyle" xmi:id="_PEf-wdXyEeO4Ts63-0amCA"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_PEf-wtXyEeO4Ts63-0amCA">
- <owner xmi:type="uml:Model" href="AddAPropertyIntoAClassInTheDiagram.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </styles>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_W2EdoNXyEeO4Ts63-0amCA"/>
- <element xmi:type="uml:Model" href="AddAPropertyIntoAClassInTheDiagram.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
-</notation:Diagram>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.uml
deleted file mode 100644
index 1546104a877..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheDiagram.uml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NW6bkNXyEeO4Ts63-0amCA" name="model">
- <packagedElement xmi:type="uml:Class" xmi:id="__C0jgNX0EeO4Ts63-0amCA" name="Class"/>
-</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.di b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.di
deleted file mode 100644
index 8634d4c00e0..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.di
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.notation
deleted file mode 100644
index 979b320962f..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.notation
+++ /dev/null
@@ -1,39 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_PEf-wNXyEeO4Ts63-0amCA" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
- <children xmi:type="notation:Shape" xmi:id="__C2_wNX0EeO4Ts63-0amCA" type="2008">
- <children xmi:type="notation:DecorationNode" xmi:id="__C2_wtX0EeO4Ts63-0amCA" type="5029"/>
- <children xmi:type="notation:BasicCompartment" xmi:id="__C2_w9X0EeO4Ts63-0amCA" type="7017">
- <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_O1jccNX1EeO4Ts63-0amCA" source="PapyrusCSSForceValue">
- <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_O1jccdX1EeO4Ts63-0amCA" key="mutable" value="true"/>
- </eAnnotations>
- <styles xmi:type="notation:TitleStyle" xmi:id="__C2_xNX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="__C2_xdX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="__C2_xtX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_E4NpkNX1EeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__C2_x9X0EeO4Ts63-0amCA"/>
- </children>
- <children xmi:type="notation:BasicCompartment" xmi:id="__C2_yNX0EeO4Ts63-0amCA" type="7018">
- <styles xmi:type="notation:TitleStyle" xmi:id="__C2_ydX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="__C2_ytX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="__C2_y9X0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_FoB88NX1EeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__C2_zNX0EeO4Ts63-0amCA"/>
- </children>
- <children xmi:type="notation:BasicCompartment" xmi:id="__C2_zdX0EeO4Ts63-0amCA" type="7019">
- <styles xmi:type="notation:TitleStyle" xmi:id="__C2_ztX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:SortingStyle" xmi:id="__C2_z9X0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:FilteringStyle" xmi:id="__C2_0NX0EeO4Ts63-0amCA"/>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_Ga158NX1EeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__C2_0dX0EeO4Ts63-0amCA"/>
- </children>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_HSdecNX1EeO4Ts63-0amCA"/>
- <element xmi:type="uml:Class" href="AddAPropertyIntoAClassInTheModel.uml#__C0jgNX0EeO4Ts63-0amCA"/>
- <layoutConstraint xmi:type="notation:Bounds" xmi:id="__C2_wdX0EeO4Ts63-0amCA" x="419" y="171"/>
- </children>
- <styles xmi:type="notation:DiagramStyle" xmi:id="_PEf-wdXyEeO4Ts63-0amCA"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_PEf-wtXyEeO4Ts63-0amCA">
- <owner xmi:type="uml:Model" href="AddAPropertyIntoAClassInTheModel.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </styles>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_W2EdoNXyEeO4Ts63-0amCA"/>
- <element xmi:type="uml:Model" href="AddAPropertyIntoAClassInTheModel.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
-</notation:Diagram>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.uml
deleted file mode 100644
index 1546104a877..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddANodeLabel/AddAPropertyIntoAClassInTheModel.uml
+++ /dev/null
@@ -1,4 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NW6bkNXyEeO4Ts63-0amCA" name="model">
- <packagedElement xmi:type="uml:Class" xmi:id="__C0jgNX0EeO4Ts63-0amCA" name="Class"/>
-</uml:Model>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.di b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.di
deleted file mode 100644
index 8634d4c00e0..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.di
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.notation
deleted file mode 100644
index ece6ec34777..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.notation
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_PEf-wNXyEeO4Ts63-0amCA" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
- <styles xmi:type="notation:DiagramStyle" xmi:id="_PEf-wdXyEeO4Ts63-0amCA"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_PEf-wtXyEeO4Ts63-0amCA">
- <owner xmi:type="uml:Model" href="AddAClassIntoDiagram.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </styles>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_W2EdoNXyEeO4Ts63-0amCA"/>
- <element xmi:type="uml:Model" href="AddAClassIntoDiagram.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
-</notation:Diagram>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.uml
deleted file mode 100644
index 106884de079..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoDiagram.uml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NW6bkNXyEeO4Ts63-0amCA" name="model"/>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.di b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.di
deleted file mode 100644
index 8634d4c00e0..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.di
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"/>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.notation b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.notation
deleted file mode 100644
index b34ca4677fb..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.notation
+++ /dev/null
@@ -1,9 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<notation:Diagram xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:style="http://www.eclipse.org/papyrus/infra/viewpoints/policy/style" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_PEf-wNXyEeO4Ts63-0amCA" type="PapyrusUMLClassDiagram" name="ClassDiagram" measurementUnit="Pixel">
- <styles xmi:type="notation:DiagramStyle" xmi:id="_PEf-wdXyEeO4Ts63-0amCA"/>
- <styles xmi:type="style:PapyrusViewStyle" xmi:id="_PEf-wtXyEeO4Ts63-0amCA">
- <owner xmi:type="uml:Model" href="AddAClassIntoModel.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
- </styles>
- <styles xmi:type="notation:CanonicalStyle" xmi:id="_W2EdoNXyEeO4Ts63-0amCA"/>
- <element xmi:type="uml:Model" href="AddAClassIntoModel.uml#_NW6bkNXyEeO4Ts63-0amCA"/>
-</notation:Diagram>
diff --git a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.uml b/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.uml
deleted file mode 100644
index 106884de079..00000000000
--- a/tests/junit/plugins/uml/diagram/org.eclipse.papyrus.uml.diagram.synchronizeview.test/models/AddATopNode/AddAClassIntoModel.uml
+++ /dev/null
@@ -1,2 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<uml:Model xmi:version="20131001" xmlns:xmi="http://www.omg.org/spec/XMI/20131001" xmlns:uml="http://www.eclipse.org/uml2/5.0.0/UML" xmi:id="_NW6bkNXyEeO4Ts63-0amCA" name="model"/>

Back to the top