import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
import static org.junit.Assert.fail;
import java.io.File;
import org.eclipse.jgit.http.server.resolver.ServiceNotEnabledException;
import org.eclipse.jgit.junit.LocalDiskRepositoryTestCase;
import org.eclipse.jgit.lib.Repository;
+import org.eclipse.jgit.util.FileUtils;
import org.junit.Test;
public class FileResolverTest extends LocalDiskRepositoryTestCase {
fail("did not honor export-all flag");
}
- export.createNewFile();
- assertTrue("has git-daemon-export-ok", export.exists());
+ FileUtils.createNewFile(export);
resolver = new FileResolver(base, false /* require flag */);
try {
resolver.open(null, name).close();
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.treewalk.FileTreeIterator;
import org.eclipse.jgit.treewalk.TreeWalk;
+import org.eclipse.jgit.util.FileUtils;
import org.junit.Before;
import org.junit.Test;
private void createEmptyFolder() throws Exception {
File path = new File(db.getWorkTree(), FOLDER);
- path.mkdir();
- assertTrue(path.isDirectory());
+ FileUtils.mkdir(path);
}
private RevCommit createEmptyFolderAndCommit() throws Exception {
private void createEmptyFolderUntracked() throws Exception {
File path = new File(db.getWorkTree(), UNTRACKED_FOLDER);
- path.mkdir();
- assertTrue(path.isDirectory());
+ FileUtils.mkdir(path);
}
private void createEmptyFolderIgnored() throws Exception {
File path = new File(db.getWorkTree(), IGNORED_FOLDER);
- path.mkdir();
- assertTrue(path.isDirectory());
+ FileUtils.mkdir(path);
writeTrashFile(GITIGNORE, GITIGNORE + "\n" + IGNORED_FOLDER + "/");
}