Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Valenta2002-08-15 18:20:52 +0000
committerMichael Valenta2002-08-15 18:20:52 +0000
commit1374869bdeeb0b2736be90717f0d6aaba7db57bc (patch)
tree31b82b1a8f6001deb0455b62ca1d86b89699dcc5 /tests/org.eclipse.team.tests.core
parentdcba06fd387e020b37036464910f8dd2979877e0 (diff)
downloadeclipse.platform.team-1374869bdeeb0b2736be90717f0d6aaba7db57bc.tar.gz
eclipse.platform.team-1374869bdeeb0b2736be90717f0d6aaba7db57bc.tar.xz
eclipse.platform.team-1374869bdeeb0b2736be90717f0d6aaba7db57bc.zip
Added purge of target directory before test run
Diffstat (limited to 'tests/org.eclipse.team.tests.core')
-rw-r--r--tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TargetTestSetup.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TargetTestSetup.java b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TargetTestSetup.java
index c1f603dfe..e23583a92 100644
--- a/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TargetTestSetup.java
+++ b/tests/org.eclipse.team.tests.core/src/org/eclipse/team/tests/core/TargetTestSetup.java
@@ -21,6 +21,8 @@ import junit.extensions.TestSetup;
import junit.framework.Test;
import org.eclipse.core.runtime.Path;
+import org.eclipse.team.core.sync.IRemoteResource;
+import org.eclipse.team.internal.core.target.IRemoteTargetResource;
import org.eclipse.team.internal.core.target.ISiteFactory;
import org.eclipse.team.internal.core.target.Site;
import org.eclipse.team.internal.core.target.TargetManager;
@@ -77,6 +79,7 @@ public class TargetTestSetup extends TestSetup {
}
}
/**
+ * This method runs before starting the entire test suite.
* @see TestCase#setUp()
*/
protected void setUp() throws Exception {
@@ -91,6 +94,14 @@ public class TargetTestSetup extends TestSetup {
TargetManager.addSite(l);
}
location = getSite();
+
+ //clean up the directory:
+ IRemoteTargetResource remote=location.getRemoteResource().getFolder(properties.getProperty("test_dir"));
+ IRemoteResource[] children=remote.members(null);
+ for (int i = 0; i < children.length; i++) {
+ ((IRemoteTargetResource)children[i]).delete(null);
+ }
+
TargetProvider target = location.newProvider(new Path(properties.getProperty("test_dir")));
assertNotNull(target);
}

Back to the top