From b649eaa9a84819f48a9434af67ecab7e6881f37e Mon Sep 17 00:00:00 2001 From: Dariusz Luksza Date: Wed, 25 Jan 2012 01:24:09 +0100 Subject: Move writeTrashFile and deleteFile into JGitTestUtil Moves RepositoryTestCase.writeThashFile, RepositoryTestCase.deleteFile and dependencies into JGitTestUtil for further reuse. Required-by-EGit: If8dfa0251797aca56ddc825619500dc21885ba26 Change-Id: I6fc62c8e6626f907e544b5bbe5d64e864a2c323f Signed-off-by: Dariusz Luksza --- .../tst/org/eclipse/jgit/lib/RepositoryTestCase.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/lib') diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java index 934c76cbb5..0c573ebe71 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/RepositoryTestCase.java @@ -62,6 +62,7 @@ import org.eclipse.jgit.dircache.DirCache; import org.eclipse.jgit.dircache.DirCacheBuilder; import org.eclipse.jgit.dircache.DirCacheCheckout; import org.eclipse.jgit.dircache.DirCacheEntry; +import org.eclipse.jgit.junit.JGitTestUtil; import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase; import org.eclipse.jgit.revwalk.RevCommit; import org.eclipse.jgit.revwalk.RevWalk; @@ -98,14 +99,11 @@ public abstract class RepositoryTestCase extends LocalDiskRepositoryTestCase { protected File writeTrashFile(final String name, final String data) throws IOException { - File path = new File(db.getWorkTree(), name); - write(path, data); - return path; + return JGitTestUtil.writeTrashFile(db, name, data); } protected void deleteTrashFile(final String name) throws IOException { - File path = new File(db.getWorkTree(), name); - FileUtils.delete(path); + JGitTestUtil.deleteTrashFile(db, name); } protected static void checkFile(File f, final String checkData) -- cgit v1.2.3