Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJens Baumgart2010-09-08 14:42:36 +0000
committerMatthias Sohn2010-09-08 14:42:36 +0000
commitff2c89b7635c17e55ddfc1d37fc91b60ff405a1e (patch)
treef0f492b745dc0a9a6c07fcf3efc1058c46fc33b3 /org.eclipse.egit.core.test
parentfd50173b0086785c5e7338c2962310e5f5a3e918 (diff)
downloadegit-ff2c89b7635c17e55ddfc1d37fc91b60ff405a1e.tar.gz
egit-ff2c89b7635c17e55ddfc1d37fc91b60ff405a1e.tar.xz
egit-ff2c89b7635c17e55ddfc1d37fc91b60ff405a1e.zip
Clear RepositoryCache after each test to fix core tests
With this fix the core test suite is running also on Mac. Reason for the failures before was the usage of out-dated Repository instances contained in RepositoryCache which caused spurious failures when running the full test suite while running tests individually always succeeded. A follow-up fix should care for the life cycle of Repository objects in RepositoryCache. Change-Id: I1f16a9de48435bd98e2520e34e49bc1ca6893f14 Signed-off-by: Jens Baumgart <jens.baumgart@sap.com> Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.egit.core.test')
-rw-r--r--org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java4
1 files changed, 4 insertions, 0 deletions
diff --git a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
index a6ceca2a72..da5920dd9b 100644
--- a/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
+++ b/org.eclipse.egit.core.test/src/org/eclipse/egit/core/test/GitTestCase.java
@@ -15,6 +15,7 @@ import java.io.IOException;
import org.eclipse.core.resources.IProject;
import org.eclipse.core.resources.ResourcesPlugin;
+import org.eclipse.egit.core.Activator;
import org.eclipse.jgit.junit.MockSystemReader;
import org.eclipse.jgit.lib.Constants;
import org.eclipse.jgit.lib.ObjectId;
@@ -35,6 +36,9 @@ public abstract class GitTestCase {
@Before
public void setUp() throws Exception {
+ // ensure there are no shared Repository instances left
+ // when starting a new test
+ Activator.getDefault().getRepositoryCache().clear();
MockSystemReader mockSystemReader = new MockSystemReader();
SystemReader.setInstance(mockSystemReader);
mockSystemReader.setProperty(Constants.GIT_CEILING_DIRECTORIES_KEY,

Back to the top