RFR [XS] 8153300 - [TESTBUG] Enhance test/testlibrary/ClassFileInstaller.java to support JAR files
Mikhailo Seledtsov
mikhailo.seledtsov at oracle.com
Tue Apr 5 00:13:32 UTC 2016
Hi Ioi,
I support the idea of incorporating jar file support into test utilities. A number of tests use jars instead of simple class files; this will simplify test development and maintenance.
Overall this change looks good. I have one comment:
ClassFileInstaller.java:75
public static boolean DEBUG = Boolean.getBoolean("ClassFileInstaller.debug");
I believe this should be:
public static boolean DEBUG = Boolean.getBoolean(System.getProperty("ClassFileInstaller.debug", false));
The rest looks good to me.
Thank you,
Misha
>Sorry, the bug ID is 8153300. I have fixed the e-mail subject.
>
>- Ioi
>
>On 4/1/16 9:45 AM, Ioi Lam wrote:
>/Please review a very small fix: />//>/http://cr.openjdk.java.net/~iklam/jdk9/8153300-enhance-classfileinstaller.v01/
<http://cr.openjdk.java.net/%7Eiklam/jdk9/8153300-enhance-classfileinstaller.v01/>
/>//>//>/Bug: [TESTBUG] Enhance test/testlibrary/ClassFileInstaller.java to />/support JAR files />//>/https://bugs.openjdk.java.net/browse/JDK-8153300 />//>/Summary of fix: />//>/Many hotspot tests need to create JAR files. The current method is />/messy: />//>/[1] Because JTREG compiles .class files into various directories, />/we need />/to use ClassFileInstaller to find the .class file and copy it />/into the />/current directory. />/[2] Then, there are various ad-hoc calls to sun.tools.jar.Main to />/create the />/JAR file. This is not desirable because sun.tools.jar is an />/internal />/package and javac gives warnings about it. />//>/I have improved ClassFileInstaller so that JAR files can be easily />/created using JTREG tags: />//>/* @build ClassFileInstaller sun.hotspot.WhiteBox />/* @run main ClassFileInstaller -jar whitebox.jar sun.hotspot.WhiteBox />//>/To handle more complex use cases, new APIs are also added to />/ClassFileInstaller />/for programmatically creating JAR files inside the test source code. />//>/I converted two CDS test cases to use the new functionality. />//>/FYI, I am also working on new tests for a closed issue />/(JDK-8153297) that use />/the new functionality. />//>/Thanks />/- Ioi />//>//>//
More information about the hotspot-dev
mailing list