提交 2935258e 编写于 作者: H huybrechts

deleting temporary file after test

git-svn-id: https://hudson.dev.java.net/svn/hudson/trunk/hudson/main@16115 71c3de6d-444a-0410-be80-ed276b4c234a
上级 910bcfa5
...@@ -35,6 +35,8 @@ import java.util.concurrent.Executors; ...@@ -35,6 +35,8 @@ import java.util.concurrent.Executors;
import java.util.concurrent.Callable; import java.util.concurrent.Callable;
import java.util.concurrent.Future; import java.util.concurrent.Future;
import org.junit.Assert;
/** /**
* @author Kohsuke Kawaguchi * @author Kohsuke Kawaguchi
*/ */
...@@ -79,7 +81,8 @@ public class FilePathTest extends TestCase { ...@@ -79,7 +81,8 @@ public class FilePathTest extends TestCase {
File tmp = File.createTempFile("testCopyTo",""); File tmp = File.createTempFile("testCopyTo","");
FilePath f = new FilePath(french,tmp.getPath()); FilePath f = new FilePath(french,tmp.getPath());
f.copyTo(new NullStream()); 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 { ...@@ -95,8 +98,8 @@ public class FilePathTest extends TestCase {
f.copyTo(f2); f.copyTo(f2);
tmp.delete(); Assert.assertTrue("could not delete target " + tmp.getPath(), tmp.delete());
tmp2.delete(); Assert.assertTrue("could not delete target " + tmp2.getPath(), tmp2.delete());
} }
} }
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册