JDK 9 RFR of 8160221: jdk/test/java/nio/channels/FileChannel/Transfers.java leaving files behind

Brian Burkhalter brian.burkhalter at oracle.com
Sat Jul 9 00:22:41 UTC 2016


Please review at your convenience.

Issue:	https://bugs.openjdk.java.net/browse/JDK-8160221
Diff:

--- a/test/java/nio/channels/FileChannel/Transfers.java
+++ b/test/java/nio/channels/FileChannel/Transfers.java
@@ -489,12 +489,14 @@
                 debug = verbose = true;
         }
 
-        sourceFile = File.createTempFile("xfer.src.", "");
+        File testDir = new File(System.getProperty("test.dir", "."));
+
+        sourceFile = File.createTempFile("xfer.src.", "", testDir);
         sourceFile.deleteOnExit();
-        targetFile = File.createTempFile("xfer.tgt.", "");
+        targetFile = File.createTempFile("xfer.tgt.", "", testDir);
         targetFile.deleteOnExit();
 
-        File fn = File.createTempFile("xfer.fch.", "");
+        File fn = File.createTempFile("xfer.fch.", "", testDir);
         fn.deleteOnExit();
         FileChannel fc = new RandomAccessFile(fn, "rw").getChannel();


Summary: Create temporary files in the test scratch directory instead of in the default temporary file directory.

Thanks,

Brian
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/nio-dev/attachments/20160708/445a8817/attachment-0001.html>


More information about the nio-dev mailing list