< prev index next >

test/jdk/java/lang/System/LoggerFinder/internal/BootstrapLogger/BootstrapLoggerTest.java

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

*** 1,7 **** /* ! * Copyright (c) 2014, 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) 2014, 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.
*** 44,54 **** import jdk.internal.logger.BootstrapLogger; import jdk.internal.logger.LazyLoggers; /* * @test ! * @bug 8140364 * @author danielfuchs * @summary JDK implementation specific unit test for JDK internal artifacts. Tests the behavior of bootstrap loggers (and SimpleConsoleLoggers * too). * @modules java.base/jdk.internal.logger:+open --- 44,54 ---- import jdk.internal.logger.BootstrapLogger; import jdk.internal.logger.LazyLoggers; /* * @test ! * @bug 8140364 8189291 * @author danielfuchs * @summary JDK implementation specific unit test for JDK internal artifacts. Tests the behavior of bootstrap loggers (and SimpleConsoleLoggers * too). * @modules java.base/jdk.internal.logger:+open
*** 58,67 **** --- 58,68 ---- * @run main/othervm BootstrapLoggerTest SECURE * @run main/othervm/timeout=120 BootstrapLoggerTest SECURE_AND_WAIT */ public class BootstrapLoggerTest { + static final Policy DEFAULT_POLICY = Policy.getPolicy(); static final Method isAlive; static final Field logManagerInitialized; static { try { // private reflection hook that allows us to test whether
*** 363,373 **** return perms; } @Override public boolean implies(ProtectionDomain domain, Permission permission) { ! return getPermissions(domain).implies(permission); } @Override public PermissionCollection getPermissions(CodeSource codesource) { return getPermissions(); --- 364,375 ---- return perms; } @Override public boolean implies(ProtectionDomain domain, Permission permission) { ! return getPermissions(domain).implies(permission) || ! DEFAULT_POLICY.implies(domain, permission); } @Override public PermissionCollection getPermissions(CodeSource codesource) { return getPermissions();
< prev index next >