summaryrefslogtreecommitdiff
path: root/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java')
-rw-r--r--qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java b/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java
index fb367d042c..94e7e20a86 100644
--- a/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java
+++ b/qpid/java/common/src/test/java/org/apache/qpid/util/FileUtilsTest.java
@@ -280,6 +280,30 @@ public class FileUtilsTest extends TestCase
checkFileLists(filesBefore, filesAfter);
}
+ public void testDeleteNonExistentFile()
+ {
+ File test = new File("FileUtilsTest-testDelete-"+System.currentTimeMillis());
+
+ assertTrue("File exists", !test.exists());
+ assertFalse("File is a directory", test.isDirectory());
+
+ assertTrue("Delete Succeeded ", !FileUtils.delete(test, true));
+ }
+
+ public void testDeleteNull()
+ {
+ try
+ {
+ FileUtils.delete(null, true);
+ fail("Delete with null value should throw NPE.");
+ }
+ catch (NullPointerException npe)
+ {
+ // expected path
+ }
+ }
+
+
/**
* Given two lists of File arrays ensure they are the same length and all entries in Before are in After
*