< prev index next >

test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/UpdateConfigurationTest.java

Print this page
rev 47439 : 8189291: Test policy should extend the default system policy
Reviewed-by:

*** 1,7 **** /* ! * Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. --- 1,7 ---- /* ! * Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation.
*** 57,75 **** import java.util.stream.Collectors; import java.util.stream.Stream; /** * @test ! * @bug 8033661 * @summary tests LogManager.updateConfiguration(bin) * @modules java.logging/java.util.logging:open * @run main/othervm UpdateConfigurationTest UNSECURE * @run main/othervm UpdateConfigurationTest SECURE * @author danielfuchs */ public class UpdateConfigurationTest { /** * We will test the handling of abstract logger nodes with file handlers in * two configurations: * UNSECURE: No security manager. * SECURE: With the security manager present - and the required --- 57,77 ---- import java.util.stream.Collectors; import java.util.stream.Stream; /** * @test ! * @bug 8033661 8189291 * @summary tests LogManager.updateConfiguration(bin) * @modules java.logging/java.util.logging:open * @run main/othervm UpdateConfigurationTest UNSECURE * @run main/othervm UpdateConfigurationTest SECURE * @author danielfuchs */ public class UpdateConfigurationTest { + static final Policy DEFAULT_POLICY = Policy.getPolicy(); + /** * We will test the handling of abstract logger nodes with file handlers in * two configurations: * UNSECURE: No security manager. * SECURE: With the security manager present - and the required
*** 592,602 **** } @Override public boolean implies(ProtectionDomain domain, Permission permission) { if (allowAll.get().get()) return allPermissions.implies(permission); ! return permissions.implies(permission); } @Override public PermissionCollection getPermissions(CodeSource codesource) { return new PermissionsBuilder().addAll(allowAll.get().get() --- 594,605 ---- } @Override public boolean implies(ProtectionDomain domain, Permission permission) { if (allowAll.get().get()) return allPermissions.implies(permission); ! return permissions.implies(permission) || ! DEFAULT_POLICY.implies(domain, permission); } @Override public PermissionCollection getPermissions(CodeSource codesource) { return new PermissionsBuilder().addAll(allowAll.get().get()
< prev index next >