RFR [XS] 8153297 - [TESTBUG] Enhance test/testlibrary/ClassFileInstaller.java to support JAR files
Ioi Lam
ioi.lam at oracle.com
Fri Apr 1 16:45:16 UTC 2016
Please review a very small fix:
http://cr.openjdk.java.net/~iklam/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