Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorrschnekenbu2011-04-29 09:19:58 +0000
committerrschnekenbu2011-04-29 09:19:58 +0000
commit63447e0ad08ed88d69eab5a2491dc1ceb603a876 (patch)
tree128ef2982ad985755d9357b60d3d1a404087f64c /tests
parenta9353112486d7955ac4305af5c6890fc63e33259 (diff)
downloadorg.eclipse.papyrus-63447e0ad08ed88d69eab5a2491dc1ceb603a876.tar.gz
org.eclipse.papyrus-63447e0ad08ed88d69eab5a2491dc1ceb603a876.tar.xz
org.eclipse.papyrus-63447e0ad08ed88d69eab5a2491dc1ceb603a876.zip
Move the plugin from incoming folder to its final destination folder
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.classpath7
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.project28
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/ExtendedPluginPaletteProviderTests.launch42
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/META-INF/MANIFEST.MF10
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/about.html28
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/build.properties8
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/fragment.xml33
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/debug.gifbin0 -> 348 bytes
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/testIcon.pngbin0 -> 498 bytes
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.extendedtypes98
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.modifysemanticvaluesactionconfiguration11
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.paletteconfiguration29
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/EXtendedPluginPaletteProviderTests_PapyrusService.java131
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration.java112
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry.java256
-rw-r--r--tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ITestConstants.java28
17 files changed, 829 insertions, 0 deletions
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.classpath b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.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/core/org.eclipse.papyrus.paletteconfiguration.tests/.project b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.project
new file mode 100644
index 00000000000..2a9eddc275d
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.paletteconfiguration.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/core/org.eclipse.papyrus.paletteconfiguration.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..d11fadad096
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Wed Oct 27 15:30:49 CEST 2010
+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/core/org.eclipse.papyrus.paletteconfiguration.tests/ExtendedPluginPaletteProviderTests.launch b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/ExtendedPluginPaletteProviderTests.launch
new file mode 100644
index 00000000000..e2ec300248c
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/ExtendedPluginPaletteProviderTests.launch
@@ -0,0 +1,42 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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="bad_container_name" value="\org.eclipse.papyrus.paletteconfiguration.tests\launcher"/>
+<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.paletteconfiguration.tests"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="4"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value="=org.eclipse.papyrus.paletteconfiguration.tests"/>
+<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=""/>
+<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.paletteconfiguration.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 -Xms40m -Xmx512m"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.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="true"/>
+<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/core/org.eclipse.papyrus.paletteconfiguration.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..4c59a81b777
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Tests fragment for palette configuration plugin
+Bundle-SymbolicName: org.eclipse.papyrus.paletteconfiguration.tests;singleton:=true
+Bundle-Version: 0.8.0.qualifier
+Bundle-Vendor: CEA LIST
+Fragment-Host: org.eclipse.papyrus.paletteconfiguration;bundle-version="0.7.1"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit;bundle-version="4.8.1",
+ org.eclipse.papyrus.core.queries.test;bundle-version="0.7.0"
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/about.html b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.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/core/org.eclipse.papyrus.paletteconfiguration.tests/build.properties b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/build.properties
new file mode 100644
index 00000000000..ab8c5329d2c
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/build.properties
@@ -0,0 +1,8 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ icons/,\
+ model/,\
+ fragment.xml,\
+ about.html
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/fragment.xml b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/fragment.xml
new file mode 100644
index 00000000000..b00c7562eb0
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/fragment.xml
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<fragment>
+ <extension
+ id="org.eclipse.papyrus.paletteconfiguration.tests.test1"
+ name="Test PaletteConfiguration provider with file Test1.paletteConfiguration"
+ point="org.eclipse.papyrus.diagram.common.paletteDefinition">
+ <paletteDefinition
+ ID="org.eclipse.papyrus.paletteconfiguration.tests.test1"
+ class="org.eclipse.papyrus.paletteconfiguration.provider.ExtendedPluginPaletteProvider"
+ icon="icons/debug.gif"
+ name="Test PaletteConfiguration provider with file Test1.paletteConfiguration"
+ path="/model/Test1.paletteConfiguration"
+ provider="CEA LIST">
+ <Priority
+ name="Lowest">
+ </Priority>
+ <editor
+ id="org.eclipse.papyrus.diagram.clazz">
+ </editor>
+ </paletteDefinition>
+ </extension>
+<extension
+ point="org.eclipse.papyrus.extendedtypes.extendedTypesSetConfiguration">
+ <configuration
+ description="Test - extended types for UML"
+ icon="icons/debug.gif"
+ name="Test - Class diagram Test types"
+ path="model/Test1.extendedtypes"
+ id="test1.palette">
+ </configuration>
+ </extension>
+</fragment>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/debug.gif b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/debug.gif
new file mode 100644
index 00000000000..ac5431fa311
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/debug.gif
Binary files differ
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/testIcon.png b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/testIcon.png
new file mode 100644
index 00000000000..be8651ef953
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/icons/testIcon.png
Binary files differ
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.extendedtypes b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.extendedtypes
new file mode 100644
index 00000000000..46559108d3d
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.extendedtypes
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<extendedtypes:ExtendedElementTypeSet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:applystereotypeactionconfiguration="http://www.eclipse.org/papyrus/diagram/types/applystereotypeactionconfiguration/0.7" xmlns:modifysemanticvaluesactionconfiguration="http://www.eclipse.org/papyrus/diagram/types/modifysemanticvaluesactionconfiguration/0.8" xmlns:configuration="http://www.eclipse.org/papyrus/core/queries/0.7" xmlns:extendedtypes="http://www.eclipse.org/papyrus/diagram/types/extendedtypes/0.7" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" id="test1.palette">
+ <elementType name="Metaclass " id="org.eclipse.papyrus.uml.extended.tests.Class_2008_Metaclass" hint="2008" preValidation="configuration:ModiscoQueryConfiguration ../../../plugin/org.eclipse.papyrus.core.queries.test/resources/IsNameLongerThanQueryConfiguration1.configuration#/">
+ <iconEntry iconPath="/icons/full/obj16/Class.gif" bundleId="org.eclipse.uml2.uml.edit"/>
+ <specializedTypesID>org.eclipse.papyrus.uml.Class</specializedTypesID>
+ <postAction xsi:type="modifysemanticvaluesactionconfiguration:ModifySemanticValuesActionConfiguration">
+ <featuresToSet featureName="isAbstract">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:ConstantValue">
+ <valueInstance xsi:type="uml:LiteralBoolean" value="true"/>
+ </value>
+ </featuresToSet>
+ <featuresToSet featureName="visibility">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:DynamicValue"/>
+ </featuresToSet>
+ </postAction>
+ <postAction xsi:type="applystereotypeactionconfiguration:ApplyStereotypeActionConfiguration">
+ <stereotypesToApply stereotypeQualifiedName="Standard::Metaclass" updateName="true">
+ <requiredProfiles>Standard</requiredProfiles>
+ </stereotypesToApply>
+ </postAction>
+ </elementType>
+ <elementType name="TestClass1ExtendedElementType " id="org.eclipse.papyrus.uml.extended.tests.Class_3004_Metaclass" hint="3004" preValidation="configuration:ModiscoQueryConfiguration ../../../plugin/org.eclipse.papyrus.core.queries.test/resources/IsNameLongerThanQueryConfiguration1.configuration#/">
+ <iconEntry iconPath="/icons/full/obj16/Class.gif" bundleId="org.eclipse.uml2.uml.edit"/>
+ <specializedTypesID>org.eclipse.papyrus.uml.Class</specializedTypesID>
+ <postAction xsi:type="modifysemanticvaluesactionconfiguration:ModifySemanticValuesActionConfiguration">
+ <featuresToSet featureName="isAbstract">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:ConstantValue">
+ <valueInstance xsi:type="uml:LiteralBoolean" value="true"/>
+ </value>
+ </featuresToSet>
+ <featuresToSet featureName="visibility">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:DynamicValue"/>
+ </featuresToSet>
+ </postAction>
+ <postAction xsi:type="applystereotypeactionconfiguration:ApplyStereotypeActionConfiguration">
+ <stereotypesToApply stereotypeQualifiedName="Standard::Metaclass" updateName="true">
+ <requiredProfiles>Standard</requiredProfiles>
+ </stereotypesToApply>
+ </postAction>
+ </elementType>
+ <elementType name="TestClass1ExtendedElementType " id="org.eclipse.papyrus.uml.extended.tests.Class_3008_Metaclass" hint="3008" preValidation="configuration:ModiscoQueryConfiguration ../../../plugin/org.eclipse.papyrus.core.queries.test/resources/IsNameLongerThanQueryConfiguration1.configuration#/">
+ <iconEntry iconPath="/icons/full/obj16/Class.gif" bundleId="org.eclipse.uml2.uml.edit"/>
+ <specializedTypesID>org.eclipse.papyrus.uml.Class</specializedTypesID>
+ <postAction xsi:type="modifysemanticvaluesactionconfiguration:ModifySemanticValuesActionConfiguration">
+ <featuresToSet featureName="isAbstract">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:ConstantValue">
+ <valueInstance xsi:type="uml:LiteralBoolean" value="true"/>
+ </value>
+ </featuresToSet>
+ <featuresToSet featureName="visibility">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:DynamicValue"/>
+ </featuresToSet>
+ </postAction>
+ <postAction xsi:type="applystereotypeactionconfiguration:ApplyStereotypeActionConfiguration">
+ <stereotypesToApply stereotypeQualifiedName="Standard::Metaclass" updateName="true">
+ <requiredProfiles>Standard</requiredProfiles>
+ </stereotypesToApply>
+ </postAction>
+ </elementType>
+ <elementType name="TestClass1ExtendedElementType " id="org.eclipse.papyrus.uml.extended.tests.Class_3010_Metaclass" hint="3010" preValidation="configuration:ModiscoQueryConfiguration ../../../plugin/org.eclipse.papyrus.core.queries.test/resources/IsNameLongerThanQueryConfiguration1.configuration#/">
+ <iconEntry iconPath="/icons/full/obj16/Class.gif" bundleId="org.eclipse.uml2.uml.edit"/>
+ <specializedTypesID>org.eclipse.papyrus.uml.Class</specializedTypesID>
+ <postAction xsi:type="modifysemanticvaluesactionconfiguration:ModifySemanticValuesActionConfiguration">
+ <featuresToSet featureName="isAbstract">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:ConstantValue">
+ <valueInstance xsi:type="uml:LiteralBoolean" value="true"/>
+ </value>
+ </featuresToSet>
+ <featuresToSet featureName="visibility">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:DynamicValue"/>
+ </featuresToSet>
+ </postAction>
+ <postAction xsi:type="applystereotypeactionconfiguration:ApplyStereotypeActionConfiguration">
+ <stereotypesToApply stereotypeQualifiedName="Standard::Metaclass" updateName="true">
+ <requiredProfiles>Standard</requiredProfiles>
+ </stereotypesToApply>
+ </postAction>
+ </elementType>
+ <elementType name="TestClass1ExtendedElementType " id="org.eclipse.papyrus.uml.extended.tests.Class_3014_Metaclass" hint="3014" preValidation="configuration:ModiscoQueryConfiguration ../../../plugin/org.eclipse.papyrus.core.queries.test/resources/IsNameLongerThanQueryConfiguration1.configuration#/">
+ <iconEntry iconPath="/icons/full/obj16/Class.gif" bundleId="org.eclipse.uml2.uml.edit"/>
+ <specializedTypesID>org.eclipse.papyrus.uml.Class</specializedTypesID>
+ <postAction xsi:type="modifysemanticvaluesactionconfiguration:ModifySemanticValuesActionConfiguration">
+ <featuresToSet featureName="isAbstract">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:ConstantValue">
+ <valueInstance xsi:type="uml:LiteralBoolean" value="true"/>
+ </value>
+ </featuresToSet>
+ <featuresToSet featureName="visibility">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:DynamicValue"/>
+ </featuresToSet>
+ </postAction>
+ <postAction xsi:type="applystereotypeactionconfiguration:ApplyStereotypeActionConfiguration">
+ <stereotypesToApply stereotypeQualifiedName="Standard::Metaclass" updateName="true">
+ <requiredProfiles>Standard</requiredProfiles>
+ </stereotypesToApply>
+ </postAction>
+ </elementType>
+</extendedtypes:ExtendedElementTypeSet>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.modifysemanticvaluesactionconfiguration b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.modifysemanticvaluesactionconfiguration
new file mode 100644
index 00000000000..f99ecedf351
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.modifysemanticvaluesactionconfiguration
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<modifysemanticvaluesactionconfiguration:ModifySemanticValuesActionConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:modifysemanticvaluesactionconfiguration="http://www.eclipse.org/papyrus/diagram/types/modifysemanticvaluesactionconfiguration/0.8" xmlns:uml="http://www.eclipse.org/uml2/3.0.0/UML" label="Test1 Class" id="Test1.class">
+ <featuresToSet featureName="isAbstract">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:ConstantValue">
+ <valueInstance xsi:type="uml:LiteralBoolean" value="true"/>
+ </value>
+ </featuresToSet>
+ <featuresToSet featureName="visibility">
+ <value xsi:type="modifysemanticvaluesactionconfiguration:DynamicValue"/>
+ </featuresToSet>
+</modifysemanticvaluesactionconfiguration:ModifySemanticValuesActionConfiguration>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.paletteconfiguration b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.paletteconfiguration
new file mode 100644
index 00000000000..b29dadb3231
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/model/Test1.paletteconfiguration
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<paletteconfiguration:PaletteConfiguration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:paletteconfiguration="http://www.eclipse.org/papyrus/diagram/paletteconfiguration/0.7" id="org.eclipse.papyrus.paletteconfiguration.tests.palettetest1" label="PaletteTest1" description="Test palette for the palette configuration plugin">
+ <icon pluginID="org.eclipse.papyrus.paletteconfiguration" iconPath="/icons/debug.gif"/>
+ <drawerConfigurations id="palettetest1.drawer1" label="Drawer1" description="First drawer for palette configuration test1">
+ <icon pluginID="org.eclipse.papyrus.paletteconfiguration" iconPath="/icons/debug.gif"/>
+ <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="palettetest1.tool0" label="MetaClass" description="Test - Metaclass">
+ <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Class.gif"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.uml.extended.tests.Class_2008_Metaclass"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.uml.extended.tests.Class_3008_Metaclass"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.uml.extended.tests.Class_3004_Metaclass"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.uml.extended.tests.Class_3010_Metaclass"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.uml.extended.tests.Class_3014_Metaclass"/>
+ </ownedConfigurations>
+ <ownedConfigurations xsi:type="paletteconfiguration:StackConfiguration" id="palettetest1.stack1" label="Stack 1" description="test Stack">
+ <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="palettetest1.operation" label="Operation" description="Test - UML Operation">
+ <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Operation.gif"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.diagram.clazz.Operation_3003"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.diagram.clazz.Operation_3007"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.diagram.clazz.Operation_3013"/>
+ <elementDescriptors elementTypeId="org.eclipse.papyrus.diagram.clazz.Operation_3019"/>
+ </ownedConfigurations>
+ <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="palettetest1.property" label="Property" description="test - UML Property"/>
+ <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="palettetest1.class" label="Class" description="test - UML Class"/>
+ </ownedConfigurations>
+ <ownedConfigurations xsi:type="paletteconfiguration:ToolConfiguration" id="palettetest1.tool3" label="Dependency" description="Test - Simple Dependency">
+ <icon pluginID="org.eclipse.uml2.uml.edit" iconPath="/icons/full/obj16/Dependency.gif"/>
+ </ownedConfigurations>
+ </drawerConfigurations>
+</paletteconfiguration:PaletteConfiguration>
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/EXtendedPluginPaletteProviderTests_PapyrusService.java b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/EXtendedPluginPaletteProviderTests_PapyrusService.java
new file mode 100644
index 00000000000..91b936ba821
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/EXtendedPluginPaletteProviderTests_PapyrusService.java
@@ -0,0 +1,131 @@
+/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.paletteconfiguration.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.List;
+
+import org.eclipse.gef.palette.PaletteRoot;
+import org.eclipse.gmf.runtime.common.core.service.IProvider;
+import org.eclipse.gmf.runtime.common.core.service.Service;
+import org.eclipse.gmf.runtime.diagram.ui.internal.services.palette.PaletteToolEntry;
+import org.eclipse.gmf.runtime.gef.ui.internal.palette.PaletteStack;
+import org.eclipse.papyrus.diagram.common.service.PapyrusPaletteService;
+import org.eclipse.papyrus.paletteconfiguration.PaletteConfiguration;
+import org.eclipse.papyrus.paletteconfiguration.provider.ExtendedPluginPaletteProvider;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * Tests the usage of the extended palette provider in the {@link PapyrusPaletteService}
+ */
+public class EXtendedPluginPaletteProviderTests_PapyrusService implements ITestConstants {
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#contributeToPalette(org.eclipse.ui.IEditorPart, java.lang.Object, org.eclipse.gef.palette.PaletteRoot, java.util.Map)}
+ * .
+ */
+ @Test
+ public final void testContributeToPalette() {
+ List<? extends Service.ProviderDescriptor> descriptors = PapyrusPaletteService.getInstance().getProviders();
+
+ ExtendedPluginPaletteProvider extendedProvider = null;
+ // check the test descriptor is in the list
+ for(Service.ProviderDescriptor descriptor : descriptors) {
+ IProvider provider = descriptor.getProvider();
+ if(provider instanceof ExtendedPluginPaletteProvider) {
+ ExtendedPluginPaletteProvider extendedPluginPaletteProvider = (ExtendedPluginPaletteProvider)provider;
+ List<PaletteConfiguration> contributions = extendedPluginPaletteProvider.getContributions();
+ if(contributions != null && !contributions.isEmpty()) {
+ String id = contributions.get(0).getId();
+ if(PALETTE_TEST1_ID.equals(id)) {
+ extendedProvider = extendedPluginPaletteProvider;
+ }
+ }
+ }
+ }
+
+ assertNotNull("Provider for Test1 has not been found", extendedProvider);
+
+ PaletteRoot root = new PaletteRoot();
+ extendedProvider.contributeToPalette(null, null, root, new HashMap());
+
+ //check root now
+ List rootChildren = root.getChildren();
+ assertNotNull("Root children should not be null", rootChildren);
+ assertTrue("Root children should be size 1", rootChildren.size() == 1); // one drawer is contributed
+
+ for(Object drawer : rootChildren) {
+ assertTrue("Child of the root is not a drawer: " + drawer, drawer instanceof org.eclipse.gef.palette.PaletteDrawer);
+ List toolsAndStack = ((org.eclipse.gef.palette.PaletteDrawer)drawer).getChildren();
+ assertTrue("Drawer should have 3 children: 1 stack and 2 tools.", toolsAndStack.size() == 3);
+
+ Object tool0 = toolsAndStack.get(0);
+ assertTrue("first element should be a Tool", tool0 instanceof PaletteToolEntry);
+ assertTrue("first element should have id palettetest1.tool0", ((PaletteToolEntry)tool0).getId().equals("palettetest1.tool0"));
+ assertTrue("first element should have label MetaClass", ((PaletteToolEntry)tool0).getLabel().equals("MetaClass"));
+
+ Object stack1 = toolsAndStack.get(1);
+ assertTrue("2nd element should be a Stack", stack1 instanceof PaletteStack);
+ assertTrue("2nd element should have id palettetest1.stack1", ((PaletteStack)stack1).getId().equals("palettetest1.stack1"));
+ assertTrue("2nd element should have label Stack 1", ((PaletteStack)stack1).getLabel().equals("Stack 1"));
+
+ List stackChildren = ((PaletteStack)stack1).getChildren();
+ assertTrue("Stack should have 2 children: 2 tools. but has " + stackChildren.size() + " child(ren).", stackChildren.size() == 3);
+ Object stackChild = stackChildren.get(0);
+ assertTrue("stack should be a tool", stackChild instanceof PaletteToolEntry);
+ assertTrue("tool should have id palettetest1.operation but is " + ((PaletteToolEntry)stackChild).getId(), ((PaletteToolEntry)stackChild).getId().equals("palettetest1.operation"));
+ assertTrue("first element should have label \"Operation\" but is " + ((PaletteToolEntry)stackChild).getLabel(), ((PaletteToolEntry)stackChild).getLabel().equals("Operation"));
+
+ stackChild = stackChildren.get(1);
+ assertTrue("stack should be a tool", stackChild instanceof PaletteToolEntry);
+ assertTrue("tool should have id palettetest1.property but is " + ((PaletteToolEntry)stackChild).getId(), ((PaletteToolEntry)stackChild).getId().equals("palettetest1.property"));
+ assertTrue("first element should have label \"Property\" but is " + ((PaletteToolEntry)stackChild).getLabel(), ((PaletteToolEntry)stackChild).getLabel().equals("Property"));
+
+
+ Object tool3 = toolsAndStack.get(2);
+ assertTrue("3rd element should be a Tool", tool3 instanceof PaletteToolEntry);
+ assertTrue("3rd element should have id palettetest1.tool3", ((PaletteToolEntry)tool3).getId().equals("palettetest1.tool3"));
+ assertTrue("3rd element should have label \"Dependency\", but is " + ((PaletteToolEntry)tool3).getLabel(), ((PaletteToolEntry)tool3).getLabel().equals("Dependency"));
+
+ }
+ }
+
+}
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration.java b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration.java
new file mode 100644
index 00000000000..9bbc3dbec2a
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration.java
@@ -0,0 +1,112 @@
+/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.paletteconfiguration.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.util.Collection;
+
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.papyrus.paletteconfiguration.PaletteConfiguration;
+import org.eclipse.papyrus.paletteconfiguration.provider.ExtendedPluginPaletteProvider;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * Tests cases for the operation load palette configuration
+ */
+public class ExtendedPluginPaletteProviderTests_LoadPaletteConfiguration extends ExtendedPluginPaletteProvider implements ITestConstants {
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#loadConfigurationModel(java.lang.String, java.lang.String)}.
+ */
+ @Test
+ public final void testLoadConfigurationModel_Test1InPlugin() {
+ Collection<PaletteConfiguration> result = null;
+ try {
+ result = loadConfigurationModel(Platform.getBundle(BUNDLE_ID), "model/Test1.paletteconfiguration");
+ } catch (FileNotFoundException e) {
+ fail("Exception: " + e.getMessage());
+ } catch (IOException e) {
+ fail("I/O Exception: " + e.getMessage());
+ }
+ assertNotNull("Collection should not be null", result);
+ assertTrue("Collection should return one, and only one element, not :" + result.size(), result.size() == 1);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#loadConfigurationModel(java.lang.String, java.lang.String)}
+ * .
+ */
+ @Test
+ public final void testLoadConfigurationModel_Test1InFragmentItself() {
+ Collection<PaletteConfiguration> result = null;
+ try {
+ result = loadConfigurationModel(Platform.getBundle(FRAGMENT_ID), "model/Test1.paletteconfiguration");
+ } catch (FileNotFoundException e) {
+ fail("Exception: " + e.getMessage());
+ } catch (IOException e) {
+ fail("I/O Exception: " + e.getMessage());
+ }
+ assertNotNull("Collection should not be null", result);
+ assertTrue("Collection should return one, and only one element, not :" + result.size(), result.size() == 1);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#loadConfigurationModel(java.lang.String, java.lang.String)}
+ * .
+ */
+ @Test
+ public final void testLoadConfigurationModel_NotExistingFile() {
+ Collection<PaletteConfiguration> result = null;
+ try {
+ result = loadConfigurationModel(Platform.getBundle(FRAGMENT_ID), "model/NoConfiguration.paletteconfiguration");
+ } catch (FileNotFoundException e) {
+ // this should come here
+ } catch (IOException e) {
+ fail("I/O Exception: " + e.getMessage());
+ }
+ assertNull("Collection should be null", result);
+ }
+
+}
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry.java b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry.java
new file mode 100644
index 00000000000..72479fbb153
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry.java
@@ -0,0 +1,256 @@
+/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.paletteconfiguration.tests;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.eclipse.gmf.runtime.diagram.ui.internal.services.palette.PaletteToolEntry;
+import org.eclipse.gmf.runtime.gef.ui.internal.palette.PaletteDrawer;
+import org.eclipse.gmf.runtime.gef.ui.internal.palette.PaletteStack;
+import org.eclipse.papyrus.paletteconfiguration.provider.ExtendedPluginPaletteProvider;
+import org.junit.After;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * Test Class for {@link ExtendedPluginPaletteProvider#retrieveExistingEntry} method
+ */
+public class ExtendedPluginPaletteProviderTests_RetrievePredefinedEntry extends ExtendedPluginPaletteProvider {
+
+ /** id of drawer n1 */
+ protected static final String DRAWER1_ID = "drawer1"; //$NON-NLS-1$
+
+ /** id of drawer n2 */
+ protected static final String DRAWER2_ID = "drawer2"; //$NON-NLS-1$
+
+ /** id of drawer not existing */
+ protected static final String DRAWER_NO_ID = "drawerNot"; //$NON-NLS-1$
+
+ /** id of stack n1 */
+ protected static final String STACK1_ID = "stack1"; //$NON-NLS-1$
+
+ /** id of stack not existing */
+ protected static final String STACK_NO_ID = "stackNot"; //$NON-NLS-1$
+
+ /** id of tool n1 */
+ protected static final String TOOL1_ID = "tool1"; //$NON-NLS-1$
+
+ /** id of tool not existing */
+ protected static final String TOOL_NO_ID = "toolNot"; //$NON-NLS-1$
+
+ /** id of object n1 */
+ protected static final String OBJECT1_ID = "object1"; //$NON-NLS-1$
+
+ /** map used for the tests */
+ private static Map predefinedEntries;
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @BeforeClass
+ public static void setUpBeforeClass() throws Exception {
+ predefinedEntries = new HashMap();
+ addDrawer(DRAWER1_ID);
+ addDrawer(DRAWER2_ID);
+ addTool(TOOL1_ID);
+ addStack(STACK1_ID);
+ addObject(OBJECT1_ID);
+ }
+
+ /**
+ * Adds an undefined object to the predefined entries
+ *
+ * @param id
+ * id of the object
+ */
+ private static void addObject(String id) {
+ predefinedEntries.put(id, new Object());
+ }
+
+ /**
+ * adds a stack to the predefined entries
+ *
+ * @param id
+ * id of the stack
+ */
+ private static void addStack(String id) {
+ PaletteStack stack = new PaletteStack(id, id, id, null);
+ predefinedEntries.put(id, stack);
+ }
+
+ /**
+ * adds a tool to the predefined entries
+ *
+ * @param id
+ * id of the tool
+ */
+ private static void addTool(String id) {
+ PaletteToolEntry entry = new PaletteToolEntry(id, id, null);
+ predefinedEntries.put(id, entry);
+ }
+
+ /**
+ * adds a drawer to the predefined entries
+ *
+ * @param id
+ * id of the drawer
+ */
+ private static void addDrawer(String id) {
+ PaletteDrawer drawer = new PaletteDrawer(id, id);
+ predefinedEntries.put(id, drawer);
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @Before
+ public void setUp() throws Exception {
+ }
+
+ /**
+ * @throws java.lang.Exception
+ */
+ @After
+ public void tearDown() throws Exception {
+ }
+
+ /**
+ * Test method for {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}.
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveExistingDrawer() {
+ Object value = retrieveExistingEntry(predefinedEntries, DRAWER1_ID, PaletteDrawer.class);
+
+ assertNotNull(DRAWER1_ID + "should be found", value);
+ assertTrue(DRAWER1_ID + "should be a GMF PaletteDrawer, but is :" + value.getClass().getName(), value instanceof PaletteDrawer);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}
+ * .
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveNotExistingDrawer() {
+ Object value = retrieveExistingEntry(predefinedEntries, DRAWER_NO_ID, PaletteDrawer.class);
+
+ assertNull("No drawer should be found, but found: " + value, value);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}
+ * .
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveExistingStack() {
+ Object value = retrieveExistingEntry(predefinedEntries, STACK1_ID, PaletteStack.class);
+
+ assertNotNull(STACK1_ID + "should be found", value);
+ assertTrue(STACK1_ID + "should be a GMF PaletteStack, but is :" + value.getClass().getName(), value instanceof PaletteStack);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}
+ * .
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveNonExistingStack() {
+ Object value = retrieveExistingEntry(predefinedEntries, STACK_NO_ID, PaletteStack.class);
+
+ assertNull("No stack should be found, but found: " + value, value);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}
+ * .
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveExistingTool() {
+ Object value = retrieveExistingEntry(predefinedEntries, TOOL1_ID, PaletteToolEntry.class);
+
+ assertNotNull(TOOL1_ID + "should be found", value);
+ assertTrue(TOOL1_ID + "should be a GMF PaletteToolEntry, but is :" + value.getClass().getName(), value instanceof PaletteToolEntry);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}
+ * .
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveNonExistingTool() {
+ Object value = retrieveExistingEntry(predefinedEntries, TOOL_NO_ID, PaletteToolEntry.class);
+
+ assertNull("No toolentry should be found, but found: " + value, value);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}
+ * .
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveWrongTypedElement_DrawerClass() {
+ Object value = retrieveExistingEntry(predefinedEntries, TOOL1_ID, PaletteDrawer.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+
+ value = retrieveExistingEntry(predefinedEntries, STACK1_ID, PaletteDrawer.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+
+ value = retrieveExistingEntry(predefinedEntries, OBJECT1_ID, PaletteDrawer.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}
+ * .
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveWrongTypedElement_StackClass() {
+ Object value = retrieveExistingEntry(predefinedEntries, TOOL1_ID, PaletteStack.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+
+ value = retrieveExistingEntry(predefinedEntries, DRAWER1_ID, PaletteStack.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+
+ value = retrieveExistingEntry(predefinedEntries, OBJECT1_ID, PaletteStack.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+ }
+
+ /**
+ * Test method for
+ * {@link org.eclipse.papyrus.common.providers.ExtendedPluginPaletteProvider#retrieveExistingEntry(java.util.Map, java.lang.String, java.lang.Class)}
+ * .
+ */
+ @Test
+ public final void testRetrieveExistingEntry_retrieveWrongTypedElement_ToolClass() {
+ Object value = retrieveExistingEntry(predefinedEntries, DRAWER1_ID, PaletteToolEntry.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+
+ value = retrieveExistingEntry(predefinedEntries, STACK1_ID, PaletteToolEntry.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+
+ value = retrieveExistingEntry(predefinedEntries, OBJECT1_ID, PaletteToolEntry.class);
+ assertNull("value should be null, as not from correct type: " + value, value);
+ }
+}
diff --git a/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ITestConstants.java b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ITestConstants.java
new file mode 100644
index 00000000000..a074cbb8241
--- /dev/null
+++ b/tests/junit/plugins/core/org.eclipse.papyrus.paletteconfiguration.tests/src/org/eclipse/papyrus/paletteconfiguration/tests/ITestConstants.java
@@ -0,0 +1,28 @@
+/*****************************************************************************
+ * Copyright (c) 2010 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:
+ * Remi Schnekenburger (CEA LIST) remi.schnekenburger@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.paletteconfiguration.tests;
+
+
+/**
+ * Interface that holds constants for the test
+ */
+public interface ITestConstants {
+
+ /** fragment id */
+ public final static String FRAGMENT_ID = "org.eclipse.papyrus.paletteconfiguration.tests";
+
+ /** bundle id */
+ public final static String BUNDLE_ID = "org.eclipse.papyrus.paletteconfiguration";
+
+ /** id of the test 1 configuration */
+ public static final String PALETTE_TEST1_ID = "org.eclipse.papyrus.paletteconfiguration.tests.palettetest1";
+}

Back to the top