Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Wolf2021-08-24 10:43:44 +0000
committerThomas Wolf2021-08-24 10:43:44 +0000
commitd7b1f318fff07528fce926596725c29cf3c11e68 (patch)
tree931be5b813e35cfc787e7341d66c35f97aff1e1c
parent81db9f757faf0ac9adf1404954dbbe55aeb39b81 (diff)
downloadegit-d7b1f318fff07528fce926596725c29cf3c11e68.tar.gz
egit-d7b1f318fff07528fce926596725c29cf3c11e68.tar.xz
egit-d7b1f318fff07528fce926596725c29cf3c11e68.zip
[test] Use a local test directory
Change-Id: I7eb26c18e70a9f89e8dd774cc91ed8dffddfd4e2 Signed-off-by: Thomas Wolf <thomas.wolf@paranor.ch>
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/AutoShareTest.java10
1 files changed, 5 insertions, 5 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/AutoShareTest.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/AutoShareTest.java
index c00097bd3e..fdfe92f7f2 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/AutoShareTest.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/internal/AutoShareTest.java
@@ -48,9 +48,7 @@ import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.storage.file.FileRepositoryBuilder;
import org.junit.After;
import org.junit.Before;
-import org.junit.Rule;
import org.junit.Test;
-import org.junit.rules.TemporaryFolder;
/**
* Test for bug 574806/bug 575240.
@@ -65,8 +63,7 @@ public class AutoShareTest extends GitTestCase {
+ "\t<buildSpec>\n" + "\t</buildSpec>\n" + "\t<natures>\n"
+ "\t</natures>\n" + "</projectDescription>";
- @Rule
- public TemporaryFolder folder = new TemporaryFolder();
+ private File testDirectory;
private File repoPath;
@@ -78,8 +75,10 @@ public class AutoShareTest extends GitTestCase {
@Before
public void setUp() throws Exception {
super.setUp();
+ testDirectory = testUtils.createTempDir("AutoShareTest");
+ File gitDirectory = new File(testDirectory, ".git");
try (Repository repository = FileRepositoryBuilder
- .create(folder.newFolder(".git").getCanonicalFile())) {
+ .create(gitDirectory.getCanonicalFile())) {
repository.create();
prepareProject(repository);
repoPath = repository.getDirectory();
@@ -96,6 +95,7 @@ public class AutoShareTest extends GitTestCase {
}
RepositoryUtil.INSTANCE.removeDir(repoPath);
RepositoryCache.INSTANCE.clear();
+ testUtils.deleteTempDirs();
super.tearDown();
}

Back to the top