changeset 49154:a0475462616e

8196768: RootLoggerHandlers fails when source tree is read-only Reviewed-by: dfuchs
author martin
date Mon, 05 Feb 2018 20:20:35 -0800
parents 266539dc2776
children eb5572d58bb1
files test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/BadRootLoggerHandlers.java test/jdk/java/util/logging/LogManager/Configuration/rootLoggerHandlers/RootLoggerHandlers.java
diffstat 2 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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: "