Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Halstrick2011-05-24 07:36:45 +0000
committerShawn O. Pearce2011-05-31 15:58:45 +0000
commitc1525e2aa5e444a2a234de27d6b7189d5d7f715e (patch)
tree271f0a6a5661572543cddfb126ed2816dbf2f471 /org.eclipse.jgit.junit/src
parentcc2197ed9c3be35c875c8316f17a2d6e8d338c88 (diff)
downloadjgit-c1525e2aa5e444a2a234de27d6b7189d5d7f715e.tar.gz
jgit-c1525e2aa5e444a2a234de27d6b7189d5d7f715e.tar.xz
jgit-c1525e2aa5e444a2a234de27d6b7189d5d7f715e.zip
Make sure test repositories are closed
Some repositories created during tests are not added to the 'toClose' list in LocalDiskRepositoryTestCase. Therefore when the tests end we may have open FileHandles and on Windows this may cause the tests to fail because we can't delete those files. This is fixed by adding the possibility to explicitly add repositories to the list of repos which are closed automatically. Change-Id: I1261baeef4c7d9aaedd7c34b546393bfa005bbcc Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
Diffstat (limited to 'org.eclipse.jgit.junit/src')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
index 30d437540f..8ed51fb908 100644
--- a/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
+++ b/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
@@ -303,6 +303,17 @@ public abstract class LocalDiskRepositoryTestCase {
}
/**
+ * Adds a repository to the list of repositories which is closed at the end
+ * of the tests
+ *
+ * @param r
+ * the repository to be closed
+ */
+ public void addRepoToClose(Repository r) {
+ toClose.add(r);
+ }
+
+ /**
* Creates a new unique directory for a test repository
*
* @param bare

Back to the top