summaryrefslogtreecommitdiffstatsabout
diff options
context:
space:
mode:
authorBenjamin Muskalla2010-08-05 11:08:46 (EDT)
committer Benjamin Muskalla2010-08-05 11:08:46 (EDT)
commitc4f3c3074f817f5cc9f0f7cda7a5381e5da2f4e5 (patch)
tree424c4133d9d22b8c29662d8480379de690cbe5b1
parentd1c38ce1072252d727bc443e99ae75bee395465f (diff)
downloadegit-c4f3c3074f817f5cc9f0f7cda7a5381e5da2f4e5.zip
egit-c4f3c3074f817f5cc9f0f7cda7a5381e5da2f4e5.tar.gz
egit-c4f3c3074f817f5cc9f0f7cda7a5381e5da2f4e5.tar.bz2
Cleanup temp dirs after test executionrefs/changes/41/1241/1
Currently the EGit Core Suite fails to clean up the temp directories in my user dir. Instead of only deleting the working dirs, we now use the deleteTempDirs to ensure we cleanup everything that we create during the testrun. Also renamed getTempDir to createTempDir to reflect the real intention. Change-Id: I949e36ba0ae18b537fc9d5424af13fa8f2613046 Signed-off-by: Benjamin Muskalla <bmuskalla@eclipsesource.com>
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java2
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/DiscardChangesOperationTest.java4
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java7
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java7
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java11
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java4
6 files changed, 18 insertions, 17 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java
index 33c97dd..bb5902a 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/TestUtils.java
@@ -65,7 +65,7 @@ public class TestUtils {
* directory; may or may not exist
* @throws IOException
*/
- public File getTempDir(String name) throws IOException {
+ public File createTempDir(String name) throws IOException {
File userHome = FS.DETECTED.userHome();
File rootDir = new File(userHome, "EGitCoreTestTempDir");
File result = new File(rootDir, name);
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/DiscardChangesOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/DiscardChangesOperationTest.java
index 5b2e60d..a20298a 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/DiscardChangesOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/DiscardChangesOperationTest.java
@@ -42,7 +42,7 @@ public class DiscardChangesOperationTest extends DualRepositoryTestCase {
@Before
public void setUp() throws Exception {
- workdir = testUtils.getTempDir("Repository1");
+ workdir = testUtils.createTempDir("Repository1");
repository1 = new TestRepository(new File(workdir, Constants.DOT_GIT));
@@ -78,7 +78,7 @@ public class DiscardChangesOperationTest extends DualRepositoryTestCase {
project.delete(false, false, null);
repository1.dispose();
repository1 = null;
- testUtils.deleteRecursive(workdir);
+ testUtils.deleteTempDirs();
}
@Test
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java
index 183f173..b9fd99f 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/ListRemoteOperationTest.java
@@ -54,8 +54,8 @@ public class ListRemoteOperationTest extends DualRepositoryTestCase {
@Before
public void setUp() throws Exception {
- workdir = testUtils.getTempDir("Repository1");
- workdir2 = testUtils.getTempDir("Repository2");
+ workdir = testUtils.createTempDir("Repository1");
+ workdir2 = testUtils.createTempDir("Repository2");
repository1 = new TestRepository(new File(workdir, Constants.DOT_GIT));
@@ -109,8 +109,7 @@ public class ListRemoteOperationTest extends DualRepositoryTestCase {
public void tearDown() throws Exception {
repository1.dispose();
repository2.dispose();
- testUtils.deleteRecursive(workdir);
- testUtils.deleteRecursive(workdir2);
+ testUtils.deleteTempDirs();
}
/**
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
index 9432e2b..16f8e48 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/PushOperationTest.java
@@ -64,8 +64,8 @@ public class PushOperationTest extends DualRepositoryTestCase {
@Before
public void setUp() throws Exception {
- workdir = testUtils.getTempDir("Repository1");
- workdir2 = testUtils.getTempDir("Repository2");
+ workdir = testUtils.createTempDir("Repository1");
+ workdir2 = testUtils.createTempDir("Repository2");
repository1 = new TestRepository(new File(workdir, Constants.DOT_GIT));
@@ -121,8 +121,7 @@ public class PushOperationTest extends DualRepositoryTestCase {
repository2.dispose();
repository1 = null;
repository2 = null;
- testUtils.deleteRecursive(workdir);
- testUtils.deleteRecursive(workdir2);
+ testUtils.deleteTempDirs();
}
/**
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java
index e6ae24e..f97f37e 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TagOperationTest.java
@@ -34,15 +34,16 @@ public class TagOperationTest extends DualRepositoryTestCase {
String projectName = "TagTest";
+ IProject project;
+
@Before
public void setUp() throws Exception {
- workdir = testUtils.getTempDir("Repository1");
+ workdir = testUtils.createTempDir("Repository1");
repository1 = new TestRepository(new File(workdir, Constants.DOT_GIT));
- // now we create a project in repo1
- IProject project = testUtils.createProjectInLocalFileSystem(workdir,
+ project = testUtils.createProjectInLocalFileSystem(workdir,
projectName);
testUtils.addFileToProject(project, "folder1/file1.txt", "Hello world");
@@ -70,9 +71,11 @@ public class TagOperationTest extends DualRepositoryTestCase {
@After
public void tearDown() throws Exception {
+ project.close(null);
+ project.delete(false, false, null);
repository1.dispose();
repository1 = null;
- testUtils.deleteRecursive(workdir);
+ testUtils.deleteTempDirs();
}
@Test
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java
index 24eae1e..a454cc4 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/op/TrackUntrackOperationTest.java
@@ -44,7 +44,7 @@ public class TrackUntrackOperationTest extends DualRepositoryTestCase {
@Before
public void setUp() throws Exception {
- workdir = testUtils.getTempDir("Repository1");
+ workdir = testUtils.createTempDir("Repository1");
repository1 = new TestRepository(new File(workdir, Constants.DOT_GIT));
@@ -62,7 +62,7 @@ public class TrackUntrackOperationTest extends DualRepositoryTestCase {
project.delete(false, false, null);
repository1.dispose();
repository1 = null;
- testUtils.deleteRecursive(workdir);
+ testUtils.deleteTempDirs();
}
@Test