RFR: JDK-8295087: Manual Test to Automated Test Conversion

Bill Huang bhuang at openjdk.org
Fri Oct 14 15:55:43 UTC 2022


On Fri, 14 Oct 2022 11:00:44 GMT, Mahendra Chhipa <mchhipa at openjdk.org> wrote:

>> This task converts 5 manual tests to automated tests.
>> 
>> sun/security/provider/PolicyParser/ExtDirsDefaultPolicy.java 
>> sun/security/provider/PolicyParser/ExtDirsChange.java 
>> sun/security/provider/PolicyParser/ExtDirs.java 
>> java/security/Policy/Root/Root.javajava/security/Policy/Root/Root.java 
>> javax/crypto/CryptoPermissions/InconsistentEntries.java
>
> test/jdk/java/security/Policy/Root/Root.java line 48:
> 
>> 46:     private static final Path TARGET = Paths.get(ROOT, ".java.policy");
>> 47:     public static void main(String[] args) throws Exception {
>> 48:         Files.copy(SOURCE, TARGET, StandardCopyOption.REPLACE_EXISTING);
> 
> Could you please use the testng framework for initial setup of test.

This is a @driver test that copies the Root.policy file to the home directory before running the RootTest in a new JVM. The reason is that upon the start of the new JVM it loads the default system-wide policy file and the default user policy file which is the Root.policy we just copied. With the testng framework, there is no way to load the custom user policy file without reinstalling the security manager in the test, that said, it doesn't match what the manual test does.

> test/jdk/javax/crypto/CryptoPermissions/InconsistentEntries.java line 31:
> 
>> 29:  * @summary Test limited/default_local.policy containing inconsistent entries
>> 30:  * @library /test/lib
>> 31:  * @run driver InconsistentEntries
> 
> Use the testng framework.

Same reason as Root.java. The custom policy file needs to place in Java home directory before running the test.

-------------

PR: https://git.openjdk.org/jdk/pull/10637


More information about the core-libs-dev mailing list