--- old/test/java/lang/SecurityManager/CheckSecurityProvider.java Wed May 27 22:52:21 2015 +++ new/test/java/lang/SecurityManager/CheckSecurityProvider.java Wed May 27 22:52:21 2015 @@ -23,7 +23,7 @@ /* * @test - * @bug 6997010 + * @bug 6997010 7191662 * @summary Consolidate java.security files into one file with modifications */ @@ -36,8 +36,8 @@ /* * The main benefit of this test is to catch merge errors or other types * of issues where one or more of the security providers are accidentally - * removed. This is why the known security providers have to - * be explicitly listed below. + * removed. With the security manager enabled, this test can also catch + * scenarios where the default permission policy needs to be updated. */ public class CheckSecurityProvider { public static void main(String[] args) throws Exception { @@ -44,6 +44,7 @@ String os = System.getProperty("os.name"); + System.setSecurityManager(new SecurityManager()); /* * This array should be updated whenever new security providers * are added to the the java.security file. @@ -53,9 +54,7 @@ List expected = new ArrayList<>(); if (os.equals("SunOS")) { - if (!isOpenJDKOnly()) { - expected.add("com.oracle.security.ucrypto.UcryptoProvider"); - } + expected.add("com.oracle.security.ucrypto.UcryptoProvider"); expected.add("sun.security.pkcs11.SunPKCS11"); } expected.add("sun.security.provider.Sun"); @@ -68,6 +67,7 @@ expected.add("org.jcp.xml.dsig.internal.dom.XMLDSigRI"); expected.add("sun.security.smartcardio.SunPCSC"); expected.add("sun.security.provider.certpath.ldap.JdkLDAP"); + expected.add("com.sun.security.sasl.gsskerb.JdkSASL"); if (os.startsWith("Windows")) { expected.add("sun.security.mscapi.SunMSCAPI"); } @@ -90,10 +90,4 @@ throw new Exception("More expected"); } } - - // Copied from CheckPackageAccess.java in the same directory - private static boolean isOpenJDKOnly() { - String prop = System.getProperty("java.runtime.name"); - return prop != null && prop.startsWith("OpenJDK"); - } }