public abstract class JGitTestUtil extends Object
Modifier and Type | Field and Description |
---|---|
static String |
CLASSPATH_TO_RESOURCES |
Modifier and Type | Method and Description |
---|---|
static void |
assertEquals(byte[] exp,
byte[] act) |
static boolean |
check(Repository db,
String name) |
static void |
copyTestResource(String name,
File dest) |
static void |
deleteTrashFile(Repository db,
String name) |
static String |
getName() |
static File |
getTestResourceFile(String fileName) |
static String |
read(File file)
Fully read a UTF-8 file and return as a string.
|
static String |
read(Repository db,
String name) |
static void |
write(File f,
String body)
Write a string as a UTF-8 file.
|
static File |
writeTrashFile(Repository db,
String name,
String data) |
static File |
writeTrashFile(Repository db,
String subdir,
String name,
String data) |
public static final String CLASSPATH_TO_RESOURCES
public static String getName()
public static void assertEquals(byte[] exp, byte[] act)
public static void copyTestResource(String name, File dest) throws IOException
IOException
public static File writeTrashFile(Repository db, String name, String data) throws IOException
IOException
public static File writeTrashFile(Repository db, String subdir, String name, String data) throws IOException
IOException
public static void write(File f, String body) throws IOException
f
- file to write the string to. Caller is responsible for making
sure it is in the trash directory or will otherwise be cleaned
up at the end of the test. If the parent directory does not
exist, the missing parent directories are automatically
created.body
- content to write to the file.IOException
- the file could not be written.public static String read(File file) throws IOException
file
- file to read the content of.IOException
- the file does not exist, or could not be read.public static String read(Repository db, String name) throws IOException
IOException
public static boolean check(Repository db, String name)
public static void deleteTrashFile(Repository db, String name) throws IOException
IOException
Copyright © 2015 Eclipse JGit Project. All rights reserved.