diff options
author | René Scheibe <rene.scheibe@gmail.com> | 2018-08-23 23:42:02 +0200 |
---|---|---|
committer | René Scheibe <rene.scheibe@gmail.com> | 2018-08-24 22:39:07 +0200 |
commit | dbe01e8852bec1a7ab6fda7dc85abedba2190604 (patch) | |
tree | 8e609e1c13eb60f571adafb0af082f22bd51f56d /org.eclipse.jgit.test/tst | |
parent | 0b84c5b29ea27cb9af47931792c3819d96da9d8d (diff) | |
download | jgit-dbe01e8852bec1a7ab6fda7dc85abedba2190604.tar.gz jgit-dbe01e8852bec1a7ab6fda7dc85abedba2190604.zip |
Cleanup existing tests
Renamed and restructured tests for improved clarity.
Bug: 479266
Change-Id: Ic9d05ddf722bddd148fa9d9c19248dd53d97f1e4
Signed-off-by: René Scheibe <rene.scheibe@gmail.com>
Diffstat (limited to 'org.eclipse.jgit.test/tst')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java index 8f56a9270e..e10a91c5d8 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/ResetCommandTest.java @@ -179,31 +179,29 @@ public class ResetCommandTest extends RepositoryTestCase { } @Test - public void testHardResetWithConflicts_DoOverWriteUntrackedFile() - throws JGitInternalException, - AmbiguousObjectException, IOException, GitAPIException { + public void testHardResetWithConflicts_OverwriteUntrackedFile() throws Exception { setupRepository(); + git.rm().setCached(true).addFilepattern("a.txt").call(); assertTrue(new File(db.getWorkTree(), "a.txt").exists()); - git.reset().setMode(ResetType.HARD).setRef(Constants.HEAD) - .call(); + + git.reset().setMode(ResetType.HARD).setRef(Constants.HEAD).call(); assertTrue(new File(db.getWorkTree(), "a.txt").exists()); assertEquals("content", read(new File(db.getWorkTree(), "a.txt"))); } @Test - public void testHardResetWithConflicts_DoDeleteFileFolderConflicts() - throws JGitInternalException, - AmbiguousObjectException, IOException, GitAPIException { + public void testHardResetWithConflicts_DeleteFileFolderConflict() throws Exception { setupRepository(); - writeTrashFile("d/c.txt", "x"); - git.add().addFilepattern("d/c.txt").call(); - FileUtils.delete(new File(db.getWorkTree(), "d"), FileUtils.RECURSIVE); - writeTrashFile("d", "y"); - git.reset().setMode(ResetType.HARD).setRef(Constants.HEAD) - .call(); - assertFalse(new File(db.getWorkTree(), "d").exists()); + writeTrashFile("dir-or-file/c.txt", "content"); + git.add().addFilepattern("dir-or-file/c.txt").call(); + + FileUtils.delete(new File(db.getWorkTree(), "dir-or-file"), FileUtils.RECURSIVE); + writeTrashFile("dir-or-file", "content"); + + git.reset().setMode(ResetType.HARD).setRef(Constants.HEAD).call(); + assertFalse(new File(db.getWorkTree(), "dir-or-file").exists()); } @Test |