RFR: JDK-8075327: Merge jdk and hotspot test libraries

Alexander Kulyakhtin alexander.kulyakhtin at oracle.com
Wed Jun 3 12:33:22 UTC 2015


Hi Stefan, 

Thank you very much for the review. I'll update the patch accordingly, shortly. 

Best regards, 
Alexander 

----- Original Message ----- 
From: stefan.sarne at oracle.com 
To: alexander.kulyakhtin at oracle.com, jdk9-dev at openjdk.java.net, hotspot-dev at openjdk.java.net 
Cc: yekaterina.kantserova at oracle.com 
Sent: Wednesday, June 3, 2015 12:08:33 PM GMT +03:00 Iraq 
Subject: Re: RFR: JDK-8075327: Merge jdk and hotspot test libraries 



Hi Alexander, 

I think we want to group the utilities into packages directly. 

One reason for grouping is to support discovery, to clarify what belongs together. For example both the OutputAnalyzer and the StreamPumper belong together in a processtools package, while Asserts doesn't. 

Another reason is to simplify imports and reduce the impact of wild card includes, since for example an import of process tools should not have to bother with declaring usage of sun.misc.Unsafe in the modules world, just because Utils happen to be in the same package. 

Here are some examples - also available in the jira case: 

Package jdk.test.lib.processtools is the package for utilities for launching processes and analyzing the output. 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/processtools/OutputAnalyzer.java 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/processtools/OutputBuffer.java 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/processtools/ProcessTools.java 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/processtools/StreamPumper.java 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/processtools/JDKToolFinder.java 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/processtools/JDKToolLauncher.java 

<jdk9 root>/test/lib-test/jdk/test/lib/processtools/OutputAnalyzerTest.java 


Asserts can stay at top level. 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/Asserts.java 
<jdk9 root>/test/lib-test/jdk/test/lib/AssertsTest.java 


For VM specific info, it would have vm package. Note that the whitebox API moves here. 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/vm/InputArguments.java 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/vm/Platform.java 


Ok, so then there are the stuff which just is a bucket of stuff and fluff. 
A later exercise could be to break this class into better named and placed classes, but this is a start: 
<jdk9 root>/test/lib/share/classes/jdk/test/lib/misc/Utils.java 

Thanks, 
Stefan 


Alexander Kulyakhtin skrev den 2015-06-02 13:18: 


Hi,

Could you, please, review the following test-only changes to the 'jdk', 'hotspot' and the common 'test' repository http://cr.openjdk.java.net/~akulyakh/8075327/wr_hs/webrev.01/index.html http://cr.openjdk.java.net/~akulyakh/8075327/wr_jdk/webrev.01/index.html http://cr.openjdk.java.net/~akulyakh/8075327/wr_test/webrev.01/ The changes are to move test library files common to both jdk and hotspot to the upper-level test repository.

The following has been done:
1) Common files (Asserts.java, OutputAnalyzer.java etc) from the jdk and hotspot repositories,  have been merged and moved to the upper-level common test repository, to test/lib/share/classes. 
2) Package jdk.testlibrary in the jdk repository have been renamed to jdk.test.lib to have the same name as in the hotspot repository
2) Upper level test/lib/share/classes library references have been added to the @library statements
3) Some packages previously located at upper level test repo at /test/lib have been moved to /test/lib/share/classes for consistency

Best regards,
Alexander 


More information about the jdk9-dev mailing list