reuse setup accross test cases
diff --git a/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/SessionTestSuite.java b/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/SessionTestSuite.java
index 49af0bc..c1186e2 100644
--- a/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/SessionTestSuite.java
+++ b/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/SessionTestSuite.java
@@ -18,9 +18,10 @@
public static final String CORE_TEST_APPLICATION = "org.eclipse.pde.junit.runtime.coretestapplication"; //$NON-NLS-1$
public static final String UI_TEST_APPLICATION = "org.eclipse.pde.junit.runtime.uitestapplication"; //$NON-NLS-1$
protected String applicationId = CORE_TEST_APPLICATION;
- protected String pluginId;
- protected SessionTestRunner testRunner;
private Set crashTests = new HashSet();
+ protected String pluginId;
+ private Setup setup;
+ protected SessionTestRunner testRunner;
public SessionTestSuite(String pluginId) {
super();
@@ -63,9 +64,16 @@
return applicationId;
}
- protected Setup getSetup() throws SetupException {
- return SetupManager.getInstance().getDefaultSetup();
+ public Setup getSetup() throws SetupException {
+ if (setup == null)
+ setup = newSetup();
+ return setup;
}
+
+ protected Setup newSetup() throws SetupException {
+ return SetupManager.getInstance().getDefaultSetup();
+ }
+
protected SessionTestRunner getTestRunner() {
if (testRunner == null)
@@ -111,4 +119,7 @@
public void setApplicationId(String applicationId) {
this.applicationId = applicationId;
}
+ void setSetup(Setup setup) {
+ this.setup = setup;
+ }
}
\ No newline at end of file
diff --git a/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/WorkspaceSessionTestSuite.java b/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/WorkspaceSessionTestSuite.java
index cc02ee9..f6dffe0 100644
--- a/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/WorkspaceSessionTestSuite.java
+++ b/tests/org.eclipse.core.tests.harness/src/org/eclipse/core/tests/session/WorkspaceSessionTestSuite.java
@@ -44,8 +44,8 @@
* Ensures setup uses this suite's instance location.
* @throws SetupException
*/
- protected Setup getSetup() throws SetupException {
- Setup base = super.getSetup();
+ protected Setup newSetup() throws SetupException {
+ Setup base = super.newSetup();
base.setEclipseArgument(Setup.DATA, instanceLocation.toOSString());
return base;
}