Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests')
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.classpath7
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.project28
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/META-INF/MANIFEST.MF30
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/about.html28
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/build.properties7
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch40
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.di17
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.notation57
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.uml4
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.di17
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.notation261
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.uml17
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/classProviderTest.css98
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/stylesheetTest.css55
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/Activator.java69
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/AllTests.java25
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSClassProviderTest.java98
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSStylesheetTest.java177
-rw-r--r--tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSSupportTest.java77
20 files changed, 1119 insertions, 0 deletions
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.classpath b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.classpath
@@ -0,0 +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/J2SE-1.5"/>
+ <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/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.project b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.project
new file mode 100644
index 00000000000..ddbc718c56e
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.gmfdiag.css.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..44217f8c068
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..eb2be6b5fd3
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,30 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.gmfdiag.css;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.configuration;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.model;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.properties;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.xtext;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.gmfdiag.css.xtext.ui;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core.log;bundle-version="1.0.0",
+ org.eclipse.gmf.runtime.notation;bundle-version="1.5.0",
+ org.eclipse.papyrus.infra.emf;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.core;bundle-version="1.0.0",
+ org.eclipse.papyrus.infra.widgets;bundle-version="1.0.0",
+ org.eclipse.core.resources;bundle-version="3.8.0",
+ org.eclipse.uml2.uml;bundle-version="4.0.0",
+ org.eclipse.papyrus.infra.emf.appearance;bundle-version="1.0.0",
+ org.junit;bundle-version="4.10.0"
+Export-Package: org.eclipse.papyrus.infra.gmfdiag.css.tests,
+ org.eclipse.papyrus.infra.gmfdiag.css.tests.tests
+Bundle-Vendor: Eclipse Modeling Project
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 1.0.0.qualifier
+Bundle-Name: CSS Tests (Incubation)
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.infra.gmfdiag.css.tests.Activato
+ r
+Bundle-SymbolicName: org.eclipse.papyrus.infra.gmfdiag.css.tests
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/about.html b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/build.properties b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/build.properties
new file mode 100644
index 00000000000..130df98d220
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/build.properties
@@ -0,0 +1,7 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ resources/,\
+ about.html
+src.includes = about.html
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch
new file mode 100644
index 00000000000..934fbbe559c
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/org.eclipse.papyrus.infra.gmfdiag.css.tests.launch
@@ -0,0 +1,40 @@
+<?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.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/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"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.infra.gmfdiag.css.tests.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.css.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.5 -Xms1024m -Xmx4086m"/>
+<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"/>
+<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/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.di b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.di
new file mode 100644
index 00000000000..c1e4f445dce
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/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/classProviderTest/model.notation b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.notation
new file mode 100644
index 00000000000..ad421b8149b
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.notation
@@ -0,0 +1,57 @@
+<?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:uml="http://www.eclipse.org/uml2/4.0.0/UML">
+ <notation:Diagram xmi:id="_MDVbsHTIEeG92qGoaUUGLQ" type="PapyrusUMLClassDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_PHIj4HTIEeG92qGoaUUGLQ" type="2004" fontName="Segoe UI" lineColor="0">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_PHIj4nTIEeG92qGoaUUGLQ" source="PapyrusCSSForceValue">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHIj43TIEeG92qGoaUUGLQ" key="fontHeight" value="true"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHIj5HTIEeG92qGoaUUGLQ" key="bold" value="true"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHIj5XTIEeG92qGoaUUGLQ" key="italic" value="true"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHIj5nTIEeG92qGoaUUGLQ" key="fontColor" value="true"/>
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHIj53TIEeG92qGoaUUGLQ" key="fillColor" value="true"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_PHSU4HTIEeG92qGoaUUGLQ" source="ShadowFigure">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHSU4XTIEeG92qGoaUUGLQ" key="ShadowFigure_Value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_PHSU4nTIEeG92qGoaUUGLQ" source="displayNameLabelIcon">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHSU43TIEeG92qGoaUUGLQ" key="displayNameLabelIcon_value" value="false"/>
+ </eAnnotations>
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_PHSU5HTIEeG92qGoaUUGLQ" source="QualifiedName">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHSU5XTIEeG92qGoaUUGLQ" key="QualifiedNameDepth" value="1000"/>
+ </eAnnotations>
+ <children xmi:type="notation:DecorationNode" xmi:id="_PHSU5nTIEeG92qGoaUUGLQ" type="5011"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_PHSU53TIEeG92qGoaUUGLQ" type="7006">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_PHlP0HTIEeG92qGoaUUGLQ" source="PapyrusCSSForceValue">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHlP0XTIEeG92qGoaUUGLQ" key="showTitle" value="true"/>
+ </eAnnotations>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_PHSU6HTIEeG92qGoaUUGLQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_PHSU6XTIEeG92qGoaUUGLQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_PHSU6nTIEeG92qGoaUUGLQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PHSU63TIEeG92qGoaUUGLQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_PHSU7HTIEeG92qGoaUUGLQ" type="7007">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_PHlP0nTIEeG92qGoaUUGLQ" source="PapyrusCSSForceValue">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHlP03TIEeG92qGoaUUGLQ" key="showTitle" value="true"/>
+ </eAnnotations>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_PHSU7XTIEeG92qGoaUUGLQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_PHSU7nTIEeG92qGoaUUGLQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_PHSU73TIEeG92qGoaUUGLQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PHSU8HTIEeG92qGoaUUGLQ"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_PHSU8XTIEeG92qGoaUUGLQ" type="7008">
+ <eAnnotations xmi:type="ecore:EAnnotation" xmi:id="_PHlP1HTIEeG92qGoaUUGLQ" source="PapyrusCSSForceValue">
+ <details xmi:type="ecore:EStringToStringMapEntry" xmi:id="_PHlP1XTIEeG92qGoaUUGLQ" key="showTitle" value="true"/>
+ </eAnnotations>
+ <styles xmi:type="notation:TitleStyle" xmi:id="_PHSU8nTIEeG92qGoaUUGLQ"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_PHSU83TIEeG92qGoaUUGLQ"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_PHSU9HTIEeG92qGoaUUGLQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PHSU9XTIEeG92qGoaUUGLQ"/>
+ </children>
+ <element xmi:type="uml:Interface" href="model.uml#_PGr38HTIEeG92qGoaUUGLQ"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_PHIj4XTIEeG92qGoaUUGLQ" x="271" y="159"/>
+ </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/classProviderTest.css"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.uml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.uml
new file mode 100644
index 00000000000..10f71c39957
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/classProviderTest/model.uml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_MBtEAHTIEeG92qGoaUUGLQ" name="model">
+ <packagedElement xmi:type="uml:Interface" xmi:id="_PGr38HTIEeG92qGoaUUGLQ" name="Interface1"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.di b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.di
new file mode 100644
index 00000000000..15fd7df2e2b
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/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#_o6cwoH_vEeGjwt6V_QPj1Q"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder">
+ <children>
+ <emfPageIdentifier href="model.notation#_o6cwoH_vEeGjwt6V_QPj1Q"/>
+ </children>
+ </children>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.notation b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.notation
new file mode 100644
index 00000000000..da68a47987d
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.notation
@@ -0,0 +1,261 @@
+<?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/4.0.0/UML">
+ <notation:Diagram xmi:id="_o6cwoH_vEeGjwt6V_QPj1Q" type="PapyrusUMLClassDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <children xmi:type="notation:Shape" xmi:id="_prvDoH_vEeGjwt6V_QPj1Q" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_prwRxH_vEeGjwt6V_QPj1Q" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_prwRxX_vEeGjwt6V_QPj1Q" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_prwRxn_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_prwRx3_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_prwRyH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_prwRyX_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_prwRyn_vEeGjwt6V_QPj1Q" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_prwRy3_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_prwRzH_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_prwRzX_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_prwRzn_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_prw40H_vEeGjwt6V_QPj1Q" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_prw40X_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_prw40n_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_prw403_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_prw41H_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <element xmi:type="uml:Class" href="model.uml#_pqo3cH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_prvDoX_vEeGjwt6V_QPj1Q" x="235" y="170"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_pwH0YH_vEeGjwt6V_QPj1Q" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_pwIbdn_vEeGjwt6V_QPj1Q" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pwIbd3_vEeGjwt6V_QPj1Q" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pwIbeH_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pwIbeX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pwIben_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pwIbe3_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pwIbfH_vEeGjwt6V_QPj1Q" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pwIbfX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pwIbfn_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pwIbf3_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pwIbgH_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_pwIbgX_vEeGjwt6V_QPj1Q" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_pwIbgn_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_pwIbg3_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_pwIbhH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pwIbhX_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <element xmi:type="uml:Class" href="model.uml#_pwFYIH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_pwH0YX_vEeGjwt6V_QPj1Q" x="540" y="165"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_qRBiAH_vEeGjwt6V_QPj1Q" type="2004">
+ <children xmi:type="notation:DecorationNode" xmi:id="_qRCwJn_vEeGjwt6V_QPj1Q" type="5011"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qRCwJ3_vEeGjwt6V_QPj1Q" type="7006">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qRCwKH_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qRCwKX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qRDXMH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qRDXMX_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qRDXMn_vEeGjwt6V_QPj1Q" type="7007">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qRDXM3_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qRDXNH_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qRDXNX_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qRDXNn_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qRDXN3_vEeGjwt6V_QPj1Q" type="7008">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qRDXOH_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qRDXOX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qRDXOn_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qRDXO3_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <element xmi:type="uml:Interface" href="model.uml#_qQ-esH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qRBiAX_vEeGjwt6V_QPj1Q" x="134" y="378"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_qWScgH_vEeGjwt6V_QPj1Q" type="2004">
+ <children xmi:type="notation:DecorationNode" xmi:id="_qWTqon_vEeGjwt6V_QPj1Q" type="5011"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qWTqo3_vEeGjwt6V_QPj1Q" type="7006">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qWTqpH_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qWTqpX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qWTqpn_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qWTqp3_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qWTqqH_vEeGjwt6V_QPj1Q" type="7007">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qWTqqX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qWTqqn_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qWTqq3_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qWTqrH_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qWTqrX_vEeGjwt6V_QPj1Q" type="7008">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qWTqrn_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qWTqr3_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qWTqsH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qWTqsX_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <styles xmi:type="notation:StringListValueStyle" xmi:id="_yGpacH_vEeGjwt6V_QPj1Q" name="cssClass">
+ <stringListValue>myInterface</stringListValue>
+ </styles>
+ <element xmi:type="uml:Interface" href="model.uml#_qWPZMH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qWScgX_vEeGjwt6V_QPj1Q" x="450" y="375"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_qcFigH_vEeGjwt6V_QPj1Q" type="2004">
+ <children xmi:type="notation:DecorationNode" xmi:id="_qcGwoX_vEeGjwt6V_QPj1Q" type="5011"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qcGwon_vEeGjwt6V_QPj1Q" type="7006">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qcGwo3_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qcGwpH_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qcGwpX_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qcGwpn_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qcGwp3_vEeGjwt6V_QPj1Q" type="7007">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qcGwqH_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qcGwqX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qcGwqn_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qcGwq3_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_qcGwrH_vEeGjwt6V_QPj1Q" type="7008">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_qcGwrX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_qcGwrn_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_qcGwr3_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qcGwsH_vEeGjwt6V_QPj1Q"/>
+ </children>
+ <element xmi:type="uml:Interface" href="model.uml#_qcCfMH_vEeGjwt6V_QPj1Q"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_qcFigX_vEeGjwt6V_QPj1Q" x="720" y="370"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_j7FOcIABEeGwNeJPoDbgzg" type="2007">
+ <children xmi:type="notation:DecorationNode" xmi:id="_j7HqsoABEeGwNeJPoDbgzg" type="5026"/>
+ <children xmi:type="notation:DecorationNode" xmi:id="_j7Hqs4ABEeGwNeJPoDbgzg" type="7016">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_j7HqtIABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_j7HqtYABEeGwNeJPoDbgzg"/>
+ </children>
+ <element xmi:type="uml:Package" href="model.uml#_j6agEIABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_j7FOcYABEeGwNeJPoDbgzg" x="715" y="95" width="186" height="131"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="__AfVgIABEeGwNeJPoDbgzg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="__AgjpoABEeGwNeJPoDbgzg" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__Agjp4ABEeGwNeJPoDbgzg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__AhKsIABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__AhKsYABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__AhKsoABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__AhKs4ABEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__AhKtIABEeGwNeJPoDbgzg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__AhKtYABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__AhKtoABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__AhKt4ABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__AhKuIABEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__AhKuYABEeGwNeJPoDbgzg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__AhKuoABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__AhKu4ABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__AhKvIABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__AhKvYABEeGwNeJPoDbgzg"/>
+ </children>
+ <element xmi:type="uml:Class" href="model.uml#__AZ18IABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__AfVgYABEeGwNeJPoDbgzg" x="105" y="525"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="__TuakIABEeGwNeJPoDbgzg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="__TvotIABEeGwNeJPoDbgzg" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__TvotYABEeGwNeJPoDbgzg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__TvotoABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__Tvot4ABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__TvouIABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__TvouYABEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__TvouoABEeGwNeJPoDbgzg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__Tvou4ABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__TvovIABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__TvovYABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__TwPwIABEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__TwPwYABEeGwNeJPoDbgzg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__TwPwoABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__TwPw4ABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__TwPxIABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__TwPxYABEeGwNeJPoDbgzg"/>
+ </children>
+ <styles xmi:type="notation:StringListValueStyle" xmi:id="_R7m7sIACEeGwNeJPoDbgzg" name="cssClass">
+ <stringListValue>myClass</stringListValue>
+ <stringListValue>myOtherClass</stringListValue>
+ </styles>
+ <element xmi:type="uml:Class" href="model.uml#__TtMcIABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__TuakYABEeGwNeJPoDbgzg" x="363" y="528"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="__jbqgIABEeGwNeJPoDbgzg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="__jcRl4ABEeGwNeJPoDbgzg" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__jcRmIABEeGwNeJPoDbgzg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__jcRmYABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__jcRmoABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__jcRm4ABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__jcRnIABEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__jc4oIABEeGwNeJPoDbgzg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__jc4oYABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__jc4ooABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__jc4o4ABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__jc4pIABEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="__jc4pYABEeGwNeJPoDbgzg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="__jc4poABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="__jc4p4ABEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="__jc4qIABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__jc4qYABEeGwNeJPoDbgzg"/>
+ </children>
+ <element xmi:type="uml:Class" href="model.uml#__jacYIABEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="__jbqgYABEeGwNeJPoDbgzg" x="647" y="541"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_aQdt0IACEeGwNeJPoDbgzg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_aQe79IACEeGwNeJPoDbgzg" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_aQe79YACEeGwNeJPoDbgzg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_aQe79oACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_aQe794ACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_aQe7-IACEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aQe7-YACEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_aQe7-oACEeGwNeJPoDbgzg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_aQe7-4ACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_aQe7_IACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_aQe7_YACEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aQe7_oACEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_aQfjAIACEeGwNeJPoDbgzg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_aQfjAYACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_aQfjAoACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_aQfjA4ACEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aQfjBIACEeGwNeJPoDbgzg"/>
+ </children>
+ <styles xmi:type="notation:StringListValueStyle" xmi:id="_bTq3QIACEeGwNeJPoDbgzg" name="cssClass">
+ <stringListValue>myClass</stringListValue>
+ </styles>
+ <element xmi:type="uml:Class" href="model.uml#_aQb4oIACEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_aQdt0YACEeGwNeJPoDbgzg" x="859" y="555"/>
+ </children>
+ <children xmi:type="notation:Shape" xmi:id="_b0maEIACEeGwNeJPoDbgzg" type="2008">
+ <children xmi:type="notation:DecorationNode" xmi:id="_b0oPQIACEeGwNeJPoDbgzg" type="5029"/>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_b0oPQYACEeGwNeJPoDbgzg" type="7017">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_b0oPQoACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_b0oPQ4ACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_b0oPRIACEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_b0oPRYACEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_b0oPRoACEeGwNeJPoDbgzg" type="7018">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_b0oPR4ACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_b0oPSIACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_b0oPSYACEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_b0oPSoACEeGwNeJPoDbgzg"/>
+ </children>
+ <children xmi:type="notation:BasicCompartment" xmi:id="_b0oPS4ACEeGwNeJPoDbgzg" type="7019">
+ <styles xmi:type="notation:TitleStyle" xmi:id="_b0oPTIACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:SortingStyle" xmi:id="_b0oPTYACEeGwNeJPoDbgzg"/>
+ <styles xmi:type="notation:FilteringStyle" xmi:id="_b0oPToACEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_b0oPT4ACEeGwNeJPoDbgzg"/>
+ </children>
+ <styles xmi:type="notation:StringListValueStyle" xmi:id="_dz2VAIACEeGwNeJPoDbgzg" name="cssClass">
+ <stringListValue>myClass</stringListValue>
+ </styles>
+ <element xmi:type="uml:Class" href="model.uml#_b0lL8IACEeGwNeJPoDbgzg"/>
+ <layoutConstraint xmi:type="notation:Bounds" xmi:id="_b0maEYACEeGwNeJPoDbgzg" x="490" y="610"/>
+ </children>
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_o6cwoX_vEeGjwt6V_QPj1Q"/>
+ <styles xmi:type="notation:EObjectListValueStyle" xmi:id="_wKMU0H_vEeGjwt6V_QPj1Q" name="css_stylesheets" eObjectListValue="_wKMU0X_vEeGjwt6V_QPj1Q"/>
+ <element xmi:type="uml:Model" href="model.uml#_o6SYkH_vEeGjwt6V_QPj1Q"/>
+ </notation:Diagram>
+ <css:StyleSheetReference xmi:id="_wKMU0X_vEeGjwt6V_QPj1Q" path="../../stylesheets/stylesheetTest.css"/>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.uml b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.uml
new file mode 100644
index 00000000000..e063ffd6ed3
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/model/stylesheetTest/model.uml
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_o6SYkH_vEeGjwt6V_QPj1Q" name="Model">
+ <packageImport xmi:id="_o6SYkX_vEeGjwt6V_QPj1Q">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Class" xmi:id="_pqo3cH_vEeGjwt6V_QPj1Q" name="Class1"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_pwFYIH_vEeGjwt6V_QPj1Q" name="Class2"/>
+ <packagedElement xmi:type="uml:Interface" xmi:id="_qQ-esH_vEeGjwt6V_QPj1Q" name="Interface1"/>
+ <packagedElement xmi:type="uml:Interface" xmi:id="_qWPZMH_vEeGjwt6V_QPj1Q" name="Interface2"/>
+ <packagedElement xmi:type="uml:Interface" xmi:id="_qcCfMH_vEeGjwt6V_QPj1Q" name="Interface3"/>
+ <packagedElement xmi:type="uml:Package" xmi:id="_j6agEIABEeGwNeJPoDbgzg" name="Package1"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="__AZ18IABEeGwNeJPoDbgzg" name="Class3" isAbstract="true"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="__TtMcIABEeGwNeJPoDbgzg" name="Class4" isAbstract="true"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="__jacYIABEeGwNeJPoDbgzg" name="Class5" isAbstract="true"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_aQb4oIACEeGwNeJPoDbgzg" name="Class6"/>
+ <packagedElement xmi:type="uml:Class" xmi:id="_b0lL8IACEeGwNeJPoDbgzg" name="Class7" isAbstract="true"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/classProviderTest.css b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/classProviderTest.css
new file mode 100644
index 00000000000..f45a4299049
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/classProviderTest.css
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr
+ *****************************************************************************/
+
+/**
+* Papyrus 0.9 CSS
+* Test stylesheet for #getAvailableClasses()
+*/
+
+/********************************************************
+ * All cX should be matched for Interfaces (c01 ~ c17)
+ * xX should not be matched for Interfaces
+ *******************************************************/
+
+
+/**************** Ignored Selector *********************/
+
+.anyClass {
+
+}
+
+/**************** Simple selectors *********************/
+
+
+*.c01{
+
+}
+
+Interface.c02{
+
+}
+
+.c03 {
+
+}
+
+.c04, .c05, .c06 {
+
+}
+
+Class.x01{
+
+}
+
+#x05 {
+
+}
+
+/************ Combinator selectors **************/
+
+.c07 .c08 {
+
+}
+.c09 Class.x02{
+
+}
+
+.c10 > Class.x03{
+
+}
+
+Interface.c11 + Class.x04 {
+
+}
+
+*.c12 + Interface.c13 {
+
+}
+
+/************* Combinator Conditions ****************/
+
+#x06:x07 {
+
+}
+
+.c14#x8:x09{
+
+}
+
+Interface.c15#x10{
+
+}
+
+#x11.c16 {
+
+}
+
+#x12.c17:x13 {
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/stylesheetTest.css b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/stylesheetTest.css
new file mode 100644
index 00000000000..0542d4d041f
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/resources/stylesheets/stylesheetTest.css
@@ -0,0 +1,55 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr
+ *****************************************************************************/
+
+/**
+* Papyrus 0.9 CSS
+* Main test stylesheet
+*/
+
+* {
+ gradient:red vertical;
+}
+
+Class {
+ gradient:none;
+ fillColor:red;
+}
+
+Interface {
+ fillColor:yellow;
+}
+
+Interface.myInterface {
+ fontName:KaiTi; /* TODO: The font name should be case insensitive */
+ fillColor:lightgreen;
+ gradient:dEEpSKyBluE lightgreen horizontal;
+ elementIcon:false;
+}
+
+Package {
+ fillColor:white;
+}
+
+/* White elements */
+Class.myClass.myOtherClass, Class.myClass {
+ fillColor:white;
+ gradient:none;
+ bold:false;
+ fontName: Tunga;
+}
+
+/* Blue + Gradient + Bold */
+Class[isAbstract=true] {
+ bold:true;
+ fillColor: rgb(195, 205, 255);
+ gradient: white vertical;
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/Activator.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/Activator.java
new file mode 100644
index 00000000000..5994b38d491
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/Activator.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.tests;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.gmfdiag.css.tests"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * 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);
+ }
+
+ /*
+ * (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);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/AllTests.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/AllTests.java
new file mode 100644
index 00000000000..54ee115ce9a
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/AllTests.java
@@ -0,0 +1,25 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.tests.tests;
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+
+@RunWith(Suite.class)
+@SuiteClasses({ CSSClassProviderTest.class, CSSStylesheetTest.class
+
+})
+public class AllTests {
+
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSClassProviderTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSClassProviderTest.java
new file mode 100644
index 00000000000..a6946632989
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSClassProviderTest.java
@@ -0,0 +1,98 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.tests.tests;
+
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Iterator;
+import java.util.List;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.engine.ExtendedCSSEngine;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.CSSHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
+import org.eclipse.papyrus.infra.gmfdiag.css.provider.CSSClassContentProvider;
+import org.eclipse.papyrus.infra.gmfdiag.css.tests.Activator;
+import org.eclipse.papyrus.infra.widgets.providers.IStaticContentProvider;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class CSSClassProviderTest {
+
+ private CSSDiagram diagram;
+
+ private static int expectedNumberOfClasses = 17;
+
+ @Before
+ public void init() {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ CSSHelper.installCSSSupport(resourceSet);
+
+ URI uri = URI.createPlatformPluginURI(Activator.PLUGIN_ID + "/resources/model/classProviderTest/model.notation", true);
+ try {
+ Diagram diagram = (Diagram)EMFHelper.loadEMFModel(resourceSet, uri);
+ Assert.assertNotNull("Cannot find the model", diagram);
+ Assert.assertTrue("CSS are not activated on this resource", diagram instanceof CSSDiagram);
+ this.diagram = (CSSDiagram)diagram;
+ } catch (IOException ex) {
+ Activator.log.error(ex);
+ }
+ }
+
+ @Test
+ public void testCSSClassContentProvider() {
+ ExtendedCSSEngine engine = diagram.getEngine();
+ IStaticContentProvider provider = new CSSClassContentProvider("Interface", engine);
+ Object[] result = provider.getElements();
+ List<Object> resultList = Arrays.asList(result);
+
+ //Result is expected to contain c01 to c17
+ //Result should not contain x01 to x13
+ //Result may contain anything else (Depending on the current Workspace Theme).
+
+ //Check that all expected classes are returned
+ for(int i = 1; i <= expectedNumberOfClasses; i++) {
+ String expectedClassName = "c";
+ if(i < 10) {
+ expectedClassName += "0";
+ }
+ expectedClassName += i;
+ Assert.assertTrue("An expected CSS Class has not been found: " + expectedClassName, resultList.contains(expectedClassName));
+ }
+
+ //Check that no invalid class is returned
+ for(Object object : resultList) {
+ Assert.assertTrue("The CSSClassContentProvider must return Strings", object instanceof String);
+ String cssClass = (String)object;
+
+ Assert.assertFalse("Invalid CSS Class has been returned: " + cssClass, cssClass.matches("x[0-9]+"));
+ }
+ }
+
+ @After
+ public void dispose() {
+ Iterator<Resource> iterator = diagram.eResource().getResourceSet().getResources().iterator();
+ while(iterator.hasNext()) {
+ iterator.next().unload();
+ iterator.remove();
+ }
+ }
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSStylesheetTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSStylesheetTest.java
new file mode 100644
index 00000000000..0c1efe15355
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSStylesheetTest.java
@@ -0,0 +1,177 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.tests.tests;
+
+import java.io.IOException;
+import java.util.Iterator;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.GradientStyle;
+import org.eclipse.gmf.runtime.notation.Shape;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.infra.emf.appearance.helper.AppearanceHelper;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.CSSHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
+import org.eclipse.papyrus.infra.gmfdiag.css.tests.Activator;
+import org.eclipse.uml2.uml.NamedElement;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+
+
+public class CSSStylesheetTest {
+
+ private CSSDiagram diagram;
+
+ @Before
+ public void init() {
+ ResourceSet resourceSet = new ResourceSetImpl();
+ CSSHelper.installCSSSupport(resourceSet);
+
+ URI uri = URI.createPlatformPluginURI(Activator.PLUGIN_ID + "/resources/model/stylesheetTest/model.notation", true);
+ try {
+ Diagram diagram = (Diagram)EMFHelper.loadEMFModel(resourceSet, uri);
+ Assert.assertNotNull("Cannot find the model", diagram);
+ Assert.assertTrue("CSS are not activated on this resource", diagram instanceof CSSDiagram);
+ this.diagram = (CSSDiagram)diagram;
+ } catch (IOException ex) {
+ Activator.log.error(ex);
+ }
+ }
+
+ @Test
+ public void testClassStyle() {
+ Shape classView = findShape("Class1");
+ if(classView == null) {
+ return;
+ }
+
+ Assert.assertEquals("Invalid color", rgb(255, 0, 0), classView.getFillColor()); //Red = #FF0000
+ Assert.assertNull("Invalid gradient", classView.getGradient());
+ Assert.assertTrue(AppearanceHelper.showElementIcon(classView));
+ }
+
+ @Test
+ public void testInterfaceStyle() {
+ Shape interfaceView = findShape("Interface1");
+
+ Assert.assertNotNull(interfaceView.getGradient());
+ Assert.assertEquals(rgb(255, 255, 0), interfaceView.getFillColor()); //Yellow = #FFFF00
+ Assert.assertEquals(rgb(255, 0, 0), interfaceView.getGradient().getGradientColor1()); //Red = #FF0000
+ Assert.assertEquals(GradientStyle.VERTICAL, interfaceView.getGradient().getGradientStyle());
+ Assert.assertTrue(AppearanceHelper.showElementIcon(interfaceView));
+ }
+
+ @Test
+ public void testCSSClassStyle() {
+ Shape interfaceView = findShape("Interface2");
+ Assert.assertNotNull(interfaceView.getGradient());
+ Assert.assertEquals(rgb(144, 238, 144), interfaceView.getFillColor()); //Lightgreen = #90EE90
+
+ //Case insensitive color name
+ Assert.assertEquals(rgb(0, 191, 255), interfaceView.getGradient().getGradientColor1()); //DeepSkyBlue = #00BFFF
+
+ Assert.assertEquals(GradientStyle.HORIZONTAL, interfaceView.getGradient().getGradientStyle());
+ Assert.assertFalse(AppearanceHelper.showElementIcon(interfaceView));
+
+ //TODO: Font names should be case-insensitive
+ Assert.assertEquals("KaiTi", interfaceView.getFontName());
+ }
+
+ @Test
+ public void testPackage() {
+ Shape packageView = findShape("Package1");
+ Assert.assertNotNull(packageView.getGradient());
+
+ //Inherited style (From *)
+ Assert.assertEquals(rgb(255, 0, 0), packageView.getGradient().getGradientColor1()); //Red = #FF0000
+ }
+
+ @Test
+ public void testPriorities() {
+ //Tests the priorities between styles:
+ //.myClass : Low priority
+ //.myClass.myOtherClass : Highest priority
+ //[isAbstract=true] : Medium priority
+ //Styles should also be merged when they aren't conflicting (ie. [isAbstract] + .myClass -> fontName = Tunga)
+ Shape class3 = findShape("Class3");
+ Shape class5 = findShape("Class5");
+
+ testBlueStyle(class3); //isAbstract
+ testBlueStyle(class5); //isAbstract
+
+ Shape class4 = findShape("Class4");
+
+ testWhiteStyle(class4); //.myClass.myOtherClass (Overrides isAbstract)
+ testFontName(class4); //.myClass (Doesn't conflict with isAbstract)
+
+ Shape class6 = findShape("Class6");
+
+ testWhiteStyle(class6); //.myClass
+ testFontName(class6); //.myClass
+
+ Shape class7 = findShape("Class7");
+
+ testBlueStyle(class7); //isAbstract
+ testFontName(class7); //.myClass (Doesn't conflict with isAbstract)
+ }
+
+ private void testBlueStyle(Shape shape) {
+ Assert.assertEquals(rgb(195, 205, 255), shape.getFillColor()); //rgb syntax
+ Assert.assertTrue(shape.isBold());
+ Assert.assertNotNull(shape.getGradient());
+ }
+
+ private void testWhiteStyle(Shape shape) {
+ Assert.assertEquals(rgb(255, 255, 255), shape.getFillColor()); //White = #FFFFFF (Hexa syntax)
+ Assert.assertFalse(shape.isBold());
+ Assert.assertNull(shape.getGradient());
+ }
+
+ private void testFontName(Shape shape) {
+ Assert.assertEquals("Tunga", shape.getFontName());
+ }
+
+ @After
+ public void dispose() {
+ Iterator<Resource> iterator = diagram.eResource().getResourceSet().getResources().iterator();
+ while(iterator.hasNext()) {
+ iterator.next().unload();
+ iterator.remove();
+ }
+ }
+
+ private int rgb(int red, int green, int blue) {
+ return red | green << 8 | blue << 16;
+ }
+
+ private Shape findShape(String elementName) {
+ for(Object viewObject : diagram.getChildren()) {
+ View view = (View)viewObject;
+ if(view instanceof Shape && view.getElement() instanceof NamedElement) {
+ NamedElement element = (NamedElement)view.getElement();
+ if(elementName.equals(element.getName())) {
+ return (Shape)view;
+ }
+ }
+ }
+
+ Assert.fail("Cannot find the view associated to " + elementName);
+ return null;
+ }
+}
diff --git a/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSSupportTest.java b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSSupportTest.java
new file mode 100644
index 00000000000..c0fb3f6647a
--- /dev/null
+++ b/tests/junit/plugins/infra/gmfdiag/org.eclipse.papyrus.infra.gmfdiag.css.tests/src/org/eclipse/papyrus/infra/gmfdiag/css/tests/tests/CSSSupportTest.java
@@ -0,0 +1,77 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * 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:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.gmfdiag.css.tests.tests;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.infra.emf.utils.EMFHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.helper.CSSHelper;
+import org.eclipse.papyrus.infra.gmfdiag.css.notation.CSSDiagram;
+import org.eclipse.papyrus.infra.gmfdiag.css.tests.Activator;
+import org.junit.Assert;
+import org.junit.Test;
+
+/**
+ * Test the installation of CSS Support on a standard ResourceSet
+ *
+ * @author Camille Letavernier
+ *
+ */
+public class CSSSupportTest {
+
+ /**
+ * Installs the CSS support on a resource set and check the results
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testCSSSupport() throws Exception {
+ //Resource set with CSS Support installed
+ ResourceSet resourceSetWithCSSSupport = new ResourceSetImpl();
+ CSSHelper.installCSSSupport(resourceSetWithCSSSupport);
+
+ URI uri = URI.createPlatformPluginURI(Activator.PLUGIN_ID + "/resources/model/stylesheetTest/model.notation", true);
+
+ Diagram diagram = (Diagram)EMFHelper.loadEMFModel(resourceSetWithCSSSupport, uri);
+
+ //The diagram should be a CSSDiagram
+ Assert.assertTrue(diagram instanceof CSSDiagram);
+
+ CSSDiagram cssDiagram = (CSSDiagram)diagram;
+
+ //The CSSDiagram should have a CSSEngine
+ Assert.assertNotNull(cssDiagram.getEngine());
+
+ //Dispose the CSS Engine
+ resourceSetWithCSSSupport.getResources().remove(diagram.eResource());
+ }
+
+ /**
+ * Tests a standard resource set (without CSS support) and check the results.
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testWithoutCSSSupport() throws Exception {
+ //Standard resource set (Without CSS Support installed)
+ ResourceSet resourceSetWithoutCSSSupport = new ResourceSetImpl();
+
+ URI uri = URI.createPlatformPluginURI(Activator.PLUGIN_ID + "/resources/model/stylesheetTest/model.notation", true);
+
+ Diagram diagram = (Diagram)EMFHelper.loadEMFModel(resourceSetWithoutCSSSupport, uri);
+
+ //The diagram should be a standard GMF Diagram (i.e. not a CSSDiagram)
+ Assert.assertFalse(diagram instanceof CSSDiagram);
+ }
+}

Back to the top