From d88ca1b36ba61b24b3a6980583593c9f3997c0f9 Mon Sep 17 00:00:00 2001 From: Martin Ritchie Date: Mon, 9 Mar 2009 09:40:13 +0000 Subject: FileUtils would report a failure to delete a non-existent file git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@751636 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/test/java/org/apache/qpid/util/FileUtilsTest.java | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'qpid/java/common/src/test') 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..76d39200c1 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,16 @@ 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("Unable to delete",FileUtils.delete(test,true)); + } + /** * Given two lists of File arrays ensure they are the same length and all entries in Before are in After * -- cgit v1.2.1