Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVincent Lorenzo2013-09-09 12:48:24 +0000
committerVincent Lorenzo2013-09-09 12:48:24 +0000
commitdc2af99d3f1299ebc279fbf75114533a2fe0f37f (patch)
treec67a89c2c97cf6b3e045fc4c92defa5a1c9dfe22 /tests/junit/plugins/infra/nattable
parent741e67351f12f31d6cbe2e2de1844aaa59906192 (diff)
downloadorg.eclipse.papyrus-dc2af99d3f1299ebc279fbf75114533a2fe0f37f.tar.gz
org.eclipse.papyrus-dc2af99d3f1299ebc279fbf75114533a2fe0f37f.tar.xz
org.eclipse.papyrus-dc2af99d3f1299ebc279fbf75114533a2fe0f37f.zip
416817: [Table 2] The new tables must replace the old tables in Luna
https://bugs.eclipse.org/bugs/show_bug.cgi?id=416817 Move the nattable tests plugins from junit/extraplugins to junit/plugins/.../nattable
Diffstat (limited to 'tests/junit/plugins/infra/nattable')
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/.classpath7
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/.project28
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/META-INF/MANIFEST.MF21
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/OSGI-INF/l10n/bundle.properties3
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/about.html28
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/build.properties10
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/org.eclipse.papyrus.infra.nattable.model.editor.tests.launch41
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/plugin.pdoc4
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattable2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxis2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisconfiguration2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisprovider2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablecell2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableconfiguration2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablelabelprovider2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableproblem2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattabletester2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/Activator.java69
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/AllTests.java26
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/EditorsTests.java168
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.classpath7
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.project28
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.settings/org.eclipse.jdt.core.prefs7
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/META-INF/MANIFEST.MF35
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/OSGI-INF/l10n/bundle.properties3
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/TableOfViewsTests.launch47
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/about.html28
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/build.properties5
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/plugin.pdoc4
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.di23
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.notation11
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.uml12
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.di19
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.notation30
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.uml4
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.di13
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.notation20
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.uml2
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/Activator.java56
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/AllTests.java31
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/DisplayUtils.java45
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/OpenTableTest.java86
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest.java272
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java266
-rw-r--r--tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java219
45 files changed, 1696 insertions, 0 deletions
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/.classpath b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/.project b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/.project
new file mode 100644
index 00000000000..1e7ef6ab9bb
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.nattable.model.editor.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..7dd534cde8d
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,21 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.nattable.model.editor;bundle-version="0.10.1",
+ org.junit;bundle-version="4.11.0",
+ org.eclipse.papyrus.junit.utils;bundle-version="0.10.1",
+ org.eclipse.emf.transaction
+Export-Package: org.eclipse.papyrus.infra.nattable.model.editor.tests,
+ org.eclipse.papyrus.infra.nattable.model.editor.tests.tests
+Bundle-Vendor: %Bundle-Vendor
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 0.10.1.qualifier
+Bundle-Name: %Bundle-Name
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.infra.nattable.model.editor.test
+ s.Activator
+Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.model.editor.t
+ ests
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/OSGI-INF/l10n/bundle.properties b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..387eee1b6c1
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.infra.nattable.model.editor.tests
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Papyrus Nattable Editor Tests (Incubation) \ No newline at end of file
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/about.html b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/about.html
new file mode 100644
index 00000000000..598b3684879
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.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>May 12, 2008</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> \ No newline at end of file
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/build.properties b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/build.properties
new file mode 100644
index 00000000000..51ac1bdb6d3
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/build.properties
@@ -0,0 +1,10 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/,\
+ plugin.pdoc,\
+ resources/,\
+ about.html,\
+ org.eclipse.papyrus.infra.nattable.model.editor.tests.launch
+src.includes = about.html
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/org.eclipse.papyrus.infra.nattable.model.editor.tests.launch b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/org.eclipse.papyrus.infra.nattable.model.editor.tests.launch
new file mode 100644
index 00000000000..876b1302c88
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/org.eclipse.papyrus.infra.nattable.model.editor.tests.launch
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<launchConfiguration type="org.eclipse.pde.ui.JunitLaunchConfig">
+<booleanAttribute key="append.args" value="true"/>
+<booleanAttribute key="askclear" value="false"/>
+<booleanAttribute key="automaticAdd" value="true"/>
+<booleanAttribute key="automaticValidate" value="false"/>
+<stringAttribute key="bootstrap" value=""/>
+<stringAttribute key="checked" value="[NONE]"/>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.papyrus.infra.nattable.model.editor.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.infra.nattable.model.editor.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.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<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.infra.nattable.model.editor.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -Xms768m -Xmx1024m -XX:PermSize=256M -XX:MaxPermSize=512M"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.platform.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/plugin.pdoc b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/plugin.pdoc
new file mode 100644
index 00000000000..c1fca7aba51
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/plugin.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="This plugin provides tests for the EMF Editor for TableConfiguration (and others editor).&#xD;&#xA;We override the generated editor to ensure the serialization of the type of the elements. &#xD;&#xA;$The main goal of the tests provided by this plugin is to verofy that we use our editor and not the editor generated by EMF.">
+ <referent firstName="Vincent" lastName="LORENZO" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA LIST"/>
+</doc:Documentation>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattable b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattable
new file mode 100644
index 00000000000..eceafbc398d
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattable
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattable:Table xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattable="http://www.eclipse.org/papyrus/nattable/model"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxis b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxis
new file mode 100644
index 00000000000..16ad7b23134
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxis
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattableaxis:EStructuralFeatureAxis xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattableaxis="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisconfiguration b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisconfiguration
new file mode 100644
index 00000000000..baa21916294
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisconfiguration
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattableaxisconfiguration:AxisManagerConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisprovider b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisprovider
new file mode 100644
index 00000000000..278440faf96
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisprovider
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattableaxisprovider:MasterObjectAxisProvider xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablecell b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablecell
new file mode 100644
index 00000000000..a258211653b
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablecell
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattablecell:Cell xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattablecell="http://www.eclipse.org/papyrus/nattable/model/table/nattablecell"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableconfiguration b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableconfiguration
new file mode 100644
index 00000000000..ab1821e2b47
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableconfiguration
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattableconfiguration:TableConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration" description="sdsd" iconPath="qsd"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablelabelprovider b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablelabelprovider
new file mode 100644
index 00000000000..e40fa4a30c1
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablelabelprovider
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattablelabelprovider:FeatureLabelProviderConfiguration xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattablelabelprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattablecontentprovider"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableproblem b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableproblem
new file mode 100644
index 00000000000..c38a42d9fab
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableproblem
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattableproblem:Problem xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattableproblem="http://www.eclipse.org/papyrus/nattable/model/table/nattableproblem"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattabletester b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattabletester
new file mode 100644
index 00000000000..2f97b020e69
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattabletester
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattabletester:JavaTableTester xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:nattabletester="http://www.eclipse.org/papyrus/nattable/model/table/nattabletester"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/Activator.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/Activator.java
new file mode 100644
index 00000000000..3dbf0bbf06f
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/Activator.java
@@ -0,0 +1,69 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.model.editor.tests;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.nattable.model.editor.tests"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ plugin = this;
+ log = new LogHelper(plugin);
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/AllTests.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/AllTests.java
new file mode 100644
index 00000000000..960fde2deac
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/AllTests.java
@@ -0,0 +1,26 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.model.editor.tests.tests;
+
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+
+@RunWith(Suite.class)
+@SuiteClasses({ EditorsTests.class
+
+})
+public class AllTests {
+
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/EditorsTests.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/EditorsTests.java
new file mode 100644
index 00000000000..9c2c655af28
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/EditorsTests.java
@@ -0,0 +1,168 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.model.editor.tests.tests;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattableEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattableaxisEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattableaxisconfigurationEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattableaxisproviderEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattablecellEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattableconfigurationEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattablelabelproviderEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattableproblemEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattabletesterEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.tests.Activator;
+import org.eclipse.papyrus.junit.utils.EditorUtils;
+import org.eclipse.papyrus.junit.utils.GenericUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.junit.After;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+/**
+ * If some tests of this class doesn't work, the problem comes probably from the plugin.xml of the plugin oep.infra.nattable.model.editor.
+ * We replace the initial contributions to org.eclipse.ui.editor by our with our Custom Editor which override the save options
+ *
+ * @author vl222926
+ *
+ */
+public class EditorsTests {
+
+ private IProject project;
+
+ @Before
+ public void init() throws CoreException {
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+
+ }
+
+ /**
+ *
+ * @param projectName
+ * the name of the project
+ * @param modelName
+ * the name of the file
+ * @param bundle
+ * the bundle to use
+ * @return
+ * @throws Exception
+ */
+ protected IEditorPart openFile(String projectName, String modelName, final Bundle bundle) throws Exception {
+ project = ProjectUtils.createProject(projectName);
+ final IFile diModelFile = PapyrusProjectUtils.copyIFile(getSourcePath() + modelName, bundle, project, modelName);
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ public void run() {
+ setStatus(Status.OK_STATUS);
+ try {
+ IEditorPart editor = EditorUtils.openEditor(diModelFile);
+ setResult(editor);
+ } catch (Exception ex) {
+ Activator.log.error(ex);
+ setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), ex.getMessage()));
+ }
+
+ }
+ };
+
+ Display.getDefault().syncExec(runnableWithResult);
+ Assert.assertEquals(runnableWithResult.getStatus().getMessage(), IStatus.OK, runnableWithResult.getStatus().getSeverity());
+
+ IEditorPart editor = (IEditorPart)runnableWithResult.getResult();
+ Assert.assertNotNull(editor);
+ return editor;
+ }
+
+ private Bundle getBundle() {
+ return Activator.getDefault().getBundle();
+ }
+
+ @Test
+ public void testOpenNattableFileEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattable", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattableEditor);
+ }
+
+ @Test
+ public void testOpenNattableAxisFileEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattableaxis", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattableaxisEditor);
+ }
+
+ @Test
+ public void testOpenNattableAxisConfigurationFileEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattableaxisconfiguration", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattableaxisconfigurationEditor);
+ }
+
+ @Test
+ public void testOpenNattableAxisProviderFileEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattableaxisprovider", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattableaxisproviderEditor);
+ }
+
+ @Test
+ public void testOpenNattableConfigurationFileEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattableconfiguration", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattableconfigurationEditor);
+ }
+
+
+ @Test
+ public void testOpenNattableLabelProviderFileEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattablelabelprovider", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattablelabelproviderEditor);
+ }
+
+ @Test
+ public void testOpenNattableTesterFileEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattabletester", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattabletesterEditor);
+ }
+
+
+ @Test
+ public void testOpenNattableTesterCellEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattablecell", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattablecellEditor);
+ }
+
+
+ @Test
+ public void testOpenNattableTesterProblemEditor() throws Exception {
+ IEditorPart editor = openFile("testTableConfiguration", "My.nattableproblem", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ Assert.assertTrue(editor instanceof CustomNattableproblemEditor);
+ }
+
+ protected String getSourcePath() {
+ return "/resources/"; //$NON-NLS-1$
+ }
+
+ @After
+ public void after() {
+ GenericUtils.closeAllEditors();
+
+ }
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.classpath b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.classpath
new file mode 100644
index 00000000000..8a8f1668cdc
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.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/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.project b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.project
new file mode 100644
index 00000000000..2a56fb6f8b4
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.papyrus.infra.nattable.views.editor.tests</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.SchemaBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ </natures>
+</projectDescription>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.settings/org.eclipse.jdt.core.prefs b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..f287d53cf45
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,7 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.6
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/META-INF/MANIFEST.MF b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..567544f3197
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,35 @@
+Manifest-Version: 1.0
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.1",
+ org.junit;bundle-version="4.11.0",
+ org.eclipse.emf.transaction;bundle-version="1.4.0",
+ org.eclipse.emf;bundle-version="2.6.0",
+ org.eclipse.papyrus.infra.gmfdiag.commands;bundle-version="0.10.1",
+ org.eclipse.papyrus.editor.integration.tests;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.core.sasheditor;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.gmfdiag.common;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.nattable.common;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.nattable;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.nattable.model;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.nattable.views.config;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.nattable.views.editor;bundle-version="0.10.1",
+ org.eclipse.papyrus.infra.services.edit;bundle-version="0.10.1",
+ org.eclipse.papyrus.junit.utils;bundle-version="0.10.1",
+ org.eclipse.papyrus.views.modelexplorer;bundle-version="0.10.1",
+ org.eclipse.uml2.uml;bundle-version="4.1.0",
+ org.eclipse.gmf.runtime.notation.edit
+Export-Package: org.eclipse.papyrus.infra.nattable.views.tests,
+ org.eclipse.papyrus.infra.nattable.views.tests.tests
+Bundle-Vendor: %Bundle-Vendor
+Bundle-ActivationPolicy: lazy
+Bundle-Version: 0.10.1.qualifier
+Bundle-Name: %Bundle-Name
+Bundle-ManifestVersion: 2
+Bundle-Activator: org.eclipse.papyrus.infra.nattable.views.tests.Activ
+ ator
+Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.views.editor.t
+ ests
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/OSGI-INF/l10n/bundle.properties b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/OSGI-INF/l10n/bundle.properties
new file mode 100644
index 00000000000..517043554fd
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/OSGI-INF/l10n/bundle.properties
@@ -0,0 +1,3 @@
+#Properties file for org.eclipse.papyrus.infra.nattable.views.editor.tests
+Bundle-Vendor = Eclipse Modeling Project
+Bundle-Name = Tests the NatTable Views Editor (Incubation) \ No newline at end of file
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/TableOfViewsTests.launch b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/TableOfViewsTests.launch
new file mode 100644
index 00000000000..45d1e64ce08
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/TableOfViewsTests.launch
@@ -0,0 +1,47 @@
+<?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]"/>
+<listAttribute key="classFilters">
+<listEntry value="ClassFilter(include, org.eclipse.papyrus.infra.emf.*)"/>
+<listEntry value="ClassFilter(include, org.eclipse.papyrus.uml.tools.*)"/>
+<listEntry value="ClassFilter(include, *.tests.*)"/>
+</listAttribute>
+<booleanAttribute key="clearConfig" value="true"/>
+<booleanAttribute key="clearws" value="true"/>
+<booleanAttribute key="clearwslog" value="false"/>
+<stringAttribute key="configLocation" value="${workspace_loc}/.metadata/.plugins/org.eclipse.pde.core/pde-junit"/>
+<booleanAttribute key="default" value="true"/>
+<booleanAttribute key="includeOptional" value="true"/>
+<stringAttribute key="location" value="${workspace_loc}/../junit-workspace"/>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_PATHS">
+<listEntry value="/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/AllTests.java"/>
+</listAttribute>
+<listAttribute key="org.eclipse.debug.core.MAPPED_RESOURCE_TYPES">
+<listEntry value="1"/>
+</listAttribute>
+<stringAttribute key="org.eclipse.jdt.junit.CONTAINER" value=""/>
+<booleanAttribute key="org.eclipse.jdt.junit.KEEPRUNNING_ATTR" value="false"/>
+<stringAttribute key="org.eclipse.jdt.junit.TESTNAME" value=""/>
+<stringAttribute key="org.eclipse.jdt.junit.TEST_KIND" value="org.eclipse.jdt.junit.loader.junit4"/>
+<stringAttribute key="org.eclipse.jdt.launching.JRE_CONTAINER" value="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+<stringAttribute key="org.eclipse.jdt.launching.MAIN_TYPE" value="org.eclipse.papyrus.infra.nattable.views.tests.tests.AllTests"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROGRAM_ARGUMENTS" value="-os ${target.os} -ws ${target.ws} -arch ${target.arch} -nl ${target.nl} -consoleLog"/>
+<stringAttribute key="org.eclipse.jdt.launching.PROJECT_ATTR" value="org.eclipse.papyrus.infra.nattable.views.editor.tests"/>
+<stringAttribute key="org.eclipse.jdt.launching.SOURCE_PATH_PROVIDER" value="org.eclipse.pde.ui.workbenchClasspathProvider"/>
+<stringAttribute key="org.eclipse.jdt.launching.VM_ARGUMENTS" value="-Dosgi.requiredJavaVersion=1.5 -Xms120m -Xmx512m -XX:PermSize=256M -XX:MaxPermSize=512M"/>
+<stringAttribute key="pde.version" value="3.3"/>
+<stringAttribute key="product" value="org.eclipse.sdk.ide"/>
+<booleanAttribute key="run_in_ui_thread" value="true"/>
+<booleanAttribute key="show_selected_only" value="false"/>
+<stringAttribute key="templateConfig" value="${target_home}\configuration\config.ini"/>
+<booleanAttribute key="tracing" value="false"/>
+<booleanAttribute key="useCustomFeatures" value="false"/>
+<booleanAttribute key="useDefaultConfig" value="true"/>
+<booleanAttribute key="useDefaultConfigArea" value="false"/>
+<booleanAttribute key="useProduct" value="true"/>
+</launchConfiguration>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/about.html b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/about.html
new file mode 100644
index 00000000000..598b3684879
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.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>May 12, 2008</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> \ No newline at end of file
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/build.properties b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/build.properties
new file mode 100644
index 00000000000..5d7848ab179
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/build.properties
@@ -0,0 +1,5 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ OSGI-INF/l10n/bundle.properties
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/plugin.pdoc b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/plugin.pdoc
new file mode 100644
index 00000000000..4777f98193e
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/plugin.pdoc
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<doc:Documentation xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:doc="http://www.eclipse.org/papyrus/documentation/plugin/documentation" description="This plugin provides tests for the Papyrus Views table plugin.">
+ <referent firstName="Vincent" lastName="LORENZO" eMail="vincent.lorenzo@cea.fr" currentCompany="CEA LIST"/>
+</doc:Documentation>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.di b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.di
new file mode 100644
index 00000000000..4c7d9891ae0
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.di
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
+ <pageList>
+ <availablePage>
+ <emfPageIdentifier href="model.notation#_ZHTYcOImEeK3ebxQGrgGhw"/>
+ </availablePage>
+ <availablePage>
+ <emfPageIdentifier href="model.notation#_ZHciYOImEeK3ebxQGrgGhw"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder">
+ <children>
+ <emfPageIdentifier href="model.notation#_ZHTYcOImEeK3ebxQGrgGhw"/>
+ </children>
+ <children>
+ <emfPageIdentifier href="model.notation#_ZHciYOImEeK3ebxQGrgGhw"/>
+ </children>
+ </children>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.notation b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.notation
new file mode 100644
index 00000000000..5d92f64374e
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.notation
@@ -0,0 +1,11 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML">
+ <notation:Diagram xmi:id="_ZHTYcOImEeK3ebxQGrgGhw" type="PapyrusUMLClassDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_ZHTYceImEeK3ebxQGrgGhw"/>
+ <element xmi:type="uml:Model" href="model.uml#_ZG2sxOImEeK3ebxQGrgGhw"/>
+ </notation:Diagram>
+ <notation:Diagram xmi:id="_ZHciYOImEeK3ebxQGrgGhw" type="PapyrusUMLComponentDiagram" name="NewDiagram" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_ZHciYeImEeK3ebxQGrgGhw"/>
+ <element xmi:type="uml:Model" href="model.uml#_ZG2sxOImEeK3ebxQGrgGhw"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.uml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.uml
new file mode 100644
index 00000000000..e6fd4aebbfc
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model.uml
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_ZG2sxOImEeK3ebxQGrgGhw" name="RootModel">
+ <packageImport xmi:type="uml:PackageImport" xmi:id="_ZG2sxeImEeK3ebxQGrgGhw">
+ <importedPackage xmi:type="uml:Model" href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
+ </packageImport>
+ <packagedElement xmi:type="uml:Model" xmi:id="_bbLfkOImEeK3ebxQGrgGhw" name="SubModel">
+ <packagedElement xmi:type="uml:Model" xmi:id="_csQs8OImEeK3ebxQGrgGhw" name="SubSubModel"/>
+ </packagedElement>
+ <packagedElement xmi:type="uml:Package" xmi:id="_hTvOYOImEeK3ebxQGrgGhw" name="SubPackage">
+ <packagedElement xmi:type="uml:Package" xmi:id="_irqqoOImEeK3ebxQGrgGhw" name="SubSubPackage"/>
+ </packagedElement>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.di b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.di
new file mode 100644
index 00000000000..02f35ba8724
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.di
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
+ <pageList>
+ <availablePage>
+ <emfPageIdentifier href="model2.notation#_RhNAkOJkEeKMjtLnLklb5Q"/>
+ </availablePage>
+ <availablePage>
+ <emfPageIdentifier href="model2.notation#_TD14AOJkEeKMjtLnLklb5Q"/>
+ </availablePage>
+ <availablePage>
+ <emfPageIdentifier href="model2.notation#_WCKDQOJkEeKMjtLnLklb5Q"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder"/>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.notation b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.notation
new file mode 100644
index 00000000000..956133d804b
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.notation
@@ -0,0 +1,30 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nattable="http://www.eclipse.org/papyrus/nattable/model" xmlns:nattableaxis="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis" xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider" xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration" xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.2/notation" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis http://www.eclipse.org/papyrus/nattable/model#//nattableaxis http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration http://www.eclipse.org/papyrus/nattable/model#//nattableaxisconfiguration http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider http://www.eclipse.org/papyrus/nattable/model#//nattableaxisprovider http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration http://www.eclipse.org/papyrus/nattable/model#//nattableconfiguration">
+ <notation:Diagram xmi:id="_RhNAkOJkEeKMjtLnLklb5Q" type="PapyrusUMLClassDiagram" name="ClassDiagram2" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_RhNAkeJkEeKMjtLnLklb5Q"/>
+ <element xmi:type="uml:Model" href="model2.uml#_NTXuMOJkEeKMjtLnLklb5Q"/>
+ </notation:Diagram>
+ <nattable:Table xmi:id="_TD14AOJkEeKMjtLnLklb5Q" name="TableOfViews0" currentRowAxisProvider="_TD14BuJkEeKMjtLnLklb5Q" currentColumnAxisProvider="_TD14AeJkEeKMjtLnLklb5Q">
+ <context xmi:type="uml:Model" href="model2.uml#_NTXuMOJkEeKMjtLnLklb5Q"/>
+ <tableConfiguration xmi:type="nattableconfiguration:TableConfiguration" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#/"/>
+ <columnAxisProvidersHistory xmi:type="nattableaxisprovider:SlaveObjectAxisProvider" xmi:id="_TD14AeJkEeKMjtLnLklb5Q" description="Provides the features of the views" name="Papyrus Views feature provider">
+ <axis xmi:type="nattableaxis:FeatureIdAxis" xmi:id="_TD14AuJkEeKMjtLnLklb5Q" element="nattable_editor_pages:/name">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ </axis>
+ <axis xmi:type="nattableaxis:FeatureIdAxis" xmi:id="_TD14A-JkEeKMjtLnLklb5Q" element="nattable_editor_pages:/context">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ </axis>
+ <axis xmi:type="nattableaxis:FeatureIdAxis" xmi:id="_TD14BOJkEeKMjtLnLklb5Q" element="nattable_editor_pages:/isOpen">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ </axis>
+ <axis xmi:type="nattableaxis:FeatureIdAxis" xmi:id="_TD14BeJkEeKMjtLnLklb5Q" element="nattable_editor_pages:/type">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ </axis>
+ </columnAxisProvidersHistory>
+ <rowAxisProvidersHistory xmi:type="nattableaxisprovider:MasterObjectAxisProvider" xmi:id="_TD14BuJkEeKMjtLnLklb5Q"/>
+ </nattable:Table>
+ <notation:Diagram xmi:id="_WCKDQOJkEeKMjtLnLklb5Q" type="PapyrusUMLClassDiagram" name="ClassDiagram1" measurementUnit="Pixel">
+ <styles xmi:type="notation:DiagramStyle" xmi:id="_WCKDQeJkEeKMjtLnLklb5Q"/>
+ <element xmi:type="uml:Model" href="model2.uml#_Km1PcOJkEeKMjtLnLklb5Q"/>
+ </notation:Diagram>
+</xmi:XMI>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.uml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.uml
new file mode 100644
index 00000000000..bcb0b1e19d2
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/model2.uml
@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_Km1PcOJkEeKMjtLnLklb5Q" name="model">
+ <packagedElement xmi:type="uml:Model" xmi:id="_NTXuMOJkEeKMjtLnLklb5Q" name="SubModel1"/>
+</uml:Model>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.di b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.di
new file mode 100644
index 00000000000..7ff6b1b1083
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.di
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<di:SashWindowsMngr xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:di="http://www.eclipse.org/papyrus/0.7.0/sashdi">
+ <pageList>
+ <availablePage>
+ <emfPageIdentifier href="openTest.notation#_t84AgOIjEeKndr3wY-HJQw"/>
+ </availablePage>
+ </pageList>
+ <sashModel currentSelection="//@sashModel/@windows.0/@children.0">
+ <windows>
+ <children xsi:type="di:TabFolder"/>
+ </windows>
+ </sashModel>
+</di:SashWindowsMngr>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.notation b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.notation
new file mode 100644
index 00000000000..6ccd832110f
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.notation
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<nattable:Table xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:nattable="http://www.eclipse.org/papyrus/nattable/model" xmlns:nattableaxis="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis" xmlns:nattableaxisconfiguration="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration" xmlns:nattableaxisprovider="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider" xmlns:nattableconfiguration="http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xsi:schemaLocation="http://www.eclipse.org/papyrus/nattable/model/table/nattableaxis http://www.eclipse.org/papyrus/nattable/model#//nattableaxis http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisconfiguration http://www.eclipse.org/papyrus/nattable/model#//nattableaxisconfiguration http://www.eclipse.org/papyrus/nattable/model/table/nattableaxisprovider http://www.eclipse.org/papyrus/nattable/model#//nattableaxisprovider http://www.eclipse.org/papyrus/nattable/model/nattableconfiguration http://www.eclipse.org/papyrus/nattable/model#//nattableconfiguration" xmi:id="_t84AgOIjEeKndr3wY-HJQw" name="TableOfViews0" currentRowAxisProvider="_t84AhuIjEeKndr3wY-HJQw" currentColumnAxisProvider="_t84AgeIjEeKndr3wY-HJQw">
+ <context xmi:type="uml:Model" href="openTest.uml#_syVgAOIjEeKndr3wY-HJQw"/>
+ <tableConfiguration xmi:type="nattableconfiguration:TableConfiguration" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#/"/>
+ <columnAxisProvidersHistory xmi:type="nattableaxisprovider:SlaveObjectAxisProvider" xmi:id="_t84AgeIjEeKndr3wY-HJQw" description="Provides the features of the views" name="Papyrus Views feature provider">
+ <axis xmi:type="nattableaxis:FeatureIdAxis" xmi:id="_t84AguIjEeKndr3wY-HJQw" element="nattable_editor_pages:/name">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ </axis>
+ <axis xmi:type="nattableaxis:FeatureIdAxis" xmi:id="_t84Ag-IjEeKndr3wY-HJQw" element="nattable_editor_pages:/context">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ </axis>
+ <axis xmi:type="nattableaxis:FeatureIdAxis" xmi:id="_t84AhOIjEeKndr3wY-HJQw" element="nattable_editor_pages:/isOpen">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ </axis>
+ <axis xmi:type="nattableaxis:FeatureIdAxis" xmi:id="_t84AheIjEeKndr3wY-HJQw" element="nattable_editor_pages:/type">
+ <manager xmi:type="nattableaxisconfiguration:AxisManagerRepresentation" href="platform:/plugin/org.eclipse.papyrus.infra.nattable.views.config/resources/viewpage.nattableconfiguration#//@columnHeaderAxisConfiguration/@axisManagers.0"/>
+ </axis>
+ </columnAxisProvidersHistory>
+ <rowAxisProvidersHistory xmi:type="nattableaxisprovider:MasterObjectAxisProvider" xmi:id="_t84AhuIjEeKndr3wY-HJQw"/>
+</nattable:Table>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.uml b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.uml
new file mode 100644
index 00000000000..1ffccd12eda
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/resources/openTest.uml
@@ -0,0 +1,2 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<uml:Model xmi:version="20110701" xmlns:xmi="http://www.omg.org/spec/XMI/20110701" xmlns:uml="http://www.eclipse.org/uml2/4.0.0/UML" xmi:id="_syVgAOIjEeKndr3wY-HJQw" name="model"/>
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/Activator.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/Activator.java
new file mode 100644
index 00000000000..3447f03ecc7
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/Activator.java
@@ -0,0 +1,56 @@
+package org.eclipse.papyrus.infra.nattable.views.tests;
+
+import org.eclipse.papyrus.infra.core.log.LogHelper;
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class Activator extends AbstractUIPlugin {
+
+ // The plug-in ID
+ public static final String PLUGIN_ID = "org.eclipse.papyrus.infra.nattable.views.editor.tests"; //$NON-NLS-1$
+
+ // The shared instance
+ private static Activator plugin;
+
+ public static LogHelper log;
+
+ /**
+ * The constructor
+ */
+ public Activator() {
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+ */
+ public void start(BundleContext context) throws Exception {
+ super.start(context);
+ log = new LogHelper(this);
+ plugin = this;
+ }
+
+ /*
+ * (non-Javadoc)
+ *
+ * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+ */
+ public void stop(BundleContext context) throws Exception {
+ plugin = null;
+ super.stop(context);
+ }
+
+ /**
+ * Returns the shared instance
+ *
+ * @return the shared instance
+ */
+ public static Activator getDefault() {
+ return plugin;
+ }
+
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/AllTests.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/AllTests.java
new file mode 100644
index 00000000000..386f1f2fce6
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/AllTests.java
@@ -0,0 +1,31 @@
+/*****************************************************************************
+ * Copyright (c) 2012 CEA LIST.
+ *
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Camille Letavernier (CEA LIST) camille.letavernier@cea.fr - Initial API and implementation
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.views.tests.tests;
+
+
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+import org.junit.runners.Suite.SuiteClasses;
+
+
+@RunWith(Suite.class)
+@SuiteClasses({ TableCreationTest.class, OpenTableTest.class, TableVerifyContents.class, TableCreationTest2.class
+
+})
+public class AllTests {
+
+ /** The type of the requirement table */
+ public static final String VIEWS_TABLE_ID = "PapyrusViewsTable"; //$NON-NLS-1$
+
+ /** the creation command tested for the requirement table */
+ public static final String COMMAND_ID = "org.eclipse.papyrus.infra.nattable.page.editor.create.withoutdialog.command"; //$NON-NLS-1$
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/DisplayUtils.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/DisplayUtils.java
new file mode 100644
index 00000000000..9b66d8cbe6c
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/DisplayUtils.java
@@ -0,0 +1,45 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.views.tests.tests;
+
+import org.eclipse.swt.widgets.Display;
+
+
+public class DisplayUtils {
+
+
+ private DisplayUtils() {
+ //to prevent instanciation
+ }
+
+ /**
+ * a safe version of the call while(Display.getDefault().readAndDispatch());
+ */
+ //FIXME move me in an upper plugin if i works fine
+ public static void safeReadAndDispatch() {
+ while(true) {
+ boolean res = true;
+ try {
+ res = Display.getDefault().readAndDispatch();
+ } catch (Exception e) {
+ //nothing to do
+ }
+ if(res == false) {
+ return;
+ }
+ }
+ }
+
+
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/OpenTableTest.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/OpenTableTest.java
new file mode 100644
index 00000000000..9428d782cf5
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/OpenTableTest.java
@@ -0,0 +1,86 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.views.tests.tests;
+
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.papyrus.commands.OpenDiagramCommand;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.editor.integration.tests.tests.AbstractEditorIntegrationTest;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.gmfdiag.common.model.NotationUtils;
+import org.eclipse.papyrus.infra.nattable.common.editor.NatTableEditor;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.junit.utils.GenericUtils;
+import org.eclipse.ui.IEditorPart;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+
+/**
+ * Test the opening of an existing table
+ *
+ * @author vl222926
+ *
+ */
+public class OpenTableTest extends AbstractEditorIntegrationTest {
+
+ @BeforeClass
+ public static void startOfTest() {
+// GenericUtils.closeAllEditors();
+ }
+
+ /**
+ * This test allows to be sure that we doesn't break existing table model
+ *
+ * @throws Exception
+ */
+ @Test
+ public void testOpenExistingTable() throws Exception {
+ initModel("tableOfViewsTest", "openTest", getBundle()); //$NON-NLS-1$ //$NON-NLS-2$
+ IPageManager pageManager = editor.getServicesRegistry().getService(IPageManager.class);
+ Assert.assertEquals(1, pageManager.allPages().size());
+ IEditorPart tableEditor = editor.getActiveEditor();
+ Assert.assertNull(tableEditor);
+ Resource notationResource = NotationUtils.getNotationModel(editor.getServicesRegistry().getService(ModelSet.class)).getResource();
+ Table requirementTable = (Table)notationResource.getContents().get(0);
+ TransactionalEditingDomain editingDomain = editor.getServicesRegistry().getService(TransactionalEditingDomain.class);
+ editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(new OpenDiagramCommand(editingDomain, requirementTable)));
+ DisplayUtils.safeReadAndDispatch();
+ tableEditor = editor.getActiveEditor();
+ Assert.assertTrue(tableEditor instanceof NatTableEditor);
+ INattableModelManager manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class);
+ Assert.assertNotNull(manager);
+ }
+
+ @Override
+ protected String getSourcePath() {
+ return "/resources/"; //$NON-NLS-1$
+ }
+
+ @Override
+ protected Bundle getBundle() {
+ return org.eclipse.papyrus.infra.nattable.views.tests.Activator.getDefault().getBundle();
+ }
+
+ @AfterClass
+ public static void endOfTest() {
+ GenericUtils.closeAllEditors();
+ }
+
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest.java
new file mode 100644
index 00000000000..a9be3048bdc
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest.java
@@ -0,0 +1,272 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.views.tests.tests;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Platform;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.CreateElementRequest;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.nattable.common.editor.NatTableEditor;
+import org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.views.tests.Activator;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.junit.utils.EditorUtils;
+import org.eclipse.papyrus.junit.utils.GenericUtils;
+import org.eclipse.papyrus.junit.utils.ModelExplorerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.PartService;
+import org.eclipse.uml2.uml.Class;
+import org.eclipse.uml2.uml.Model;
+import org.eclipse.uml2.uml.NamedElement;
+import org.eclipse.uml2.uml.Package;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+public class TableCreationTest {
+
+ private static final String MODEL_PATH = "/resources/model"; //$NON-NLS-1$
+
+ private static final String SOURCE_PATH = "/resources/"; //$NON-NLS-1$
+
+ private static final String FILE_ROOT_NAME = "model"; //$NON-NLS-1$
+
+ private static final String PROJECT_NAME = "test"; //$NON-NLS-1$
+
+ private static IMultiDiagramEditor papyrusEditor;
+
+ private static final String BUNDLE_ID = Activator.getDefault().getBundle().getSymbolicName();
+
+ protected static Model rootModel;
+
+ private static Model subModel;
+
+ private static Model subSubModel;
+
+ private static Package subPackage;
+
+ private static Package subSubPackage;
+
+ protected static ModelExplorerView view;
+
+ @BeforeClass
+ public static void init() {
+ try {
+ initTests(Activator.getDefault().getBundle(), PROJECT_NAME, MODEL_PATH);
+
+ } catch (CoreException e) {
+ Activator.log.error(e);
+ } catch (IOException e) {
+ Activator.log.error(e);
+ } catch (BundleException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ public static void initTests(final Bundle bundle, final String projectName, final String papyrusModelPath) throws CoreException, IOException, BundleException {
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(projectName);
+ final IFile file = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, FILE_ROOT_NAME);
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ try {
+ papyrusEditor = EditorUtils.openPapyrusEditor(file);
+ } catch (PartInitException e) {
+ setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), e.getMessage()));
+ }
+ try {
+ TableCreationTest.view = ModelExplorerUtils.openModelExplorerView();
+ } catch (PartInitException e) {
+ setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), e.getMessage()));
+ }
+ EObject root = ModelExplorerUtils.getRootInModelExplorer(TableCreationTest.view);
+ TableCreationTest.rootModel = (Model)root;
+ subModel = (Model)TableCreationTest.rootModel.getMember("SubModel"); //$NON-NLS-1$
+ subPackage = (Package)TableCreationTest.rootModel.getMember("SubPackage"); //$NON-NLS-1$
+ if(subModel != null && subPackage != null) {
+ subSubModel = (Model)TableCreationTest.subModel.getMember("SubSubModel"); //$NON-NLS-1$
+ subSubPackage = (Package)TableCreationTest.subPackage.getMember("SubSubPackage");
+
+ setStatus(Status.OK_STATUS);
+
+ } else {
+ setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), "Requirement1 not found")); //$NON-NLS-1$
+ }
+
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ Assert.assertEquals(runnableWithResult.getStatus().getMessage(), IStatus.OK, runnableWithResult.getStatus().getSeverity());
+ Assert.assertNotNull(subModel);
+ Assert.assertNotNull(subPackage);
+ Assert.assertNotNull(subSubModel);
+ Assert.assertNotNull(subPackage);
+
+ Assert.assertNotNull(TableCreationTest.rootModel);
+
+
+
+ }
+
+ @Test
+ public void testCreationHandlerStatusOnRootModel() {
+ ModelExplorerUtils.testHandlerStatusInModelExplorer(TableCreationTest.view, AllTests.COMMAND_ID, TableCreationTest.rootModel, true);
+ }
+
+ @Test
+ public void testCreationHandlerStatusOnSubModel() {
+ ModelExplorerUtils.testHandlerStatusInModelExplorer(TableCreationTest.view, AllTests.COMMAND_ID, subModel, true);
+ }
+
+ @Test
+ public void testCreationHandlerStatusOnSubSubModel() {
+ ModelExplorerUtils.testHandlerStatusInModelExplorer(TableCreationTest.view, AllTests.COMMAND_ID, subSubModel, true);
+ }
+
+ @Test
+ public void testCreationHandlerStatusOnSubPackage() {
+ ModelExplorerUtils.testHandlerStatusInModelExplorer(TableCreationTest.view, AllTests.COMMAND_ID, subPackage, true);
+ }
+
+ @Test
+ public void testCreationHandlerStatusOnSubSubPackage() {
+ ModelExplorerUtils.testHandlerStatusInModelExplorer(TableCreationTest.view, AllTests.COMMAND_ID, subSubPackage, true);
+ }
+
+
+ @Test
+ public void testCreationAndSynchronization() {
+ final Object result1 = ModelExplorerUtils.executeCreateNestedEditorHandlerInModelExplorer(papyrusEditor, TableCreationTest.view, AllTests.COMMAND_ID, TableCreationTest.subSubPackage, BUNDLE_ID);
+ Assert.assertTrue(result1 instanceof NatTableEditor);
+ final NatTableEditor editor1 = (NatTableEditor)result1;
+ final NattableModelManager manager1 = (NattableModelManager)editor1.getAdapter(INattableModelManager.class);
+ Assert.assertNotNull(manager1);
+ final Table subSubPackageTable1 = manager1.getTable();
+ Assert.assertEquals(AllTests.VIEWS_TABLE_ID, subSubPackageTable1.getTableConfiguration().getType());
+
+ final IAxisManager rowAxisManager = manager1.getRowAxisManager();
+ final Collection<Object> managedAxis_subSubPackageTable1 = rowAxisManager.getAllManagedAxis();
+ Assert.assertEquals(1, managedAxis_subSubPackageTable1.size());
+ Assert.assertTrue(managedAxis_subSubPackageTable1.contains(subSubPackageTable1));
+ Assert.assertEquals(managedAxis_subSubPackageTable1.size(), rowAxisManager.getTableManager().getRowElementsList().size());
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(subSubPackageTable1));
+
+
+ //we create a second table. This one must be added to the content of the first one
+ final Object result2 = ModelExplorerUtils.executeCreateNestedEditorHandlerInModelExplorer(papyrusEditor, TableCreationTest.view, AllTests.COMMAND_ID, TableCreationTest.subSubPackage, BUNDLE_ID);
+
+ Assert.assertTrue(result2 instanceof NatTableEditor);
+ final NatTableEditor editor2 = (NatTableEditor)result2;
+ final NattableModelManager manager2 = (NattableModelManager)editor2.getAdapter(INattableModelManager.class);
+ Assert.assertNotNull(manager2);
+ final Table subSubPackageTable2 = manager2.getTable();
+ Assert.assertEquals(AllTests.VIEWS_TABLE_ID, subSubPackageTable2.getTableConfiguration().getType());
+
+ //we verify the contents of the second table
+ final IAxisManager rowAxisManager2 = manager2.getRowAxisManager();
+ Collection<Object> managedAxis2 = rowAxisManager2.getAllManagedAxis();
+ Assert.assertEquals(2, managedAxis2.size());
+ Assert.assertTrue(managedAxis2.contains(subSubPackageTable1));
+ Assert.assertTrue(managedAxis2.contains(subSubPackageTable2));
+
+ DisplayUtils.safeReadAndDispatch();
+
+ Assert.assertEquals(managedAxis2.size(), rowAxisManager2.getTableManager().getRowElementsList().size());
+ Assert.assertTrue(rowAxisManager2.getTableManager().getRowElementsList().contains(subSubPackageTable1));
+ Assert.assertTrue(rowAxisManager2.getTableManager().getRowElementsList().contains(subSubPackageTable2));
+
+
+ //we verify the contents of the first table
+ final Collection<Object> managedAxis_subSubPackageTable1_1 = rowAxisManager.getAllManagedAxis();
+ Assert.assertEquals(2, managedAxis_subSubPackageTable1_1.size());
+ Assert.assertTrue(managedAxis_subSubPackageTable1_1.contains(subSubPackageTable1));
+ Assert.assertTrue(managedAxis_subSubPackageTable1_1.contains(subSubPackageTable2));
+ Assert.assertEquals(managedAxis_subSubPackageTable1_1.size(), rowAxisManager.getTableManager().getRowElementsList().size());
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(subSubPackageTable1));
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(subSubPackageTable2));
+
+
+ //-----------------we create a table in subModel. This table must contains only itself and the others table muse not contains it
+ final Object result3 = ModelExplorerUtils.executeCreateNestedEditorHandlerInModelExplorer(papyrusEditor, TableCreationTest.view, AllTests.COMMAND_ID, TableCreationTest.subModel, BUNDLE_ID);
+ Assert.assertTrue(result3 instanceof NatTableEditor);
+ final NatTableEditor editor3 = (NatTableEditor)result3;
+ final NattableModelManager manager3 = (NattableModelManager)editor3.getAdapter(INattableModelManager.class);
+ Assert.assertNotNull(manager3);
+ final Table subModelTable3 = manager3.getTable();
+ Assert.assertEquals(AllTests.VIEWS_TABLE_ID, subModelTable3.getTableConfiguration().getType());
+ DisplayUtils.safeReadAndDispatch();
+ final IAxisManager rowAxisManager3 = manager3.getRowAxisManager();
+ final Collection<Object> managedAxis_SubPackageTable3 = rowAxisManager3.getAllManagedAxis();
+ Assert.assertEquals(1, managedAxis_SubPackageTable3.size());
+ Assert.assertTrue(managedAxis_SubPackageTable3.contains(subModelTable3));
+ Assert.assertEquals(managedAxis_SubPackageTable3.size(), rowAxisManager3.getTableManager().getRowElementsList().size());
+ Assert.assertTrue(rowAxisManager3.getTableManager().getRowElementsList().contains(subModelTable3));
+
+ //we verify that the other tables don't reference it
+ //verify in table 1
+ IAxisManager rowAxisManagerTable1 = manager1.getRowAxisManager();
+ Collection<Object> managedAxisTable1 = rowAxisManagerTable1.getAllManagedAxis();
+ Assert.assertEquals(2, managedAxisTable1.size());
+ Assert.assertFalse(managedAxisTable1.contains(subModelTable3));
+ Assert.assertEquals(managedAxisTable1.size(), rowAxisManagerTable1.getTableManager().getRowElementsList().size());
+ Assert.assertFalse(rowAxisManagerTable1.getTableManager().getRowElementsList().contains(subModelTable3));
+
+ //verify in table 2
+ IAxisManager rowAxisManagerTable2 = manager2.getRowAxisManager();
+ Collection<Object> managedAxisTable2 = rowAxisManagerTable2.getAllManagedAxis();
+ Assert.assertEquals(2, managedAxisTable2.size());
+ Assert.assertFalse(managedAxisTable2.contains(subModelTable3));
+ Assert.assertEquals(managedAxisTable2.size(), rowAxisManagerTable2.getTableManager().getRowElementsList().size());
+ Assert.assertFalse(rowAxisManagerTable2.getTableManager().getRowElementsList().contains(subModelTable3));
+ }
+
+ @AfterClass
+ public static void endOfTest() {
+ GenericUtils.closeAllEditors();
+ }
+
+
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java
new file mode 100644
index 00000000000..257f0f58030
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableCreationTest2.java
@@ -0,0 +1,266 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.views.tests.tests;
+
+import java.io.IOException;
+import java.util.Collection;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.commands.OpenDiagramCommand;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.PageList;
+import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
+import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr;
+import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.nattable.common.editor.NatTableEditor;
+import org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.views.tests.Activator;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.junit.utils.EditorUtils;
+import org.eclipse.papyrus.junit.utils.GenericUtils;
+import org.eclipse.papyrus.junit.utils.ModelExplorerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
+import org.eclipse.swt.widgets.Control;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.IWorkbenchPart;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.PartService;
+import org.eclipse.uml2.uml.Model;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+public class TableCreationTest2 {
+
+ private static final String MODEL_PATH = "/resources/model2"; //$NON-NLS-1$
+
+ private static final String SOURCE_PATH = "/resources/"; //$NON-NLS-1$
+
+ private static final String FILE_ROOT_NAME = "model2"; //$NON-NLS-1$
+
+ private static final String PROJECT_NAME = "test"; //$NON-NLS-1$
+
+ private static IMultiDiagramEditor papyrusEditor;
+
+ private static final String BUNDLE_ID = Activator.getDefault().getBundle().getSymbolicName();
+
+ protected static Model rootModel;
+
+ protected static Model subModel;
+
+ protected static Table table1;
+
+ protected static Diagram diagram1;
+
+ protected static Diagram diagram2;
+
+ protected static ModelExplorerView view;
+
+ @BeforeClass
+ public static void init() {
+ try {
+ initTests(Activator.getDefault().getBundle(), PROJECT_NAME, MODEL_PATH);
+ } catch (CoreException e) {
+ Activator.log.error(e);
+ } catch (IOException e) {
+ Activator.log.error(e);
+ } catch (BundleException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ public static void initTests(final Bundle bundle, final String projectName, final String papyrusModelPath) throws CoreException, IOException, BundleException {
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(projectName);
+ final IFile file = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, FILE_ROOT_NAME);
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ try {
+ papyrusEditor = EditorUtils.openPapyrusEditor(file);
+ } catch (PartInitException e) {
+ setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), e.getMessage()));
+ }
+ try {
+ TableCreationTest2.view = ModelExplorerUtils.openModelExplorerView();
+ } catch (PartInitException e) {
+ setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), e.getMessage()));
+ }
+ EObject root = ModelExplorerUtils.getRootInModelExplorer(TableCreationTest2.view);
+ TableCreationTest2.rootModel = (Model)root;
+ subModel = (Model)TableCreationTest2.rootModel.getMember("SubModel1"); //$NON-NLS-1$
+
+ PageList pageList = getPageList(rootModel);
+ for(final PageRef pageRef : pageList.getAvailablePage()) {
+ Object identifier = pageRef.getPageIdentifier();
+ if(identifier instanceof Diagram) {
+ if("ClassDiagram2".equals(((Diagram)identifier).getName())) {
+ diagram2 = (Diagram)identifier;
+ } else if("ClassDiagram1".equals(((Diagram)identifier).getName())) {
+ diagram1 = (Diagram)identifier;
+ }
+
+ } else if(identifier instanceof Table) {
+ if("TableOfViews0".equals(((Table)identifier).getName())) {
+ table1 = (Table)identifier;
+ }
+ }
+
+ }
+ setStatus(Status.OK_STATUS);
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ Assert.assertEquals(runnableWithResult.getStatus().getMessage(), IStatus.OK, runnableWithResult.getStatus().getSeverity());
+ Assert.assertNotNull(subModel);
+ Assert.assertNotNull(diagram1);
+ Assert.assertNotNull(diagram2);
+ Assert.assertNotNull(table1);
+ Assert.assertNotNull(TableCreationTest2.rootModel);
+ Assert.assertEquals(subModel, table1.getContext());
+ Assert.assertEquals(subModel, diagram2.getElement());
+ Assert.assertEquals(rootModel, diagram1.getElement());
+
+
+ }
+
+ /**
+ *
+ * @return
+ * the page list used for this model
+ */
+ private static final PageList getPageList(final EObject object) {
+ final Resource resource = object.eResource();
+ final ModelSet modelSet = (ModelSet)resource.getResourceSet();
+ final Resource diResource = modelSet.getAssociatedResource(resource, DiModel.DI_FILE_EXTENSION, false);
+ final SashWindowsMngr windowMngr = DiUtils.lookupSashWindowsMngr(diResource);
+ final PageList pageList = windowMngr.getPageList();
+ assert pageList != null;
+ return pageList;
+ }
+
+
+
+ @Test
+ public void createTable2AndDestroyAnOwnedElement() throws ServiceException {
+ final Object result1 = ModelExplorerUtils.executeCreateNestedEditorHandlerInModelExplorer(papyrusEditor, TableCreationTest2.view, AllTests.COMMAND_ID, TableCreationTest2.rootModel, BUNDLE_ID);
+ DisplayUtils.safeReadAndDispatch();
+ Assert.assertTrue(result1 instanceof NatTableEditor);
+ final NatTableEditor editor2 = (NatTableEditor)result1;
+ editor2.setFocus();
+ DisplayUtils.safeReadAndDispatch();
+ final NattableModelManager manager2 = (NattableModelManager)editor2.getAdapter(INattableModelManager.class);
+ Assert.assertNotNull(manager2);
+ final Table table2 = manager2.getTable();
+ Assert.assertEquals(AllTests.VIEWS_TABLE_ID, table2.getTableConfiguration().getType());
+
+ final IAxisManager rowAxisManager = manager2.getRowAxisManager();
+ Collection<Object> managedAxis_Table1 = rowAxisManager.getAllManagedAxis();
+ Assert.assertEquals(4, managedAxis_Table1.size());
+ Assert.assertTrue(managedAxis_Table1.contains(table1));
+ Assert.assertTrue(managedAxis_Table1.contains(table2));
+ Assert.assertTrue(managedAxis_Table1.contains(diagram1));
+ Assert.assertTrue(managedAxis_Table1.contains(diagram2));
+ Assert.assertEquals(managedAxis_Table1.size(), rowAxisManager.getTableManager().getRowElementsList().size());
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(table2));
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(table1));
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(diagram1));
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(diagram2));
+
+
+ TransactionalEditingDomain editingDomain = papyrusEditor.getServicesRegistry().getService(TransactionalEditingDomain.class);
+ DestroyElementRequest request = new DestroyElementRequest(editingDomain, diagram2, false);
+ IElementEditService provider = ElementEditServiceUtils.getCommandProvider(diagram2);
+ ICommand cmd = provider.getEditCommand(request);
+ editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(cmd));
+
+
+ DisplayUtils.safeReadAndDispatch();
+ //verify the contents of table2
+ managedAxis_Table1 = rowAxisManager.getAllManagedAxis();
+ Assert.assertEquals(3, managedAxis_Table1.size());
+ Assert.assertTrue(managedAxis_Table1.contains(table1));
+ Assert.assertTrue(managedAxis_Table1.contains(table2));
+ Assert.assertTrue(managedAxis_Table1.contains(diagram1));
+
+
+
+ Assert.assertEquals(managedAxis_Table1.size(), rowAxisManager.getTableManager().getRowElementsList().size());
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(table2));
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(table1));
+ Assert.assertTrue(rowAxisManager.getTableManager().getRowElementsList().contains(diagram1));
+
+
+ //verify the contents of table1 (we open it)
+ IPageManager pageManager = papyrusEditor.getServicesRegistry().getService(IPageManager.class);
+ Assert.assertEquals(3, pageManager.allPages().size());
+ IEditorPart tableEditor = papyrusEditor.getActiveEditor();
+ editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(new OpenDiagramCommand(editingDomain, table1)));
+ DisplayUtils.safeReadAndDispatch();
+ tableEditor = papyrusEditor.getActiveEditor();
+ Assert.assertTrue(tableEditor instanceof NatTableEditor);
+ INattableModelManager manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class);
+ Assert.assertNotNull(manager);
+ Assert.assertEquals(AllTests.VIEWS_TABLE_ID, manager.getTable().getTableConfiguration().getType());
+
+ IAxisManager axisManager = manager.getRowAxisManager();
+ final Collection<Object> managedAxis_Table2 = axisManager.getAllManagedAxis();
+ Assert.assertEquals(1, managedAxis_Table2.size());
+ Assert.assertTrue(managedAxis_Table2.contains(table1));
+
+ Assert.assertEquals(managedAxis_Table2.size(), axisManager.getTableManager().getRowElementsList().size());
+ Assert.assertTrue(axisManager.getTableManager().getRowElementsList().contains(table1));
+
+
+ }
+
+ @AfterClass
+ public static void endOfTest() {
+ GenericUtils.closeAllEditors();
+ }
+
+
+}
diff --git a/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java
new file mode 100644
index 00000000000..109fd82c006
--- /dev/null
+++ b/tests/junit/plugins/infra/nattable/org.eclipse.papyrus.infra.nattable.views.editor.tests/src/org/eclipse/papyrus/infra/nattable/views/tests/tests/TableVerifyContents.java
@@ -0,0 +1,219 @@
+/*****************************************************************************
+ * Copyright (c) 2013 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:
+ * Vincent Lorenzo (CEA LIST) vincent.lorenzo@cea.fr - Initial API and implementation
+ *
+ *****************************************************************************/
+package org.eclipse.papyrus.infra.nattable.views.tests.tests;
+
+import java.io.IOException;
+import java.util.Collection;
+import java.util.List;
+
+import org.eclipse.core.resources.IFile;
+import org.eclipse.core.resources.IProject;
+import org.eclipse.core.runtime.CoreException;
+import org.eclipse.core.runtime.IStatus;
+import org.eclipse.core.runtime.Status;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.transaction.RunnableWithResult;
+import org.eclipse.emf.transaction.TransactionalEditingDomain;
+import org.eclipse.gmf.runtime.common.core.command.ICommand;
+import org.eclipse.gmf.runtime.emf.type.core.requests.DestroyElementRequest;
+import org.eclipse.gmf.runtime.notation.Diagram;
+import org.eclipse.papyrus.commands.OpenDiagramCommand;
+import org.eclipse.papyrus.commands.wrappers.GMFtoEMFCommandWrapper;
+import org.eclipse.papyrus.infra.core.editor.IMultiDiagramEditor;
+import org.eclipse.papyrus.infra.core.resource.ModelSet;
+import org.eclipse.papyrus.infra.core.resource.sasheditor.DiModel;
+import org.eclipse.papyrus.infra.core.sasheditor.contentprovider.IPageManager;
+import org.eclipse.papyrus.infra.core.sashwindows.di.PageList;
+import org.eclipse.papyrus.infra.core.sashwindows.di.PageRef;
+import org.eclipse.papyrus.infra.core.sashwindows.di.SashWindowsMngr;
+import org.eclipse.papyrus.infra.core.sashwindows.di.util.DiUtils;
+import org.eclipse.papyrus.infra.core.services.ServiceException;
+import org.eclipse.papyrus.infra.nattable.common.editor.NatTableEditor;
+import org.eclipse.papyrus.infra.nattable.manager.axis.IAxisManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.INattableModelManager;
+import org.eclipse.papyrus.infra.nattable.manager.table.NattableModelManager;
+import org.eclipse.papyrus.infra.nattable.model.nattable.Table;
+import org.eclipse.papyrus.infra.nattable.views.tests.Activator;
+import org.eclipse.papyrus.infra.services.edit.service.ElementEditServiceUtils;
+import org.eclipse.papyrus.infra.services.edit.service.IElementEditService;
+import org.eclipse.papyrus.junit.utils.EditorUtils;
+import org.eclipse.papyrus.junit.utils.GenericUtils;
+import org.eclipse.papyrus.junit.utils.ModelExplorerUtils;
+import org.eclipse.papyrus.junit.utils.PapyrusProjectUtils;
+import org.eclipse.papyrus.junit.utils.ProjectUtils;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerPageBookView;
+import org.eclipse.papyrus.views.modelexplorer.ModelExplorerView;
+import org.eclipse.swt.widgets.Display;
+import org.eclipse.ui.IEditorPart;
+import org.eclipse.ui.IViewPart;
+import org.eclipse.ui.IWorkbenchPage;
+import org.eclipse.ui.PartInitException;
+import org.eclipse.ui.PlatformUI;
+import org.eclipse.ui.internal.PartService;
+import org.eclipse.ui.intro.IIntroPart;
+import org.eclipse.uml2.uml.Model;
+import org.junit.AfterClass;
+import org.junit.Assert;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.osgi.framework.Bundle;
+import org.osgi.framework.BundleException;
+
+public class TableVerifyContents {
+
+ private static final String MODEL_PATH = "/resources/model2"; //$NON-NLS-1$
+
+ private static final String SOURCE_PATH = "/resources/"; //$NON-NLS-1$
+
+ private static final String FILE_ROOT_NAME = "model2"; //$NON-NLS-1$
+
+ private static final String PROJECT_NAME = "test"; //$NON-NLS-1$
+
+ private static IMultiDiagramEditor papyrusEditor;
+
+ private static final String BUNDLE_ID = Activator.getDefault().getBundle().getSymbolicName();
+
+ private static Model rootModel;
+
+ private static Model subModel;
+
+ private static Table table1;
+
+ private static Diagram diagram1;
+
+ private static Diagram diagram2;
+
+ private static ModelExplorerView view;
+
+ @BeforeClass
+ public static void init() {
+ try {
+ GenericUtils.closeAllEditors();
+ initTests(Activator.getDefault().getBundle(), PROJECT_NAME, MODEL_PATH);
+
+ } catch (CoreException e) {
+ Activator.log.error(e);
+ } catch (IOException e) {
+ Activator.log.error(e);
+ } catch (BundleException e) {
+ Activator.log.error(e);
+ }
+ }
+
+ public static void initTests(final Bundle bundle, final String projectName, final String papyrusModelPath) throws CoreException, IOException, BundleException {
+ ProjectUtils.removeAllProjectFromTheWorkspace();
+ IProject testProject = ProjectUtils.createProject(projectName);
+ final IFile file = PapyrusProjectUtils.copyPapyrusModel(testProject, bundle, SOURCE_PATH, FILE_ROOT_NAME);
+ RunnableWithResult<?> runnableWithResult = new RunnableWithResult.Impl<Object>() {
+
+ @Override
+ public void run() {
+ try {
+ papyrusEditor = EditorUtils.openPapyrusEditor(file);
+ } catch (PartInitException e) {
+ setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), e.getMessage()));
+ }
+ try {
+ TableVerifyContents.view = ModelExplorerUtils.openModelExplorerView();
+ } catch (PartInitException e) {
+ setStatus(new Status(IStatus.ERROR, bundle.getSymbolicName(), e.getMessage()));
+ }
+ EObject root = ModelExplorerUtils.getRootInModelExplorer(TableVerifyContents.view);
+ TableVerifyContents.rootModel = (Model)root;
+ subModel = (Model)TableVerifyContents.rootModel.getMember("SubModel1"); //$NON-NLS-1$
+
+ PageList pageList = getPageList(rootModel);
+ for(final PageRef pageRef : pageList.getAvailablePage()) {
+ Object identifier = pageRef.getPageIdentifier();
+ if(identifier instanceof Diagram) {
+ if("ClassDiagram2".equals(((Diagram)identifier).getName())) {
+ diagram2 = (Diagram)identifier;
+ } else if("ClassDiagram1".equals(((Diagram)identifier).getName())) {
+ diagram1 = (Diagram)identifier;
+ }
+
+ } else if(identifier instanceof Table) {
+ if("TableOfViews0".equals(((Table)identifier).getName())) {
+ table1 = (Table)identifier;
+ }
+ }
+
+ }
+ setStatus(Status.OK_STATUS);
+ }
+
+ };
+ Display.getDefault().syncExec(runnableWithResult);
+ Assert.assertEquals(runnableWithResult.getStatus().getMessage(), IStatus.OK, runnableWithResult.getStatus().getSeverity());
+ Assert.assertNotNull(subModel);
+ Assert.assertNotNull(diagram1);
+ Assert.assertNotNull(diagram2);
+ Assert.assertNotNull(table1);
+ Assert.assertNotNull(TableVerifyContents.rootModel);
+ Assert.assertEquals(subModel, table1.getContext());
+ Assert.assertEquals(subModel, diagram2.getElement());
+ Assert.assertEquals(rootModel, diagram1.getElement());
+ DisplayUtils.safeReadAndDispatch();
+
+ }
+
+ /**
+ *
+ * @return
+ * the page list used for this model
+ */
+ private static final PageList getPageList(final EObject object) {
+ final Resource resource = object.eResource();
+ final ModelSet modelSet = (ModelSet)resource.getResourceSet();
+ final Resource diResource = modelSet.getAssociatedResource(resource, DiModel.DI_FILE_EXTENSION, false);
+ final SashWindowsMngr windowMngr = DiUtils.lookupSashWindowsMngr(diResource);
+ final PageList pageList = windowMngr.getPageList();
+ assert pageList != null;
+ return pageList;
+ }
+
+ @Test
+ public void verifyContentsForTable1() throws ServiceException {
+ IPageManager pageManager = papyrusEditor.getServicesRegistry().getService(IPageManager.class);
+ Assert.assertEquals(3, pageManager.allPages().size());
+ IEditorPart tableEditor = papyrusEditor.getActiveEditor();
+ Assert.assertNull(tableEditor);
+ TransactionalEditingDomain editingDomain = papyrusEditor.getServicesRegistry().getService(TransactionalEditingDomain.class);
+ editingDomain.getCommandStack().execute(new GMFtoEMFCommandWrapper(new OpenDiagramCommand(editingDomain, table1)));
+ DisplayUtils.safeReadAndDispatch();
+ tableEditor = papyrusEditor.getActiveEditor();
+ Assert.assertTrue(tableEditor instanceof NatTableEditor);
+ INattableModelManager manager = (INattableModelManager)tableEditor.getAdapter(INattableModelManager.class);
+ Assert.assertNotNull(manager);
+ Assert.assertEquals(AllTests.VIEWS_TABLE_ID, manager.getTable().getTableConfiguration().getType());
+
+ IAxisManager axisManager = manager.getRowAxisManager();
+ final Collection<Object> managedAxis_subSubPackageTable1 = axisManager.getAllManagedAxis();
+ Assert.assertEquals(2, managedAxis_subSubPackageTable1.size());
+ Assert.assertTrue(managedAxis_subSubPackageTable1.contains(table1));
+ Assert.assertTrue(managedAxis_subSubPackageTable1.contains(diagram2));
+
+ Assert.assertEquals(managedAxis_subSubPackageTable1.size(), axisManager.getTableManager().getRowElementsList().size());
+ Assert.assertTrue(axisManager.getTableManager().getRowElementsList().contains(table1));
+ Assert.assertTrue(axisManager.getTableManager().getRowElementsList().contains(diagram2));
+ }
+
+ @AfterClass
+ public static void endOfTest() {
+ GenericUtils.closeAllEditors();
+ }
+
+}

Back to the top