Skip to content

Commit c594f49

Browse files
committed
Fix test for contentEquals which throws an exception upon comparing directories now.
git-svn-id: https://svn.apache.org/repos/asf/jakarta/commons/proper/io/trunk@140410 13f79535-47bb-0310-9956-ffa450edef68
1 parent b53bc0e commit c594f49

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

src/test/org/apache/commons/io/FileUtilsTestCase.java

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/FileUtilsTestCase.java,v 1.6 2003/11/22 20:50:01 jeremias Exp $
3-
* $Revision: 1.6 $
4-
* $Date: 2003/11/22 20:50:01 $
2+
* $Header: /home/jerenkrantz/tmp/commons/commons-convert/cvs/home/cvs/jakarta-commons//io/src/test/org/apache/commons/io/FileUtilsTestCase.java,v 1.7 2003/11/22 21:06:41 jeremias Exp $
3+
* $Revision: 1.7 $
4+
* $Date: 2003/11/22 21:06:41 $
55
*
66
* ====================================================================
77
*
@@ -75,7 +75,7 @@
7575
*
7676
* @author Peter Donald
7777
* @author Matthew Hawthorne
78-
* @version $Id: FileUtilsTestCase.java,v 1.6 2003/11/22 20:50:01 jeremias Exp $
78+
* @version $Id: FileUtilsTestCase.java,v 1.7 2003/11/22 21:06:41 jeremias Exp $
7979
* @see FileUtils
8080
*/
8181
public final class FileUtilsTestCase extends FileBasedTestCase {
@@ -174,10 +174,13 @@ public void testContentEquals() throws Exception {
174174
final File file = new File(getTestDirectory(), getName());
175175
assertTrue(FileUtils.contentEquals(file, file));
176176

177-
// TODO Should comparing 2 directories throw an Exception instead of returning false?
178177
// Directories
179-
assertTrue(
180-
!FileUtils.contentEquals(getTestDirectory(), getTestDirectory()));
178+
try {
179+
FileUtils.contentEquals(getTestDirectory(), getTestDirectory());
180+
fail("Comparing directories should fail with an IOException");
181+
} catch (IOException ioe) {
182+
//expected
183+
}
181184

182185
// Different files
183186
final File objFile1 =

0 commit comments

Comments
 (0)