8196768: RootLoggerHandlers fails when source tree is read-only
authormartin
Mon, 05 Feb 2018 20:20:35 -0800
changeset 48770 a0475462616e
parent 48769 266539dc2776
child 48780 eb5572d58bb1
8196768: RootLoggerHandlers fails when source tree is read-only Reviewed-by: dfuchs
test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/BadRootLoggerHandlers.java
test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/RootLoggerHandlers.java
--- a/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/BadRootLoggerHandlers.java	Thu Feb 08 06:19:24 2018 -0800
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/BadRootLoggerHandlers.java	Mon Feb 05 20:20:35 2018 -0800
@@ -132,6 +132,7 @@
         }
 
         Files.copy(initialProps, loggingProps, StandardCopyOption.REPLACE_EXISTING);
+        loggingProps.toFile().setWritable(true);
 
         SystemErr err = new SystemErr(System.err);
         System.setErr(new PrintStream(err));
--- a/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/RootLoggerHandlers.java	Thu Feb 08 06:19:24 2018 -0800
+++ b/test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/RootLoggerHandlers.java	Mon Feb 05 20:20:35 2018 -0800
@@ -63,6 +63,7 @@
         Path loggingProps = USER_DIR.resolve(CONFIG_FILE);
         System.setProperty("java.util.logging.config.file", loggingProps.toString());
         Files.copy(initialProps, loggingProps, StandardCopyOption.REPLACE_EXISTING);
+        loggingProps.toFile().setWritable(true);
         System.out.println("Root level is: " + Logger.getLogger("").getLevel());
         if (Logger.getLogger("").getLevel() != Level.INFO) {
             throw new RuntimeException("Expected root level INFO, got: "