Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBoris Bokowski2009-12-17 21:15:45 +0000
committerBoris Bokowski2009-12-17 21:15:45 +0000
commitae9ed50d26b7d2a547770856acd7fd86dd3515f6 (patch)
tree2e919a4178509aeb00a094b0b465604ed99da98b /bundles/org.eclipse.e4.ui.workbench3
parenta1c720e13e1b6af98f434232b7c92d48e115c94a (diff)
downloadeclipse.platform.ui-ae9ed50d26b7d2a547770856acd7fd86dd3515f6.tar.gz
eclipse.platform.ui-ae9ed50d26b7d2a547770856acd7fd86dd3515f6.tar.xz
eclipse.platform.ui-ae9ed50d26b7d2a547770856acd7fd86dd3515f6.zip
Bug 296599 - Add ability to run e4 based tests using PDE's JUnit Plug-in Testv20091217-1830
Diffstat (limited to 'bundles/org.eclipse.e4.ui.workbench3')
-rw-r--r--bundles/org.eclipse.e4.ui.workbench3/.classpath7
-rw-r--r--bundles/org.eclipse.e4.ui.workbench3/.project28
-rw-r--r--bundles/org.eclipse.e4.ui.workbench3/.settings/org.eclipse.jdt.core.prefs8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench3/META-INF/MANIFEST.MF8
-rw-r--r--bundles/org.eclipse.e4.ui.workbench3/build.properties4
-rw-r--r--bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/ITestHarness.java26
-rw-r--r--bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/TestableObject.java83
7 files changed, 164 insertions, 0 deletions
diff --git a/bundles/org.eclipse.e4.ui.workbench3/.classpath b/bundles/org.eclipse.e4.ui.workbench3/.classpath
new file mode 100644
index 00000000000..64c5e31b7a2
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench3/.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/bundles/org.eclipse.e4.ui.workbench3/.project b/bundles/org.eclipse.e4.ui.workbench3/.project
new file mode 100644
index 00000000000..be89fb6b338
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench3/.project
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.e4.ui.workbench3</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/bundles/org.eclipse.e4.ui.workbench3/.settings/org.eclipse.jdt.core.prefs b/bundles/org.eclipse.e4.ui.workbench3/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000000..6627738d91a
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench3/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,8 @@
+#Fri Nov 27 16:04:09 EST 2009
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/bundles/org.eclipse.e4.ui.workbench3/META-INF/MANIFEST.MF b/bundles/org.eclipse.e4.ui.workbench3/META-INF/MANIFEST.MF
new file mode 100644
index 00000000000..2a3e760c6b7
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench3/META-INF/MANIFEST.MF
@@ -0,0 +1,8 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: Bundle for non-legacy Workbench APIs that should be available in e4
+Bundle-SymbolicName: org.eclipse.e4.ui.workbench3
+Bundle-Version: 1.0.0.qualifier
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Require-Bundle: org.eclipse.equinox.common;bundle-version="3.6.0"
+Export-Package: org.eclipse.ui.testing
diff --git a/bundles/org.eclipse.e4.ui.workbench3/build.properties b/bundles/org.eclipse.e4.ui.workbench3/build.properties
new file mode 100644
index 00000000000..34d2e4d2dad
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench3/build.properties
@@ -0,0 +1,4 @@
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .
diff --git a/bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/ITestHarness.java b/bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/ITestHarness.java
new file mode 100644
index 00000000000..cc23643047d
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/ITestHarness.java
@@ -0,0 +1,26 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2006 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.testing;
+
+/**
+ * Represents an arbitrary test harness.
+ *
+ * @since 3.0
+ */
+public interface ITestHarness {
+
+ /**
+ * Runs the tests.
+ */
+ public void runTests();
+
+}
diff --git a/bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/TestableObject.java b/bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/TestableObject.java
new file mode 100644
index 00000000000..037f06bdc86
--- /dev/null
+++ b/bundles/org.eclipse.e4.ui.workbench3/src/org/eclipse/ui/testing/TestableObject.java
@@ -0,0 +1,83 @@
+/*******************************************************************************
+ * Copyright (c) 2003, 2006 IBM Corporation and others.
+ * 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:
+ * IBM Corporation - initial API and implementation
+ *******************************************************************************/
+
+package org.eclipse.ui.testing;
+
+import org.eclipse.core.runtime.Assert;
+
+/**
+ * A testable object.
+ * Allows a test harness to register itself with a testable object.
+ * The test harness is notified of test-related lifecycle events,
+ * such as when is an appropriate time to run tests on the object.
+ * This also provides API for running tests as a runnable, and for signaling
+ * when the tests are starting and when they are finished.
+ * <p>
+ * The workbench provides an implementation of this facade, available
+ * via <code>PlatformUI.getTestableObject()</code>.
+ * </p>
+ *
+ * @since 3.0
+ */
+public class TestableObject {
+
+ private ITestHarness testHarness;
+
+ /**
+ * Returns the test harness, or <code>null</code> if it has not yet been set.
+ *
+ * @return the test harness or <code>null</code>
+ */
+ public ITestHarness getTestHarness() {
+ return testHarness;
+ }
+
+ /**
+ * Sets the test harness.
+ *
+ * @param testHarness the test harness
+ */
+ public void setTestHarness(ITestHarness testHarness) {
+ Assert.isNotNull(testHarness);
+ this.testHarness = testHarness;
+ }
+
+ /**
+ * Runs the given test runnable.
+ * The default implementation simply invokes <code>run</code> on the
+ * given test runnable. Subclasses may extend.
+ *
+ * @param testRunnable the test runnable to run
+ */
+ public void runTest(Runnable testRunnable) {
+ testRunnable.run();
+ }
+
+ /**
+ * Notification from the test harness that it is starting to run
+ * the tests.
+ * The default implementation does nothing.
+ * Subclasses may override.
+ */
+ public void testingStarting() {
+ // do nothing
+ }
+
+ /**
+ * Notification from the test harness that it has finished running the
+ * tests.
+ * The default implementation does nothing.
+ * Subclasses may override.
+ */
+ public void testingFinished() {
+ // do nothing
+ }
+}

Back to the top