diff --git a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/ConfigurationSessionTestSuite.java b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/ConfigurationSessionTestSuite.java index 3e610c84988..49cf6b044e3 100644 --- a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/ConfigurationSessionTestSuite.java +++ b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/ConfigurationSessionTestSuite.java @@ -269,7 +269,7 @@ public void run(TestResult result) { fail(e); } } - if (!shouldSort || isSharedSession()) { + if (!shouldSort) { // for shared sessions, we don't control the execution of test cases super.run(result); return; diff --git a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/SessionTestSuite.java b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/SessionTestSuite.java index e72a0388694..41b4d576a19 100644 --- a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/SessionTestSuite.java +++ b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/SessionTestSuite.java @@ -21,7 +21,6 @@ import junit.framework.TestCase; import junit.framework.TestResult; import junit.framework.TestSuite; -import org.eclipse.core.runtime.Assert; import org.eclipse.core.tests.session.SetupManager.SetupException; public class SessionTestSuite extends TestSuite { @@ -33,8 +32,6 @@ public class SessionTestSuite extends TestSuite { // the id for the plug-in whose classloader ought to be used to load the test case class protected String pluginId; private Setup setup; - // true if test cases should run in the same (shared) session - private boolean sharedSession; protected SessionTestRunner testRunner; public SessionTestSuite(String pluginId) { @@ -123,9 +120,6 @@ private boolean isLocalTest(Test test) { return localTests.contains(test); } - public boolean isSharedSession() { - return sharedSession; - } protected Setup newSetup() throws SetupException { Setup base = SetupManager.getInstance().getDefaultSetup(); @@ -133,36 +127,6 @@ protected Setup newSetup() throws SetupException { return base; } - /** - * Runs this session test suite. - */ - @Override - public void run(TestResult result) { - if (!sharedSession) { - super.run(result); - return; - } - // running this session test suite in shared mode - Enumeration tests = tests(); - Assert.isTrue(tests.hasMoreElements(), "A single test suite must be provided"); - Test onlyTest = tests.nextElement(); - Assert.isTrue(!tests.hasMoreElements(), "Only a single test suite can be run"); - Assert.isTrue(onlyTest instanceof TestSuite, "Only test suites can be run in shared session mode"); - TestSuite nested = (TestSuite) onlyTest; - try { - // in shared mode no TestDescriptors are used, need to set up environment ourselves - Setup localSetup = (Setup) getSetup().clone(); - localSetup.setEclipseArgument(Setup.APPLICATION, applicationId); - localSetup.setEclipseArgument("testpluginname", pluginId); - localSetup.setEclipseArgument("classname", (nested.getName() != null ? nested.getName() : nested.getClass().getName())); - // run the session tests - new SessionTestRunner().run(this, result, localSetup, false); - } catch (SetupException e) { - result.addError(this, e.getCause()); - return; - } - } - protected void runSessionTest(TestDescriptor test, TestResult result) { try { fillTestDescriptor(test); @@ -175,11 +139,6 @@ protected void runSessionTest(TestDescriptor test, TestResult result) { @Override public final void runTest(Test test, TestResult result) { - if (sharedSession) { - // just for safety, prevent anybody from calling this API - we don't run individual tests when in shared mode - throw new UnsupportedOperationException(); - } - if (test instanceof TestDescriptor) { runSessionTest((TestDescriptor) test, result); } else if (test instanceof TestCase) { @@ -220,7 +179,4 @@ void setSetup(Setup setup) { this.setup = setup; } - public void setSharedSession(boolean sharedSession) { - this.sharedSession = sharedSession; - } } diff --git a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/samples/SampleTests.java b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/samples/SampleTests.java index d9c9b18e771..fd5abb8ff26 100644 --- a/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/samples/SampleTests.java +++ b/runtime/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/samples/SampleTests.java @@ -29,7 +29,6 @@ public SampleTests() { // these tests should run in the same session (don't add to a non-shared session test suite) SessionTestSuite shared = new SessionTestSuite(PI_HARNESS); shared.addTestSuite(SameSessionTest.class); - shared.setSharedSession(true); addTest(shared); // play with a crash test addTest(SampleCrashTest.suite());