/*
* Iterate over ProtectionDomains and and check implies().
*/
for (int i = 0; i < protectionDomains.length; i++) {
ProtectionDomain pd = protectionDomains[i];
/*
* Call implies() on PolicyFileProvider passing
* permissions that granted in the policy file. Verify that
* implies() returns false if ProtectionDomain is equal to null,
* and verify that implies() returns true for non-null
* ProtectionDomains.
*/
checkImplies(pd, pma[IGRANTED], true, true);
/*
* Call implies() on PolicyFileProvider passing
* not granted permissions. Verify that implies()
* returns false for null and non-null
* ProtectionDomains.
*/
checkImplies(pd, pma[INOTGRANTED], false, false);
/*
* For non-null ProtectionDomains that have
* PreferredClassLoader as ClassLoader
* call implies() on PolicyFileProvider passing
* permissions that granted to
* qa1-policy-provider.jar's codebase.
* Verify that implies() returns true.
*/
if (pd == null) {
continue;
}
if (pd.getClassLoader() instanceof PreferredClassLoader) {
checkImplies(pd, pma[ICODEBASEGRANTED], true, false);
}
if (pma[ICODEBASENOTGRANTED] == null) {
continue;
}
/*
* For non-null ProtectionDomains that have
* PreferredClassLoader as ClassLoader
* call implies() on PolicyFileProvider passing
* permissions that are not granted to
* qa1-policy-provider.jar's codebase.
* Verify that implies() returns false.
*/
if (pd.getClassLoader() instanceof PreferredClassLoader) {
checkImplies(pd, pma[ICODEBASENOTGRANTED], false, false);
}
}
}