diff options
author | Christian Halstrick <christian.halstrick@sap.com> | 2014-12-11 23:25:09 +0100 |
---|---|---|
committer | Matthias Sohn <matthias.sohn@sap.com> | 2014-12-12 14:49:02 +0100 |
commit | da595f093e5547a7da583fa0459400e47a2638c6 (patch) | |
tree | 98e39f875999786da116857dcf2d2751f1232370 /org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule | |
parent | 1a054f12298f5c34efc9da7f4b43c73904f68fc0 (diff) | |
download | jgit-da595f093e5547a7da583fa0459400e47a2638c6.tar.gz jgit-da595f093e5547a7da583fa0459400e47a2638c6.zip |
Fix tests on windows by closing repos
Without explicitly closing repos we can't delete the test repositories
on windows.
Change-Id: Id5fa17bd764cbf28703c2f21639d7e969289c2d6
Signed-off-by: Matthias Sohn <matthias.sohn@sap.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule')
4 files changed, 10 insertions, 9 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java index b17b991add..b13c4cd801 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleAddTest.java @@ -131,7 +131,8 @@ public class SubmoduleAddTest extends RepositoryTestCase { command.setURI(uri); Repository repo = command.call(); assertNotNull(repo); - addRepoToClose(repo); + ObjectId subCommit = repo.resolve(Constants.HEAD); + repo.close(); SubmoduleWalk generator = SubmoduleWalk.forIndex(db); assertTrue(generator.next()); @@ -141,9 +142,9 @@ public class SubmoduleAddTest extends RepositoryTestCase { assertEquals(path, generator.getModulesPath()); assertEquals(uri, generator.getConfigUrl()); Repository subModRepo = generator.getRepository(); - addRepoToClose(subModRepo); assertNotNull(subModRepo); - assertEquals(commit, repo.resolve(Constants.HEAD)); + assertEquals(subCommit, commit); + subModRepo.close(); Status status = Git.wrap(db).status().call(); assertTrue(status.getAdded().contains(Constants.DOT_GIT_MODULES)); @@ -206,7 +207,6 @@ public class SubmoduleAddTest extends RepositoryTestCase { fullUri = fullUri.replace('\\', '/'); assertEquals(fullUri, generator.getConfigUrl()); Repository subModRepo = generator.getRepository(); - addRepoToClose(subModRepo); assertNotNull(subModRepo); assertEquals( fullUri, @@ -215,6 +215,7 @@ public class SubmoduleAddTest extends RepositoryTestCase { .getString(ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, ConfigConstants.CONFIG_KEY_URL)); + subModRepo.close(); assertEquals(commit, repo.resolve(Constants.HEAD)); Status status = Git.wrap(db).status().call(); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java index b00d452875..54a6f77b45 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleSyncTest.java @@ -135,8 +135,8 @@ public class SubmoduleSyncTest extends RepositoryTestCase { assertTrue(generator.next()); assertEquals(url, generator.getConfigUrl()); Repository subModRepository = generator.getRepository(); - addRepoToClose(subModRepository); StoredConfig submoduleConfig = subModRepository.getConfig(); + subModRepository.close(); assertEquals(url, submoduleConfig.getString( ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, ConfigConstants.CONFIG_KEY_URL)); @@ -207,8 +207,8 @@ public class SubmoduleSyncTest extends RepositoryTestCase { assertTrue(generator.next()); assertEquals("git://server/sub.git", generator.getConfigUrl()); Repository subModRepository1 = generator.getRepository(); - addRepoToClose(subModRepository1); StoredConfig submoduleConfig = subModRepository1.getConfig(); + subModRepository1.close(); assertEquals("git://server/sub.git", submoduleConfig.getString( ConfigConstants.CONFIG_REMOTE_SECTION, Constants.DEFAULT_REMOTE_NAME, ConfigConstants.CONFIG_KEY_URL)); diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java index eac4c873fb..bcdd5e21b6 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleUpdateTest.java @@ -121,9 +121,9 @@ public class SubmoduleUpdateTest extends RepositoryTestCase { SubmoduleWalk generator = SubmoduleWalk.forIndex(db); assertTrue(generator.next()); Repository subRepo = generator.getRepository(); - addRepoToClose(subRepo); assertNotNull(subRepo); assertEquals(commit, subRepo.resolve(Constants.HEAD)); + subRepo.close(); } @Test diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java index 251938fece..f7acaa7880 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/submodule/SubmoduleWalkTest.java @@ -175,12 +175,12 @@ public class SubmoduleWalkTest extends RepositoryTestCase { assertNull(gen.getModulesUpdate()); assertNull(gen.getModulesUrl()); Repository subRepo = gen.getRepository(); - addRepoToClose(subRepo); assertNotNull(subRepo); assertEquals(modulesGitDir.getAbsolutePath(), subRepo.getDirectory().getAbsolutePath()); assertEquals(new File(db.getWorkTree(), path).getAbsolutePath(), subRepo.getWorkTree().getAbsolutePath()); + subRepo.close(); assertFalse(gen.next()); } @@ -227,11 +227,11 @@ public class SubmoduleWalkTest extends RepositoryTestCase { assertNull(gen.getModulesUpdate()); assertNull(gen.getModulesUrl()); Repository subRepo = gen.getRepository(); - addRepoToClose(subRepo); assertNotNull(subRepo); assertEqualsFile(modulesGitDir, subRepo.getDirectory()); assertEqualsFile(new File(db.getWorkTree(), path), subRepo.getWorkTree()); + subRepo.close(); assertFalse(gen.next()); } |