Skip to main content
aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorytanguy2011-06-20 09:15:41 +0000
committerytanguy2011-06-20 09:15:41 +0000
commitd504f07abc36f7f799690d176708d0cc80c12400 (patch)
tree8dd15c8c04db8a51525e93ba9df7489064c3688e /tests
parentaf956e04a9cd7d1349aa8fadacac6bff0cf80838 (diff)
downloadorg.eclipse.papyrus-d504f07abc36f7f799690d176708d0cc80c12400.tar.gz
org.eclipse.papyrus-d504f07abc36f7f799690d176708d0cc80c12400.tar.xz
org.eclipse.papyrus-d504f07abc36f7f799690d176708d0cc80c12400.zip
NEW - bug 349792: [SysML Block Definition Diagram] JUnit tests the Block Definition Diagram
https://bugs.eclipse.org/bugs/show_bug.cgi?id=349792
Diffstat (limited to 'tests')
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.classpath7
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.project28
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/META-INF/MANIFEST.MF9
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/about.html28
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/build.properties4
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.launch40
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/plugin.properties14
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/AbstractTest.java69
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestDiagramCreation.java20
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java157
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java15
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java15
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java187
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java187
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java188
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java187
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java188
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java187
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java187
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java187
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java187
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java183
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java183
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java15
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java190
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java190
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java191
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java191
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java191
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java197
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java191
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java197
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java182
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java191
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java189
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java197
-rw-r--r--tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/EditorUtils.java180
62 files changed, 9395 insertions, 0 deletions
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.classpath b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.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/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.project b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.project
new file mode 100644
index 00000000000..6c2c241c836
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.sysml.diagram.blockdefinition.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/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..6f05fbcda93
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Wed Jun 15 15:01:22 CEST 2011
+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/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..a79c5a47929
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,9 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.papyrus.sysml.diagram.blockdefinition.tests
+Bundle-Version: 0.8.0.qualifier
+Bundle-Vendor: %providerName
+Fragment-Host: org.eclipse.papyrus.sysml.diagram.blockdefinition;bundle-version="0.8.0"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.junit;bundle-version="4.8.2"
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/about.html b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/about.html
new file mode 100644
index 00000000000..82d49bf5f81
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.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/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/build.properties b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/build.properties
new file mode 100644
index 00000000000..41eb6ade2b4
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.launch b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.launch
new file mode 100644
index 00000000000..b59b4513a47
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/org.eclipse.papyrus.sysml.diagram.blockdefinition.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.sysml.diagram.blockdefinition.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.sysml.diagram.blockdefinition.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.sysml.diagram.blockdefinition.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="-ea -XX:PermSize=64M -XX:MaxPermSize=128M -Xms40m -Xmx1024m"/>
+<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/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/plugin.properties b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/plugin.properties
new file mode 100644
index 00000000000..63d6f0c93f6
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/plugin.properties
@@ -0,0 +1,14 @@
+#################################################################################
+# Copyright (c) 2011 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:
+#
+# CEA LIST - Initial API and Implementation.
+#
+##################################################################################
+pluginName=Papyrus SysML Block Definition Diagram Tests (Incubation)
+providerName=Eclipse Modeling Project
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/AbstractTest.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/AbstractTest.java
new file mode 100644
index 00000000000..738904c73a9
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/AbstractTest.java
@@ -0,0 +1,69 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests;
+
+
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.core.runtime.NullProgressMonitor;
+import org.eclipse.papyrus.core.editor.CoreMultiDiagramEditor;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.Activator;
+import org.eclipse.ui.IEditorDescriptor;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.part.FileEditorInput;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+
+/**
+ * Abstract Papyrus initialization class (required to get Service activation).
+ */
+public abstract class AbstractTest {
+
+ public static boolean isInitialized = false;
+
+ public static IEditorPart editor = null;
+
+ @BeforeClass public static void openPapyrusWithAnEmptyProject() throws Exception {
+
+ // Only initialize once...
+ if(!isInitialized) {
+ isInitialized = true;
+
+ try {
+
+ // Prepare new project for tests
+ IProject testProject = ResourcesPlugin.getWorkspace().getRoot().getProject("TestProject");
+ if(!testProject.exists()) {
+ testProject.create(new NullProgressMonitor());
+ }
+ if(!testProject.isOpen()) {
+ testProject.open(new NullProgressMonitor());
+ }
+
+ // Copy test model from bundle to the test project
+ IFile model_di = testProject.getFile("ModelWithBDD.di");
+ IFile model_no = testProject.getFile("ModelWithBDD.notation");
+ IFile model_uml = testProject.getFile("ModelWithBDD.uml");
+
+ model_di.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.di").openStream(), true, new NullProgressMonitor());
+ model_no.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.notation").openStream(), true, new NullProgressMonitor());
+ model_uml.create(Activator.getInstance().getBundle().getResource("/model/ModelWithBDD.uml").openStream(), true, new NullProgressMonitor());
+
+ // Open the EmptyModel.di file with Papyrus (assumed to be the default editor for "di" files here).
+ IWorkbenchPage page = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage();
+ IEditorDescriptor desc = PlatformUI.getWorkbench().getEditorRegistry().getDefaultEditor(model_di.getName());
+ editor = (CoreMultiDiagramEditor)page.openEditor(new FileEditorInput(model_di), desc.getId()).getAdapter(CoreMultiDiagramEditor.class);
+
+ } catch (Exception e) {
+ throw new Exception("Papyrus initialization failed (" + e.getMessage() + ").", e); // $NON-NLS-1$
+ }
+ }
+
+ }
+
+ @AfterClass public static void closePapyrusAndCleanProject() throws Exception {
+ editor.doSave(new NullProgressMonitor());
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestDiagramCreation.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestDiagramCreation.java
new file mode 100644
index 00000000000..0d0bace058a
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestDiagramCreation.java
@@ -0,0 +1,20 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation;
+
+import static org.junit.Assert.fail;
+
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JUnit tests for Block Definition Diagram Creation.
+ */
+public class TestDiagramCreation extends AbstractTest {
+
+ @Ignore("Test not implemented.")
+ @Test
+ public void createDiagram() {
+ fail("Test not implemented.");
+ }
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java
new file mode 100644
index 00000000000..b52aeec5097
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/TestNodeCreationOnDiagram.java
@@ -0,0 +1,157 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in diagram.
+ */
+public class TestNodeCreationOnDiagram extends AbstractTest {
+
+ @Test
+ public void testCreationActorInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationBlockInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationCommentInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationConstraintBlockInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationConstraintInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationConstraintPropertyInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationDataTypeInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationDimensionInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationEnumerationInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationEnumerationLiteralInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationFlowPortInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationFlowPropertyInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationFlowSpecificationInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationInstanceSpecificationInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationInterfaceInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationModelInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationOperationInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationPackageInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationPartInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.part", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationPortInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.port", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationPrimitiveTypeInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationPropertyInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.property", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationReceptionInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationReferenceInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationSignalInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationSlotInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationUnitInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", getDiagramView(), true);
+ }
+
+ @Test
+ public void testCreationValueInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.value", getDiagramView(), false);
+ }
+
+ @Test
+ public void testCreationValueTypeInDiagram() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", getDiagramView(), true);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java
new file mode 100644
index 00000000000..6151b5d26b6
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActor.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an Actor.
+ */
+public class TestNodeCreationOnActor extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.actor", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_ACTOR_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java
new file mode 100644
index 00000000000..a799bde2b2a
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorOperationCompartment.java
@@ -0,0 +1,15 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an Actor "operations" compartment.
+ */
+public class TestNodeCreationOnActorOperationCompartment extends AbstractTest {
+
+ @Ignore("Actor should not have operations compartment.")
+ @Test public void warning() {};
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java
new file mode 100644
index 00000000000..4c49b808eb9
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnActorPropertyCompartment.java
@@ -0,0 +1,15 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an Actor "properties" compartment.
+ */
+public class TestNodeCreationOnActorPropertyCompartment extends AbstractTest {
+
+ @Ignore("Actor should not have properties compartment.")
+ @Test public void warning() {};
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java
new file mode 100644
index 00000000000..f02c3068bf8
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlock.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block.
+ */
+public class TestNodeCreationOnBlock extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, true);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, true);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java
new file mode 100644
index 00000000000..3ae07d9e1ce
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockConstraintCompartment.java
@@ -0,0 +1,187 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block "constraints" compartment.
+ */
+public class TestNodeCreationOnBlockConstraintCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_CONSTRAINT_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, true);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, true);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java
new file mode 100644
index 00000000000..419f8ad2a9d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockFlowPortCompartment.java
@@ -0,0 +1,187 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block "flow ports" compartment.
+ */
+public class TestNodeCreationOnBlockFlowPortCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_FLOWPORT_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, true);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java
new file mode 100644
index 00000000000..2dc2f7d7458
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockOperationCompartment.java
@@ -0,0 +1,188 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block "operations" compartment.
+ */
+public class TestNodeCreationOnBlockOperationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, true);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, true);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java
new file mode 100644
index 00000000000..2be01dfbec8
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPartCompartment.java
@@ -0,0 +1,187 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block "parts" compartment.
+ */
+public class TestNodeCreationOnBlockPartCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_PART_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, true, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java
new file mode 100644
index 00000000000..2506fc48816
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPortCompartment.java
@@ -0,0 +1,188 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block "standard ports" compartment.
+ */
+public class TestNodeCreationOnBlockPortCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_PORT_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, true);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java
new file mode 100644
index 00000000000..dbe63ec5a06
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockPropertyCompartment.java
@@ -0,0 +1,187 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block "properties" compartment.
+ */
+public class TestNodeCreationOnBlockPropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_PROPERTY_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare Block for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare Block for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, true);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, true, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, true);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, true);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, true, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, true, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java
new file mode 100644
index 00000000000..55155dc4796
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockReferenceCompartment.java
@@ -0,0 +1,187 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block "references" compartment.
+ */
+public class TestNodeCreationOnBlockReferenceCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_REFERENCE_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, true, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java
new file mode 100644
index 00000000000..c973d83877f
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnBlockValueCompartment.java
@@ -0,0 +1,187 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block "values" compartment.
+ */
+public class TestNodeCreationOnBlockValueCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_BLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_VALUE_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, true, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java
new file mode 100644
index 00000000000..2208668eb89
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlock.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a ConstraintBlock.
+ */
+public class TestNodeCreationOnConstraintBlock extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.constraintblock", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCK_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java
new file mode 100644
index 00000000000..6865665badc
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockConstraintCompartment.java
@@ -0,0 +1,187 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a ConstraintBlock "constraints" compartment.
+ */
+public class TestNodeCreationOnConstraintBlockConstraintCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.constraintblock", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_CONSTRAINT_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, true);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, true);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java
new file mode 100644
index 00000000000..c2288a62f38
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnConstraintBlockParameterCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a ConstraintBlock "parameter" compartment.
+ */
+public class TestNodeCreationOnConstraintBlockParameterCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.constraintblock", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_CONSTRAINTBLOCK_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_PARAMETER_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, true);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java
new file mode 100644
index 00000000000..9881727a88d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataType.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a DataType.
+ */
+public class TestNodeCreationOnDataType extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.datatype", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_DATATYPE_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java
new file mode 100644
index 00000000000..fa3fd616b1b
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypeOperationCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a DataType "operations" compartment.
+ */
+public class TestNodeCreationOnDataTypeOperationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.datatype", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_DATATYPE_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, true);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java
new file mode 100644
index 00000000000..832fac2f2ad
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDataTypePropertyCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a DataType "properties" compartment.
+ */
+public class TestNodeCreationOnDataTypePropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.datatype", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_DATATYPE_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, true);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java
new file mode 100644
index 00000000000..607f2928808
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnDimension.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Dimension.
+ */
+public class TestNodeCreationOnDimension extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.dimension", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_DIMENSION_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java
new file mode 100644
index 00000000000..98b2b7e3897
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumeration.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an Enumeration.
+ */
+public class TestNodeCreationOnEnumeration extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.enumeration", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_ENUMERATION_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java
new file mode 100644
index 00000000000..baaac754d06
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnEnumerationLiteralCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an Enumeration "literals" compartment.
+ */
+public class TestNodeCreationOnEnumerationLiteralCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.enumeration", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_ENUMERATION_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_ENUMERATIONLITERAL_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, true);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java
new file mode 100644
index 00000000000..b7f73a165be
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecification.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a FlowSpecification.
+ */
+public class TestNodeCreationOnFlowSpecification extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.flowspecification", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_FLOWSPECIFICATION_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java
new file mode 100644
index 00000000000..644e1e38051
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnFlowSpecificationFlowCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a ValueType "properties" compartment.
+ */
+public class TestNodeCreationOnFlowSpecificationFlowCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.flowspecification", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_FLOWSPECIFICATION_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, SysMLGraphicalTypes.COMPARTMENT_SYSML_FLOWPROPERTY_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, true);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java
new file mode 100644
index 00000000000..e03baf86a9f
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterface.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an Interface.
+ */
+public class TestNodeCreationOnInterface extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.interface", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_INTERFACE_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java
new file mode 100644
index 00000000000..85f3040ef9f
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfaceOperationCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an Interface "operations" compartment.
+ */
+public class TestNodeCreationOnInterfaceOperationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.interface", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_INTERFACE_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, true);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, true);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java
new file mode 100644
index 00000000000..3a8c6ab7a5b
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnInterfacePropertyCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an Interface "properties" compartment.
+ */
+public class TestNodeCreationOnInterfacePropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.interface", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_INTERFACE_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, true);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java
new file mode 100644
index 00000000000..2de455620f1
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnPrimitiveType.java
@@ -0,0 +1,183 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a PrimitiveType.
+ */
+public class TestNodeCreationOnPrimitiveType extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.primitivetype", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_PRIMITIVETYPE_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java
new file mode 100644
index 00000000000..3731e129264
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignal.java
@@ -0,0 +1,183 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block.
+ */
+public class TestNodeCreationOnSignal extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.signal", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_SIGNAL_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java
new file mode 100644
index 00000000000..a6e25876731
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalOperationCompartment.java
@@ -0,0 +1,15 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Signal "operations" compartment.
+ */
+public class TestNodeCreationOnSignalOperationCompartment extends AbstractTest {
+
+ @Ignore("Signal should not have operations compartment.")
+ @Test public void warning() {};
+
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java
new file mode 100644
index 00000000000..894cec839e3
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnSignalPropertyCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Signal "properties" compartment.
+ */
+public class TestNodeCreationOnSignalPropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.signal", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), UMLGraphicalTypes.SHAPE_UML_SIGNAL_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, true);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java
new file mode 100644
index 00000000000..4d880fc7997
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnUnit.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Block.
+ */
+public class TestNodeCreationOnUnit extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.unit", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_UNIT_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java
new file mode 100644
index 00000000000..54ae7689f7d
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueType.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a ValueType.
+ */
+public class TestNodeCreationOnValueType extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.valuetype", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_VALUETYPE_AS_CLASSIFIER_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java
new file mode 100644
index 00000000000..52ea99eb234
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypeOperationCompartment.java
@@ -0,0 +1,190 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a ValueType "properties" compartment.
+ */
+public class TestNodeCreationOnValueTypeOperationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.valuetype", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_VALUETYPE_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_OPERATION_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, true);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java
new file mode 100644
index 00000000000..40e2d0bd1bd
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/custom/TestNodeCreationOnValueTypePropertyCompartment.java
@@ -0,0 +1,190 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.custom;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.changeVisibility;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.createFromPalette;
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.getDiagramView;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.eclipse.papyrus.sysml.diagram.common.utils.SysMLGraphicalTypes;
+import org.eclipse.papyrus.uml.diagram.common.utils.UMLGraphicalTypes;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a ValueType "properties" compartment.
+ */
+public class TestNodeCreationOnValueTypePropertyCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ createFromPalette("blockdefinition.tool.valuetype", getDiagramView(), true);
+ View blockView = ViewUtil.getChildBySemanticHint(getDiagramView(), SysMLGraphicalTypes.SHAPE_SYSML_VALUETYPE_AS_CLASSIFIER_ID);
+ containerView = ViewUtil.getChildBySemanticHint(blockView, UMLGraphicalTypes.COMPARTMENT_UML_PROPERTY_AS_LIST_ID);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, true);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ // Do not execute as this requires user interaction (dialog)
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java
new file mode 100644
index 00000000000..abce3b999b5
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnComment.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Comment (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnComment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.comment", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.COMMENT.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java
new file mode 100644
index 00000000000..eb3ff4af0e9
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnCommentCN.java
@@ -0,0 +1,191 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Comment (ChildNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnCommentCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!topNodeCompartmentView.isVisible()) {
+ changeVisibility(topNodeCompartmentView);
+ }
+
+ createFromPalette("blockdefinition.tool.comment", topNodeCompartmentView, true);
+ containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.COMMENT_CN.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java
new file mode 100644
index 00000000000..a9e98273fbc
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraint.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Constraint (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnConstraint extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.constraint", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.CONSTRAINT.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java
new file mode 100644
index 00000000000..91a675d66b9
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnConstraintCN.java
@@ -0,0 +1,191 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Constraint (ChildNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnConstraintCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!topNodeCompartmentView.isVisible()) {
+ changeVisibility(topNodeCompartmentView);
+ }
+
+ createFromPalette("blockdefinition.tool.constraint", topNodeCompartmentView, true);
+ containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.CONSTRAINT_CN.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java
new file mode 100644
index 00000000000..1a669f7c45e
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecification.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an InstanceSpecification (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnInstanceSpecification extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force inherited provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.instancespecification", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.INSTANCE_SPECIFICATION.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java
new file mode 100644
index 00000000000..b9fa73189ce
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCN.java
@@ -0,0 +1,191 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an InstanceSpecification (ChildNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnInstanceSpecificationCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!topNodeCompartmentView.isVisible()) {
+ changeVisibility(topNodeCompartmentView);
+ }
+
+ createFromPalette("blockdefinition.tool.instancespecification", topNodeCompartmentView, true);
+ containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.INSTANCE_SPECIFICATION_CN.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java
new file mode 100644
index 00000000000..d857c1af87c
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in an InstanceSpecification compartment (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnInstanceSpecificationCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.instancespecification", getDiagramView(), true);
+ View nodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.INSTANCE_SPECIFICATION.getSemanticHint());
+
+ containerView = ViewUtil.getChildBySemanticHint(nodeView, ElementTypes.INSTANCE_SPECIFICATION_COMPARTMENT_SLOT_HINT);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, true);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java
new file mode 100644
index 00000000000..ef7ab1c4231
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnInstanceSpecificationCompartmentCN.java
@@ -0,0 +1,197 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Model compartment (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnInstanceSpecificationCompartmentCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!topNodeCompartmentView.isVisible()) {
+ changeVisibility(topNodeCompartmentView);
+ }
+
+ createFromPalette("blockdefinition.tool.instancespecification", topNodeCompartmentView, true);
+ View childNodeView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.INSTANCE_SPECIFICATION_CN.getSemanticHint());
+ containerView = ViewUtil.getChildBySemanticHint(childNodeView, ElementTypes.INSTANCE_SPECIFICATION_CN_COMPARTMENT_SLOT_HINT);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, true);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java
new file mode 100644
index 00000000000..fa3054380a6
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModel.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Model (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnModel extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java
new file mode 100644
index 00000000000..42f4496eb7c
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCN.java
@@ -0,0 +1,191 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Model (ChildNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnModelCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!topNodeCompartmentView.isVisible()) {
+ changeVisibility(topNodeCompartmentView);
+ }
+
+ createFromPalette("blockdefinition.tool.model", topNodeCompartmentView, true);
+ containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.MODEL_CN.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java
new file mode 100644
index 00000000000..dc35ee9f096
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Model compartment (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnModelCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ View nodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+
+ containerView = ViewUtil.getChildBySemanticHint(nodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, true);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, true);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, true);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, true);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, true);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, true);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, true);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, true);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, true);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, true);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, true);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, true);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, true);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, true);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, true);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, true);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, true);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java
new file mode 100644
index 00000000000..5495a4fd636
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnModelCompartmentCN.java
@@ -0,0 +1,197 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Model compartment (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnModelCompartmentCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.model", getDiagramView(), true);
+ View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.MODEL.getSemanticHint());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.MODEL_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!topNodeCompartmentView.isVisible()) {
+ changeVisibility(topNodeCompartmentView);
+ }
+
+ createFromPalette("blockdefinition.tool.model", topNodeCompartmentView, true);
+ View childNodeView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.MODEL_CN.getSemanticHint());
+ containerView = ViewUtil.getChildBySemanticHint(childNodeView, ElementTypes.MODEL_CN_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, true);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, true);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, true);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, true);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, true);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, true);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, true);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, true);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, true);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, true);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, true);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, true);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, true);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, true);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, true);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, true);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, true);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java
new file mode 100644
index 00000000000..ce68dcff310
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackage.java
@@ -0,0 +1,182 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Package (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnPackage extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ containerView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.PACKAGE.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java
new file mode 100644
index 00000000000..53aa97af9f1
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCN.java
@@ -0,0 +1,191 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Package (ChildNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnPackageCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.PACKAGE.getSemanticHint());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.PACKAGE_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!topNodeCompartmentView.isVisible()) {
+ changeVisibility(topNodeCompartmentView);
+ }
+
+ createFromPalette("blockdefinition.tool.package", topNodeCompartmentView, true);
+ containerView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.PACKAGE_CN.getSemanticHint());
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, false);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, false);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, false);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, false);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, false);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, false);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, false);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, false);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, false);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, false);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, false);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, false);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, false);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, false);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, false);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, false);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, false);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java
new file mode 100644
index 00000000000..7a96fd2cf38
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartment.java
@@ -0,0 +1,189 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Package compartment (TopNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnPackageCompartment extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ View nodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.PACKAGE.getSemanticHint());
+
+ containerView = ViewUtil.getChildBySemanticHint(nodeView, ElementTypes.PACKAGE_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, true);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, true);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, true);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, true);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, true);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, true);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, true);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, true);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, true);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, true);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, true);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, true);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, true);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, true);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, true);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, true);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, true);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java
new file mode 100644
index 00000000000..61f62a511f4
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/creation/inherited/TestNodeCreationOnPackageCompartmentCN.java
@@ -0,0 +1,197 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.creation.inherited;
+
+import static org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils.EditorUtils.*;
+
+import org.eclipse.gmf.runtime.diagram.core.util.ViewUtil;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.provider.ElementTypes;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.AbstractTest;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * JUnit tests for element creation test (via palette tools) in a Package compartment (ChildNode - still inherited from class diagram).
+ */
+public class TestNodeCreationOnPackageCompartmentCN extends AbstractTest {
+
+ public static View containerView;
+
+ @BeforeClass
+ public static void prepareContainerForTest() throws Exception {
+ try {
+ // force custom provider loading...
+ createFromPalette("blockdefinition.tool.block", getDiagramView(), true);
+ //
+
+ createFromPalette("blockdefinition.tool.package", getDiagramView(), true);
+ View topNodeView = ViewUtil.getChildBySemanticHint(getDiagramView(), ElementTypes.PACKAGE.getSemanticHint());
+ View topNodeCompartmentView = ViewUtil.getChildBySemanticHint(topNodeView, ElementTypes.PACKAGE_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!topNodeCompartmentView.isVisible()) {
+ changeVisibility(topNodeCompartmentView);
+ }
+
+ createFromPalette("blockdefinition.tool.package", topNodeCompartmentView, true);
+ View childNodeView = ViewUtil.getChildBySemanticHint(topNodeCompartmentView, ElementTypes.PACKAGE_CN.getSemanticHint());
+ containerView = ViewUtil.getChildBySemanticHint(childNodeView, ElementTypes.PACKAGE_CN_COMPARTMENT_PACKAGEABLE_ELEMENT_HINT);
+
+ if(containerView == null) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+
+ // Ensure the compartment is visible (required for EditPart to be found)
+ if(!containerView.isVisible()) {
+ changeVisibility(containerView);
+ }
+
+ } catch (Exception e) {
+ throw new Exception("Unable to prepare container for test.");
+ }
+ }
+
+ @Test
+ public void createActor() throws Exception {
+ createFromPalette("blockdefinition.tool.actor", containerView, true);
+ }
+
+ @Test
+ public void createBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.block", containerView, true);
+ }
+
+ @Test
+ public void createComment() throws Exception {
+ createFromPalette("blockdefinition.tool.comment", containerView, true);
+ }
+
+ @Test
+ public void createConstraint() throws Exception {
+ createFromPalette("blockdefinition.tool.constraint", containerView, true);
+ }
+
+ @Test
+ public void createConstraintBlock() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintblock", containerView, true);
+ }
+
+ @Test
+ public void createConstraintProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.constraintproperty", containerView, false);
+ }
+
+ @Test
+ public void createDataType() throws Exception {
+ createFromPalette("blockdefinition.tool.datatype", containerView, true);
+ }
+
+ @Test
+ public void createDimension() throws Exception {
+ createFromPalette("blockdefinition.tool.dimension", containerView, true);
+ }
+
+ @Test
+ public void createEnumeration() throws Exception {
+ createFromPalette("blockdefinition.tool.enumeration", containerView, true);
+ }
+
+ @Test
+ public void createEnumerationLiteral() throws Exception {
+ createFromPalette("blockdefinition.tool.enumerationliteral", containerView, false);
+ }
+
+ @Test
+ public void createFlowPort() throws Exception {
+ createFromPalette("blockdefinition.tool.flowport", containerView, false);
+ }
+
+ @Test
+ public void createFlowProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.flowproperty", containerView, false);
+ }
+
+ @Test
+ public void createFlowSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.flowspecification", containerView, true);
+ }
+
+ @Test
+ public void createInstanceSpecification() throws Exception {
+ createFromPalette("blockdefinition.tool.instancespecification", containerView, true);
+ }
+
+ @Test
+ public void createInterface() throws Exception {
+ createFromPalette("blockdefinition.tool.interface", containerView, true);
+ }
+
+ @Test
+ public void createModel() throws Exception {
+ createFromPalette("blockdefinition.tool.model", containerView, true);
+ }
+
+ @Test
+ public void createOperation() throws Exception {
+ createFromPalette("blockdefinition.tool.operation", containerView, false);
+ }
+
+ @Test
+ public void createPackage() throws Exception {
+ createFromPalette("blockdefinition.tool.package", containerView, true);
+ }
+
+ @Test
+ public void createPart() throws Exception {
+ createFromPalette("blockdefinition.tool.part", containerView, false);
+ }
+
+ @Test
+ public void createPort() throws Exception {
+ createFromPalette("blockdefinition.tool.port", containerView, false);
+ }
+
+ @Test
+ public void createPrimitiveType() throws Exception {
+ createFromPalette("blockdefinition.tool.primitivetype", containerView, true);
+ }
+
+ @Test
+ public void createProperty() throws Exception {
+ createFromPalette("blockdefinition.tool.property", containerView, false);
+ }
+
+ @Test
+ public void createReception() throws Exception {
+ createFromPalette("blockdefinition.tool.reception", containerView, false);
+ }
+
+ @Test
+ public void createReference() throws Exception {
+ createFromPalette("blockdefinition.tool.reference", containerView, false);
+ }
+
+ @Test
+ public void createSignal() throws Exception {
+ createFromPalette("blockdefinition.tool.signal", containerView, true);
+ }
+
+ @Test
+ public void createSlot() throws Exception {
+ createFromPalette("blockdefinition.tool.slot", containerView, false);
+ }
+
+ @Test
+ public void createUnit() throws Exception {
+ createFromPalette("blockdefinition.tool.unit", containerView, true);
+ }
+
+ @Test
+ public void createValue() throws Exception {
+ createFromPalette("blockdefinition.tool.value", containerView, false);
+ }
+
+ @Test
+ public void createValueType() throws Exception {
+ createFromPalette("blockdefinition.tool.valuetype", containerView, true);
+ }
+}
diff --git a/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/EditorUtils.java b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/EditorUtils.java
new file mode 100644
index 00000000000..5a127ef2069
--- /dev/null
+++ b/tests/junit/plugins/sysml/org.eclipse.papyrus.sysml.diagram.blockdefinition.tests/src/org/eclipse/papyrus/sysml/diagram/blockdefinition/tests/utils/EditorUtils.java
@@ -0,0 +1,180 @@
+package org.eclipse.papyrus.sysml.diagram.blockdefinition.tests.utils;
+
+import static org.junit.Assert.fail;
+
+import java.util.Iterator;
+
+import org.eclipse.emf.edit.command.SetCommand;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gef.EditPart;
+import org.eclipse.gef.Request;
+import org.eclipse.gef.Tool;
+import org.eclipse.gef.commands.Command;
+import org.eclipse.gef.util.EditPartUtilities;
+import org.eclipse.gmf.runtime.diagram.ui.editparts.DiagramEditPart;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.gmf.runtime.notation.NotationPackage;
+import org.eclipse.gmf.runtime.notation.View;
+import org.eclipse.papyrus.core.services.ServiceException;
+import org.eclipse.papyrus.core.services.ServicesRegistry;
+import org.eclipse.papyrus.core.utils.ServiceUtils;
+import org.eclipse.papyrus.diagram.common.command.wrappers.GEFtoEMFCommandWrapper;
+import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeConnectionTool;
+import org.eclipse.papyrus.diagram.common.service.AspectUnspecifiedTypeCreationTool;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.BlockDefinitionDiagramForMultiEditor;
+import org.eclipse.papyrus.sysml.diagram.blockdefinition.factory.DiagramPaletteFactory;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.PlatformUI;
+
+
+public class EditorUtils {
+
+ private static IEditorPart editor = null;
+
+ public static void changeVisibility(View view) throws Exception {
+ SetCommand changeVisibilityCommand = new SetCommand(getTransactionalEditingDomain(), view, NotationPackage.eINSTANCE.getView_Visible(), !view.isVisible());
+ getTransactionalEditingDomain().getCommandStack().execute(changeVisibilityCommand);
+ }
+
+ public static void createFromPalette(String toolId, View containerView, boolean isAllowed) throws Exception {
+
+ if(isAllowed) {
+ createFromPalette(toolId, containerView, isAllowed, true);
+ } else {
+ createFromPalette(toolId, containerView, isAllowed, false);
+ }
+
+ }
+
+ public static void createFromPalette(String toolId, View containerView, boolean isAllowed, boolean execute) throws Exception {
+
+ // Find container EditPart (for command creation)
+ EditPart containerEditPart = getEditPart(containerView);
+
+ // Find palette tool to simulate element creation
+ Tool tool = getPaletteTool(toolId);
+ Request createRequest = getCreateRequest(tool);
+
+ // Get creation command for request
+ Command command = containerEditPart.getCommand(createRequest);
+
+ // if the creation is not allowed the command should not be executable
+ if(!isAllowed) {
+ if((command == null) || (!command.canExecute())) {
+ // Ok the command cannot be executed.
+ } else {
+ fail("The command should not be executable.");
+ }
+
+ } else {
+ if((command == null) || (!command.canExecute())) {
+ fail("The command should be executable.");
+ } else {
+ // Ok the command can be executed.
+ if(execute) {
+ getTransactionalEditingDomain().getCommandStack().execute(new GEFtoEMFCommandWrapper(command));
+
+ // Test undo
+ getTransactionalEditingDomain().getCommandStack().execute(getTransactionalEditingDomain().getCommandStack().getUndoCommand());
+ // Test redo
+ getTransactionalEditingDomain().getCommandStack().execute(getTransactionalEditingDomain().getCommandStack().getRedoCommand());
+ }
+ // Test the results then
+ // fail("Result tests not implemented.");
+ }
+
+ }
+ }
+
+ public static Request getCreateRequest(Tool tool) throws Exception {
+
+ if(tool instanceof AspectUnspecifiedTypeCreationTool) {
+ AspectUnspecifiedTypeCreationTool creationTool = (AspectUnspecifiedTypeCreationTool)tool;
+ return creationTool.createCreateRequest();
+
+ } else if(tool instanceof AspectUnspecifiedTypeConnectionTool) {
+ throw new Exception("Test support not implemented for this kind of tool.");
+ }
+
+ throw new Exception("Unexpected kind of creation tool.");
+ }
+
+ public static BlockDefinitionDiagramForMultiEditor getDiagramEditor() throws Exception {
+
+ ServicesRegistry serviceRegistry = (ServicesRegistry) getEditor().getAdapter(ServicesRegistry.class);
+ try {
+ return (BlockDefinitionDiagramForMultiEditor)ServiceUtils.getInstance().getNestedActiveIEditorPart(serviceRegistry);
+
+ } catch (ServiceException e) {
+ throw new Exception("Unable to retrieve service.", e);
+ } catch (ClassCastException e) {
+ throw new Exception("Active diagram is not a BDD.", e);
+ }
+ }
+
+ public static DiagramEditPart getDiagramEditPart() throws Exception {
+
+ try {
+ return getDiagramEditor().getDiagramEditPart();
+
+ } catch (NullPointerException e) {
+ throw new Exception("Could not find diagram edit part.", e);
+ }
+ }
+
+ public static Diagram getDiagramView() throws Exception {
+
+ try {
+ return getDiagramEditor().getDiagram();
+
+ } catch (NullPointerException e) {
+ throw new Exception("Could not find diagram view.", e);
+ }
+ }
+
+ public static EditPart getEditPart(View view) throws Exception {
+
+ // Test if the container is the diagram itself first
+ if(getDiagramEditPart().getModel() == view) {
+ return getDiagramEditPart();
+ }
+
+ // Test diagram children and look for the view
+ @SuppressWarnings("unchecked")
+ Iterator<EditPart> it = EditPartUtilities.getAllChildren(getDiagramEditPart()).iterator();
+ while(it.hasNext()) {
+ EditPart editPart = (EditPart)it.next();
+ if(editPart.getModel() == view) {
+ return editPart;
+ }
+ }
+
+ throw new Exception("Unable to find edit part for the given view.");
+ }
+
+ public static Tool getPaletteTool(String toolId) throws Exception {
+ DiagramPaletteFactory factory = new DiagramPaletteFactory();
+ return factory.createTool(toolId);
+ }
+
+ public static TransactionalEditingDomain getTransactionalEditingDomain() throws Exception {
+
+ ServicesRegistry serviceRegistry = (ServicesRegistry) getEditor().getAdapter(ServicesRegistry.class);
+ try {
+ return (TransactionalEditingDomain)ServiceUtils.getInstance().getTransactionalEditingDomain(serviceRegistry);
+
+ } catch (ServiceException e) {
+ throw new Exception("Unable to retrieve service.", e);
+ }
+ }
+
+ public static IEditorPart getEditor() throws Exception {
+
+ if (editor == null) {
+ editor = PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor();
+ }
+
+ return editor;
+ }
+
+}

Back to the top