aboutsummaryrefslogtreecommitdiffstats
path: root/org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
diff options
context:
space:
mode:
authorDariusz Luksza <dariusz@luksza.org>2012-01-25 01:24:09 +0100
committerDariusz Luksza <dariusz@luksza.org>2012-01-25 01:24:41 +0100
commitb649eaa9a84819f48a9434af67ecab7e6881f37e (patch)
treebfac84d0f8e417f395f65c9859db872409f96049 /org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java
parent2fa5bcd6bbf9e4905c9e022fa1cb371b96a02694 (diff)
downloadjgit-b649eaa9a84819f48a9434af67ecab7e6881f37e.tar.gz
jgit-b649eaa9a84819f48a9434af67ecab7e6881f37e.zip
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 <dariusz@luksza.org>
Diffstat (limited to 'org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java')
-rw-r--r--org.eclipse.jgit.junit/src/org/eclipse/jgit/junit/LocalDiskRepositoryTestCase.java11
1 files changed, 1 insertions, 10 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 0c7ae7de72..d8ae705c48 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
@@ -49,10 +49,7 @@ import static org.junit.Assert.assertFalse;
import static org.junit.Assert.fail;
import java.io.File;
-import java.io.FileOutputStream;
import java.io.IOException;
-import java.io.OutputStreamWriter;
-import java.io.Writer;
import java.util.ArrayList;
import java.util.Collections;
import java.util.HashMap;
@@ -435,13 +432,7 @@ public abstract class LocalDiskRepositoryTestCase {
* the file could not be written.
*/
protected void write(final File f, final String body) throws IOException {
- FileUtils.mkdirs(f.getParentFile(), true);
- Writer w = new OutputStreamWriter(new FileOutputStream(f), "UTF-8");
- try {
- w.write(body);
- } finally {
- w.close();
- }
+ JGitTestUtil.write(f, body);
}
/**