equal
deleted
inserted
replaced
1 /* |
1 /* |
2 * Copyright (c) 2013, 2016, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2013, 2018, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
32 import java.util.PropertyPermission; |
32 import java.util.PropertyPermission; |
33 import java.util.logging.Level; |
33 import java.util.logging.Level; |
34 import java.util.logging.LogManager; |
34 import java.util.logging.LogManager; |
35 import java.util.logging.Logger; |
35 import java.util.logging.Logger; |
36 import java.util.logging.LoggingPermission; |
36 import java.util.logging.LoggingPermission; |
37 import jdk.internal.misc.JavaAWTAccess; |
37 import jdk.internal.access.JavaAWTAccess; |
38 import jdk.internal.misc.SharedSecrets; |
38 import jdk.internal.access.SharedSecrets; |
39 |
39 |
40 /** |
40 /** |
41 * @test |
41 * @test |
42 * @bug 8030850 |
42 * @bug 8030850 |
43 * @summary Tests that setting .level=FINEST for the root logger in logging |
43 * @summary Tests that setting .level=FINEST for the root logger in logging |
44 * configuration file does work. |
44 * configuration file does work. |
45 * @modules java.base/jdk.internal.misc |
45 * @modules java.base/jdk.internal.access |
46 * java.logging |
46 * java.logging |
47 * @run main/othervm RootLevelInConfigFile |
47 * @run main/othervm RootLevelInConfigFile |
48 * |
48 * |
49 * @author danielfuchs |
49 * @author danielfuchs |
50 */ |
50 */ |
180 public SimplePolicy(String configFile) { |
180 public SimplePolicy(String configFile) { |
181 perms.add(new LoggingPermission("control", null)); |
181 perms.add(new LoggingPermission("control", null)); |
182 perms.add(new PropertyPermission("java.util.logging.config.class","read")); |
182 perms.add(new PropertyPermission("java.util.logging.config.class","read")); |
183 perms.add(new PropertyPermission("java.util.logging.config.file","read")); |
183 perms.add(new PropertyPermission("java.util.logging.config.file","read")); |
184 perms.add(new FilePermission(configFile, "read")); |
184 perms.add(new FilePermission(configFile, "read")); |
185 perms.add(new RuntimePermission("accessClassInPackage.jdk.internal.misc")); |
185 perms.add(new RuntimePermission("accessClassInPackage.jdk.internal.access")); |
186 } |
186 } |
187 |
187 |
188 @Override |
188 @Override |
189 public boolean implies(ProtectionDomain domain, Permission permission) { |
189 public boolean implies(ProtectionDomain domain, Permission permission) { |
190 return perms.implies(permission); |
190 return perms.implies(permission); |