Search in sources :

Example 1 with PolicyFile

use of sun.security.provider.PolicyFile in project jdk8u_jdk by JetBrains.

the class Comparator method main.

public static void main(String[] args) throws Exception {
    int testnum = 1;
    // in case we run standalone
    String policyDir = System.getProperty("test.src");
    if (policyDir == null) {
        policyDir = ".";
    }
    // do principal-only tests
    System.setProperty("java.security.policy", "=" + policyDir + File.separatorChar + "Comparator.Principal.Policy");
    PolicyFile policy = new PolicyFile();
    testnum = doPrincipalTest(policy, testnum);
    System.out.println("============ Principal Test Passed ============");
    // do comparator-only tests
    System.setProperty("java.security.policy", "=" + policyDir + File.separatorChar + "Comparator.Comparator.Policy");
    policy = new PolicyFile();
    testnum = doComparatorTest(policy, testnum);
    System.out.println("============ Comparator Test Passed ============");
    // combined principal/comparator tests
    System.setProperty("java.security.policy", "=" + policyDir + File.separatorChar + "Comparator.Combined.Policy");
    policy = new PolicyFile();
    testnum = doCombinedTest(policy, testnum);
    System.out.println("============ Combined Test Passed ============");
}
Also used : PolicyFile(sun.security.provider.PolicyFile)

Aggregations

PolicyFile (sun.security.provider.PolicyFile)1