diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2011-05-24 09:36:45 +0200 |
---|---|---|
committer | Shawn O. Pearce <spearce@spearce.org> | 2011-05-31 08:58:45 -0700 |
commit | c1525e2aa5e444a2a234de27d6b7189d5d7f715e (patch) | |
tree | 271f0a6a5661572543cddfb126ed2816dbf2f471 /org.eclipse.jgit.junit | |
parent | cc2197ed9c3be35c875c8316f17a2d6e8d338c88 (diff) | |
download | jgit-c1525e2aa5e444a2a234de27d6b7189d5d7f715e.tar.gz 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')
-rw-r--r-- | org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java | 11 |
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 |