|
1 | 1 | /* |
2 | | - * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/FileUtilsTestCase.java,v 1.4 2003/10/17 20:15:46 matth Exp $ |
3 | | - * $Revision: 1.4 $ |
4 | | - * $Date: 2003/10/17 20:15:46 $ |
| 2 | + * $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/FileUtilsTestCase.java,v 1.5 2003/11/22 20:48:10 jeremias Exp $ |
| 3 | + * $Revision: 1.5 $ |
| 4 | + * $Date: 2003/11/22 20:48:10 $ |
5 | 5 | * |
6 | 6 | * ==================================================================== |
7 | 7 | * |
|
75 | 75 | * |
76 | 76 | * @author Peter Donald |
77 | 77 | * @author Matthew Hawthorne |
78 | | - * @version $Id: FileUtilsTestCase.java,v 1.4 2003/10/17 20:15:46 matth Exp $ |
| 78 | + * @version $Id: FileUtilsTestCase.java,v 1.5 2003/11/22 20:48:10 jeremias Exp $ |
79 | 79 | * @see FileUtils |
80 | 80 | */ |
81 | 81 | public final class FileUtilsTestCase extends FileBasedTestCase { |
@@ -141,9 +141,9 @@ public void testByteCountToDisplaySize() { |
141 | 141 | // waitFor |
142 | 142 |
|
143 | 143 | public void testWaitFor() { |
144 | | - FileUtils.waitFor("", -1); |
| 144 | + FileUtils.waitFor(new File(""), -1); |
145 | 145 |
|
146 | | - FileUtils.waitFor("", 2); |
| 146 | + FileUtils.waitFor(new File(""), 2); |
147 | 147 | } |
148 | 148 |
|
149 | 149 | // toURL |
@@ -520,20 +520,20 @@ public void testFileUtils() throws Exception { |
520 | 520 | "Second test file does not exist", |
521 | 521 | !FileUtils.fileExists(filename2)); |
522 | 522 |
|
523 | | - FileUtils.fileWrite(filename2, filename); |
| 523 | + FileUtils.writeStringToFile(new File(filename2), filename, "UTF-8"); |
524 | 524 | assertTrue("Second file was written", FileUtils.fileExists(filename2)); |
525 | 525 |
|
526 | | - final String file2contents = FileUtils.fileRead(filename2); |
| 526 | + final String file2contents = FileUtils.readFileToString(new File(filename2), "UTF-8"); |
527 | 527 | assertTrue( |
528 | 528 | "Second file's contents correct", |
529 | | - FileUtils.fileRead(filename2).equals(file2contents)); |
| 529 | + FileUtils.readFileToString(new File(filename2), "UTF-8").equals(file2contents)); |
530 | 530 |
|
531 | 531 | FileUtils.fileDelete(filename2); |
532 | 532 | assertTrue( |
533 | 533 | "Second test file does not exist", |
534 | 534 | !FileUtils.fileExists(filename2)); |
535 | 535 |
|
536 | | - final String contents = FileUtils.fileRead(filename); |
| 536 | + final String contents = FileUtils.readFileToString(new File(filename), "UTF-8"); |
537 | 537 | assertTrue("FileUtils.fileRead()", contents.equals("This is a test")); |
538 | 538 |
|
539 | 539 | } |
|
0 commit comments