From 2935258e9132be549cafdceada791716d14a86d9 Mon Sep 17 00:00:00 2001 From: huybrechts Date: Sun, 8 Mar 2009 21:43:52 +0000 Subject: [PATCH] deleting temporary file after test git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16115 71c3de6d-444a-0410-be80-ed276b4c234a --- core/src/test/java/hudson/FilePathTest.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/core/src/test/java/hudson/FilePathTest.java b/core/src/test/java/hudson/FilePathTest.java index 87f7f02a23..b3fe47b875 100644 --- a/core/src/test/java/hudson/FilePathTest.java +++ b/core/src/test/java/hudson/FilePathTest.java @@ -35,6 +35,8 @@ import java.util.concurrent.Executors; import java.util.concurrent.Callable; import java.util.concurrent.Future; +import org.junit.Assert; + /** * @author Kohsuke Kawaguchi */ @@ -79,7 +81,8 @@ public class FilePathTest extends TestCase { File tmp = File.createTempFile("testCopyTo",""); FilePath f = new FilePath(french,tmp.getPath()); f.copyTo(new NullStream()); - tmp.delete(); + Assert.assertTrue("target does not exist", tmp.exists()); + Assert.assertTrue("could not delete target " + tmp.getPath(), tmp.delete()); } /** @@ -95,8 +98,8 @@ public class FilePathTest extends TestCase { f.copyTo(f2); - tmp.delete(); - tmp2.delete(); + Assert.assertTrue("could not delete target " + tmp.getPath(), tmp.delete()); + Assert.assertTrue("could not delete target " + tmp2.getPath(), tmp2.delete()); } } } -- GitLab