8160215: jdk/test/java/io/Reader/ReaderBulkReadContract.java should clean up better
authorbpb
Mon, 11 Jul 2016 17:18:59 -0700
changeset 39570 f774415f91ad
parent 39569 ce8a7a71f56b
child 39571 a5744c1725a0
child 39633 9dc7586be5f0
8160215: jdk/test/java/io/Reader/ReaderBulkReadContract.java should clean up better Summary: Create temporary files in the test scratch directory instead of in the default temporary file directory. Reviewed-by: lancea, alanb
jdk/test/java/io/Reader/ReaderBulkReadContract.java
--- a/jdk/test/java/io/Reader/ReaderBulkReadContract.java	Mon Jul 11 14:46:21 2016 -0700
+++ b/jdk/test/java/io/Reader/ReaderBulkReadContract.java	Mon Jul 11 17:18:59 2016 -0700
@@ -148,7 +148,8 @@
 
     private static File createTempFileWithContents(String contents) {
         try {
-            File file = File.createTempFile("ReaderContract", "");
+            File testDir = new File(System.getProperty("test.dir", "."));
+            File file = File.createTempFile("ReaderContract", "", testDir);
             try (FileWriter w = new FileWriter(file)) {
                 w.write(contents);
             }