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

Alexander Kulyakhtin alexander.kulyakhtin at oracle.com
Thu Jun 4 14:23:21 UTC 2015


There are some issues which may make it difficult to implement the grouping of the common test library files into the new packages as JDK-8075327 proposes. 

The changes in the current patch are trivial and made by a script (although they spread over many files). 
They are trivial because the names of the packages are left intact (except fo renaming of jdk.testlibrary to jdk.test.lib in the jdk repo). 

However, if we introduce the new packages per the CR description we will end up with 

import jdk.test.lib.*; 
import jdk.test.lib.vm.*; 
import jdk.test.lib.processtools.*; 
import jdk.test.lib.misc.*; 

where previously was just a single line 

import jdk.test.lib.*; 

The same goes for @build and @run directives where we end up with 

@build jdk.test.lib.* jdk.test.lib.vm.* jdk.test.lib.processtools.* jdk.test.lib.misc.* 

instead of 

@build jdk.test.lib.* 

There are many tests having import jdk.test.lib.* and @build jdk.test.lib.* and similar constructions. 

If we then want to deduce the minimal required dependencies for each and every jdk and hotspot test, then it will not be as trivial task as what we have currently done. It will, probably, require a significant review effort from both jdk and hotspot teams. 
The benefits of that effort are not quite evident for me though I, probably, might be missing something here. 

The current patch does already provide for the merge of the common part of the jdk and hotspot libraries and do eliminate the duplicated files. 

Therefore, I would suggest reviewing the current patch as it is , since the changes are trivial and postpone refactoring to the new packages until some time later, since such refactoring is not trivial and the current patch does provide for the merge. 

Best regards, 

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

Hi Stefan, 

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

Best regards, 

----- 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 


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


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,

More information about the hotspot-dev mailing list