< prev index next >
test/jdk/java/util/logging/LogManager/Configuration/updateConfiguration/SimpleUpdateConfigWithInputStreamTest.java
Print this page
rev 47439 : 8189291: Test policy should extend the default system policy
Reviewed-by:
@@ -1,7 +1,7 @@
/*
- * Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
+ * 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.
@@ -48,17 +48,18 @@
import java.util.logging.Logger;
import java.util.logging.LoggingPermission;
/**
* @test
- * @bug 8033661
+ * @bug 8033661 8189291
* @summary tests LogManager.updateConfiguration(InputStream, Function) method
* @run main/othervm SimpleUpdateConfigWithInputStreamTest UNSECURE
* @run main/othervm SimpleUpdateConfigWithInputStreamTest SECURE
* @author danielfuchs
*/
public class SimpleUpdateConfigWithInputStreamTest {
+ static final Policy DEFAULT_POLICY = Policy.getPolicy();
/**
* We will test updateConfiguration in
* two configurations:
* UNSECURE: No security manager.
@@ -653,11 +654,12 @@
}
@Override
public boolean implies(ProtectionDomain domain, Permission permission) {
- return getPermissions(domain).implies(permission);
+ return getPermissions(domain).implies(permission) ||
+ DEFAULT_POLICY.implies(domain, permission);
}
public PermissionCollection permissions() {
PermissionsBuilder builder = new PermissionsBuilder();
if (allowAll.get().get()) {
< prev index next >