diff options
Diffstat (limited to 'org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java')
-rw-r--r-- | org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java | 58 |
1 files changed, 29 insertions, 29 deletions
diff --git a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java index 33f305d487..61b099d61d 100644 --- a/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java +++ b/org.eclipse.jgit.test/tst/org/eclipse/jgit/api/AddCommandTest.java @@ -90,7 +90,7 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddExistingSingleFile() throws IOException, NoFilepatternException { File file = new File(db.getWorkTree(), "a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); @@ -106,9 +106,9 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddExistingSingleFileInSubDir() throws IOException, NoFilepatternException { - new File(db.getWorkTree(), "sub").mkdir(); + FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); @@ -125,7 +125,7 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddExistingSingleFileTwice() throws IOException, NoFilepatternException { File file = new File(db.getWorkTree(), "a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); @@ -149,7 +149,7 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddExistingSingleFileTwiceWithCommit() throws Exception { File file = new File(db.getWorkTree(), "a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); @@ -175,7 +175,7 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddRemovedFile() throws Exception { File file = new File(db.getWorkTree(), "a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); @@ -197,7 +197,7 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddRemovedCommittedFile() throws Exception { File file = new File(db.getWorkTree(), "a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); @@ -223,13 +223,13 @@ public class AddCommandTest extends RepositoryTestCase { // prepare conflict File file = new File(db.getWorkTree(), "a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "b.txt"); - file2.createNewFile(); + FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); @@ -275,13 +275,13 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddTwoFiles() throws Exception { File file = new File(db.getWorkTree(), "a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "b.txt"); - file2.createNewFile(); + FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); @@ -296,15 +296,15 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddFolder() throws Exception { - new File(db.getWorkTree(), "sub").mkdir(); + FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); - file2.createNewFile(); + FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); @@ -319,21 +319,21 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddIgnoredFile() throws Exception { - new File(db.getWorkTree(), "sub").mkdir(); + FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File ignoreFile = new File(db.getWorkTree(), ".gitignore"); - ignoreFile.createNewFile(); + FileUtils.createNewFile(ignoreFile); writer = new PrintWriter(ignoreFile); writer.print("sub/b.txt"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); - file2.createNewFile(); + FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); @@ -348,15 +348,15 @@ public class AddCommandTest extends RepositoryTestCase { @Test public void testAddWholeRepo() throws Exception { - new File(db.getWorkTree(), "sub").mkdir(); + FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); - file2.createNewFile(); + FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); @@ -375,15 +375,15 @@ public class AddCommandTest extends RepositoryTestCase { // file c exists in workdir but not in index -> added @Test public void testAddWithoutParameterUpdate() throws Exception { - new File(db.getWorkTree(), "sub").mkdir(); + FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); - file2.createNewFile(); + FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); @@ -400,7 +400,7 @@ public class AddCommandTest extends RepositoryTestCase { // new unstaged file sub/c.txt File file3 = new File(db.getWorkTree(), "sub/c.txt"); - file3.createNewFile(); + FileUtils.createNewFile(file3); writer = new PrintWriter(file3); writer.print("content c"); writer.close(); @@ -429,15 +429,15 @@ public class AddCommandTest extends RepositoryTestCase { // file c exists in workdir but not in index -> unchanged @Test public void testAddWithParameterUpdate() throws Exception { - new File(db.getWorkTree(), "sub").mkdir(); + FileUtils.mkdir(new File(db.getWorkTree(), "sub")); File file = new File(db.getWorkTree(), "sub/a.txt"); - file.createNewFile(); + FileUtils.createNewFile(file); PrintWriter writer = new PrintWriter(file); writer.print("content"); writer.close(); File file2 = new File(db.getWorkTree(), "sub/b.txt"); - file2.createNewFile(); + FileUtils.createNewFile(file2); writer = new PrintWriter(file2); writer.print("content b"); writer.close(); @@ -454,7 +454,7 @@ public class AddCommandTest extends RepositoryTestCase { // new unstaged file sub/c.txt File file3 = new File(db.getWorkTree(), "sub/c.txt"); - file3.createNewFile(); + FileUtils.createNewFile(file3); writer = new PrintWriter(file3); writer.print("content c"); writer.close(); |