Author: pascalschumacher
Date: Fri Aug 11 16:21:10 2017
New Revision: 1804817

URL: http://svn.apache.org/viewvc?rev=1804817&view=rev
Log:
FileLockTestCase: use temporary file

Modified:
    
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java

Modified: 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java
URL: 
http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java?rev=1804817&r1=1804816&r2=1804817&view=diff
==============================================================================
--- 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java
 (original)
+++ 
commons/proper/vfs/trunk/core/src/test/java/org/apache/commons/vfs2/provider/zip/test/FileLockTestCase.java
 Fri Aug 11 16:21:10 2017
@@ -21,7 +21,6 @@ import java.io.File;
 import java.io.IOException;
 import java.io.InputStream;
 
-import org.apache.commons.AbstractVfsTestCase;
 import org.apache.commons.io.FileUtils;
 import org.apache.commons.vfs2.FileObject;
 import org.apache.commons.vfs2.FileSystemException;
@@ -60,13 +59,9 @@ public class FileLockTestCase {
 
     @Before
     public void setup() throws IOException {
-        //
-        // We copy the normal test zip to a second, nominally temporary, file 
so that we can try to delete it with
-        // impunity. Since the test fails, the file will be left behind, so it 
should probably be created in a temporary
-        // directory somewhere.
-        //
         final File zipFile = new File("src/test/resources/test-data/test.zip");
-        newZipFile = new File(AbstractVfsTestCase.getTestDirectory(), 
"test2.zip");
+        newZipFile = File.createTempFile("FileLockTestCase", "zip");
+        newZipFile.deleteOnExit();
         FileUtils.copyFile(zipFile, newZipFile);
         uri = "zip:file:" + newZipFile.getAbsolutePath() + 
"!/read-tests/file1.txt";
         manager = VFS.getManager();


Reply via email to