RFR [XS] 8153297 - [TESTBUG] Enhance test/testlibrary/ClassFileInstaller.java to support JAR files
Lois Foltan
lois.foltan at oracle.com
Tue Apr 5 22:37:49 UTC 2016
On 4/5/2016 4:58 PM, Ioi Lam wrote:
> HI Lois,
>
> Thanks for the review. I've talked to Misha about the removal of
> BasicJarBuilder, and he said it's better to do in in a follow on bug,
> which he will own.
>
> So I'll push the change as is and let Misha handle the removal of
> BasicJarBuilder.
Sounds good.
Lois
>
> Thanks
> - Ioi
>
> On 4/5/16 7:08 AM, Lois Foltan wrote:
>> Hi Ioi,
>>
>> This change looks good, thanks by the way since I am working on
>> supporting an updated -Xpatch format and have to write tests to
>> create JAR files as well. I had copied BasicJarBuilder.java from the
>> test/runtime/SharedArchiveFile directory. Can you remove
>> BasicJarBuilder.java as well as part of this change?
>>
>> Thanks,
>> Lois
>>
>> On 4/1/2016 12:45 PM, Ioi Lam wrote:
>>> 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