Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvlorenzo2013-07-03 11:05:19 -0400
committervlorenzo2013-07-03 11:05:19 -0400
commit5216737713d03f54bbe1338ddd345bf59ec69865 (patch)
tree2b6559135fd21c3666407544af77341b0a62f3b5 /tests/junit
parente14b603c70e1c847ab0a81110633053a8954fc13 (diff)
downloadorg.eclipse.papyrus-5216737713d03f54bbe1338ddd345bf59ec69865.tar.gz
org.eclipse.papyrus-5216737713d03f54bbe1338ddd345bf59ec69865.tar.xz
org.eclipse.papyrus-5216737713d03f54bbe1338ddd345bf59ec69865.zip
Share the new project oep.infra.nattable.model.editor.tests
412225: [Table 2] The generated table editor must be tested https://bugs.eclipse.org/bugs/show_bug.cgi?id=412225
Diffstat (limited to 'tests/junit')
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/.classpath7
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/.project28
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/META-INF/MANIFEST.MF16
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/OSGI-INF/l10n/bundle.properties3
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/about.html28
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/build.properties10
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/org.eclipse.papyrus.infra.nattable.model.editor.tests.launch41
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/plugin.pdoc4
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattable2
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxis2
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisconfiguration2
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisprovider2
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableconfiguration2
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablelabelprovider2
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattabletester2
-rw-r--r--tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/Activator.java66
-rw-r--r--tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/EditorsTests.java152
18 files changed, 395 insertions, 0 deletions
diff --git a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/.classpath b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/.classpath
new file mode 100644
index 00000000000..2d1a4302f04
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/.project b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/.project
new file mode 100644
index 00000000000..1e7ef6ab9bb
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/META-INF/MANIFEST.MF b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..4b510a34366
--- /dev/null
+++ b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/META-INF/MANIFEST.MF
@@ -0,0 +1,16 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %Bundle-Name
+Bundle-SymbolicName: org.eclipse.papyrus.infra.nattable.model.editor.tests
+Bundle-Version: 0.10.0.qualifier
+Bundle-Activator: org.eclipse.papyrus.infra.nattable.model.editor.tests.Activator
+Bundle-Vendor: %Bundle-Vendor
+Require-Bundle: org.eclipse.ui,
+ org.eclipse.core.runtime,
+ org.eclipse.papyrus.infra.core.log;bundle-version="0.10.0",
+ org.eclipse.papyrus.infra.nattable.model.editor;bundle-version="0.10.0",
+ org.junit;bundle-version="4.11.0",
+ org.eclipse.papyrus.junit.utils;bundle-version="0.10.0",
+ org.eclipse.emf.transaction
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
diff --git a/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/OSGI-INF/l10n/bundle.properties b/tests/junit/extraplugins/table/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/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/about.html b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/about.html
new file mode 100644
index 00000000000..598b3684879
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/build.properties b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/build.properties
new file mode 100644
index 00000000000..51ac1bdb6d3
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/org.eclipse.papyrus.infra.nattable.model.editor.tests.launch b/tests/junit/extraplugins/table/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/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/plugin.pdoc b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/plugin.pdoc
new file mode 100644
index 00000000000..c1fca7aba51
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattable b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattable
new file mode 100644
index 00000000000..eceafbc398d
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxis b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxis
new file mode 100644
index 00000000000..16ad7b23134
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisconfiguration b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisconfiguration
new file mode 100644
index 00000000000..baa21916294
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisprovider b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableaxisprovider
new file mode 100644
index 00000000000..278440faf96
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableconfiguration b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattableconfiguration
new file mode 100644
index 00000000000..ab1821e2b47
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablelabelprovider b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattablelabelprovider
new file mode 100644
index 00000000000..e40fa4a30c1
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattabletester b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/resources/My.nattabletester
new file mode 100644
index 00000000000..2f97b020e69
--- /dev/null
+++ b/tests/junit/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/Activator.java b/tests/junit/extraplugins/table/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..231e537885e
--- /dev/null
+++ b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/Activator.java
@@ -0,0 +1,66 @@
+/*****************************************************************************
+ * 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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/AllTests.java b/tests/junit/extraplugins/table/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/extraplugins/table/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/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/EditorsTests.java b/tests/junit/extraplugins/table/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..0aa271395ee
--- /dev/null
+++ b/tests/junit/extraplugins/table/org.eclipse.papyrus.infra.nattable.model.editor.tests/src/org/eclipse/papyrus/infra/nattable/model/editor/tests/tests/EditorsTests.java
@@ -0,0 +1,152 @@
+/*****************************************************************************
+ * 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.CustomNattableconfigurationEditor;
+import org.eclipse.papyrus.infra.nattable.model.editor.customeditors.CustomNattablelabelproviderEditor;
+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);
+ }
+
+ protected String getSourcePath() {
+ return "/resources/"; //$NON-NLS-1$
+ }
+
+ @After
+ public void after() {
+ GenericUtils.closeAllEditors();
+
+ }
+}

Back to the top