Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2015-03-04 16:23:49 +0000
committerChristian W. Damus2015-03-06 14:43:06 +0000
commitc9f4915173b4bfd8a08c180f4c9081e79530d4c7 (patch)
treec3a44b6e862548200bd5ac3057b9dae966c902bb /tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources
parent7e625965910374da4360f696be484e8242fe48cd (diff)
downloadorg.eclipse.papyrus-c9f4915173b4bfd8a08c180f4c9081e79530d4c7.tar.gz
org.eclipse.papyrus-c9f4915173b4bfd8a08c180f4c9081e79530d4c7.tar.xz
org.eclipse.papyrus-c9f4915173b4bfd8a08c180f4c9081e79530d4c7.zip
Bug 461595: [CSS] Support inference of standard notation styles
https://bugs.eclipse.org/bugs/show_bug.cgi?id=461595 Support CSS inference of single-attribute standard styles such as CanonicalStyle. Fix NPEs resulting from attempts to initialize the CSS engine while a Diagram is unattached to any resource, such as occurs in the set-up of certain State Machine Diagram tests that started failing after standard styles such as CanonicalStyle started delegating to CSS. Now, the CSS-aware diagram safely creates a local-only CSS engine when not in a resource and EMF's hook for setting the direct resource is used to purge and re-initialize the engine when the diagram is added to/removed from a resource.
Diffstat (limited to 'tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources')
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.di17
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.notation82
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.uml6
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/inferredNotationStylesTest.css24
4 files changed, 129 insertions, 0 deletions
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.di b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.di
new file mode 100644
index 00000000000..dd040596777
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.di
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="ASCII"?>
+<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
+ <pageList>
+ <availablePage>
+ <emfPageIdentifier href="model.notation#_MDVbsHTIEeG92qGoaUUGLQ"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder">
+ <children>
+ <emfPageIdentifier href="model.notation#_MDVbsHTIEeG92qGoaUUGLQ"/>
+ </children>
+ </children>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.notation b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.notation
new file mode 100644
index 00000000000..ada4416768d
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.notation
@@ -0,0 +1,82 @@
+<?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:uml="http://www.eclipse.org/uml2/5.0.0/UML">
+ <notation:Diagram xmi:id="_MDVbsHTIEeG92qGoaUUGLQ" type="PapyrusUMLClassDiagram" name="main" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_cO9GAMQEEeSR9Nn53D1mFA" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_cO-UIMQEEeSR9Nn53D1mFA" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_cO-7MMQEEeSR9Nn53D1mFA" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_cO-7McQEEeSR9Nn53D1mFA" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_cO-7MsQEEeSR9Nn53D1mFA" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_cO-7M8QEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_cO-7NMQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_cO-7NcQEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cO-7NsQEEeSR9Nn53D1mFA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_cO_iQMQEEeSR9Nn53D1mFA" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_cO_iQcQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_cO_iQsQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_cO_iQ8QEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cO_iRMQEEeSR9Nn53D1mFA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_cO_iRcQEEeSR9Nn53D1mFA" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_cO_iRsQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_cO_iR8QEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_cO_iSMQEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cO_iScQEEeSR9Nn53D1mFA"/>
+ </children>
+ <element xmi:type="uml:Class" href="model.uml#_cOP7YMQEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_cO9GAcQEEeSR9Nn53D1mFA" x="33" y="58"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_drmqMMQEEeSR9Nn53D1mFA" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_drmqMsQEEeSR9Nn53D1mFA" type="5029"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_drnRQMQEEeSR9Nn53D1mFA" type="8510">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_drnRQcQEEeSR9Nn53D1mFA" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_drnRQsQEEeSR9Nn53D1mFA" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_drnRQ8QEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_drnRRMQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_drnRRcQEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_drnRRsQEEeSR9Nn53D1mFA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_drnRR8QEEeSR9Nn53D1mFA" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_drnRSMQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_drnRScQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_drnRSsQEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_drnRS8QEEeSR9Nn53D1mFA"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_drn4UMQEEeSR9Nn53D1mFA" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_drn4UcQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_drn4UsQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_drn4U8QEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_drn4VMQEEeSR9Nn53D1mFA"/>
+ </children>
+ <styles xmi:type="notation:StringListValueStyle" xmi:id="_-gCwoMQEEeSR9Nn53D1mFA" name="cssClass">
+ <stringListValue>unsynchronized</stringListValue>
+ </styles>
+ <element xmi:type="uml:Class" href="model.uml#_drk1AMQEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_drmqMcQEEeSR9Nn53D1mFA" x="159" y="58"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_hKqLAMQEEeSR9Nn53D1mFA" type="2006">
+ <children xmi:type="notation:DecorationNode" xmi:id="_hKqLAsQEEeSR9Nn53D1mFA" type="5023"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_hKqyEMQEEeSR9Nn53D1mFA" type="8508">
+ <layoutConstraint xmi:type="notation:Location" xmi:id="_hKqyEcQEEeSR9Nn53D1mFA" y="5"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_hKqyEsQEEeSR9Nn53D1mFA" type="7015">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_hKqyE8QEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_hKqyFMQEEeSR9Nn53D1mFA"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_hKqyFcQEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hKqyFsQEEeSR9Nn53D1mFA"/>
+ </children>
+ <styles xmi:type="notation:StringListValueStyle" xmi:id="__7bwkMQEEeSR9Nn53D1mFA" name="cssClass">
+ <stringListValue>synchronized</stringListValue>
+ </styles>
+ <element xmi:type="uml:Enumeration" href="model.uml#_hKoV0MQEEeSR9Nn53D1mFA"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_hKqLAcQEEeSR9Nn53D1mFA" x="282" y="57"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_MDVbsXTIEeG92qGoaUUGLQ"/>
+ <styles xmi:type="notation:EObjectListValueStyle" xmi:id="_ifHmEHTlEeGmJ4iNo0Pbxg" name="css_stylesheets" eObjectListValue="_ifHmEXTlEeGmJ4iNo0Pbxg"/>
+ <element xmi:type="uml:Model" href="model.uml#_MBtEAHTIEeG92qGoaUUGLQ"/>
+ </notation:Diagram>
+ <css:StyleSheetReference xmi:id="_ifHmEXTlEeGmJ4iNo0Pbxg" path="/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/inferredNotationStylesTest.css"/>
+ <css:ModelStyleSheets xmi:id="_pfpgAMQEEeSR9Nn53D1mFA"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.uml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.uml
new file mode 100644
index 00000000000..e73dccbb71b
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/inferredNotationStylesTest/model.uml
@@ -0,0 +1,6 @@
+<?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="_MBtEAHTIEeG92qGoaUUGLQ" name="model">
+ <packagedElement xmi:type="uml:Class" xmi:id="_cOP7YMQEEeSR9Nn53D1mFA" name="Foo"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_drk1AMQEEeSR9Nn53D1mFA" name="Unsynchronized"/>
+ <packagedElement xmi:type="uml:Enumeration" xmi:id="_hKoV0MQEEeSR9Nn53D1mFA" name="Synchronized"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/inferredNotationStylesTest.css b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/inferredNotationStylesTest.css
new file mode 100644
index 00000000000..aed033aca5f
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/inferredNotationStylesTest.css
@@ -0,0 +1,24 @@
+/*****************************************************************************
+ * 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
+}
+
+.synchronized {
+ canonical: true
+}
+
+.unsynchronized {
+ canonical: false
+} \ No newline at end of file

Back to the top