Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8075327

Merge jdk and hotspot test libraries



    • Type: Enhancement
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9, 10
    • Fix Version/s: 12
    • Component/s: hotspot
    • Subcomponent:


      Currently there are test libraries both in hotspot and in jdk, which provide the same functionality. This approach has the expected drawbacks with code duplication, there are now differences in them and there is a maintenance cost associated with it. To improve this, the hotspot and jdk test libraries should be merged and moved to top-level repository.

      This does not mean that all test libraries shall go into top repo, there can still be repo local and test folder local test libraries. The idea is to give a home for the test libraries that make sense to share.

      The best thing is if this new common location has the same layout as other things, lets use the java.base as an example. There is an addition however - it should also include the test folder for the test library tests.

      Here are some examples of the suggested folder structure, basically making the test library a project of its own.
        <jdk9 root>/test/lib/share/classes/ (package root)
        <jdk9 root>/test/lib/share/conf/
        <jdk9 root>/test/lib/share/native/

        <jdk9 root>/test/lib-test // <test src root, same layout as lib, but without native redirection>

      Package jdk.test.lib is the main package for all test libraries. Few things go at top level, but some will.

      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


          Issue Links

          There are no Sub-Tasks for this issue.



              iignatyev Igor Ignatyev
              iignatyev Igor Ignatyev
              0 Vote for this issue
              18 Start watching this issue