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

Merge jdk and hotspot test libraries

XMLWordPrintable

      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

        1.
        Merge common classes from jdk and hotspot test libraries Sub-task Closed Alexander Kulyakhtin (Inactive)  
        2.
        Move hotspot testlibraries to the top-level test repository Sub-task Closed Alexander Kulyakhtin (Inactive)  
        3.
        Merge leftovers files from the jdk and hotpot test libraries Sub-task Closed Alexander Kulyakhtin (Inactive)  
        4.
        Split common test library into packages Sub-task Closed Alexander Kulyakhtin (Inactive)  
        5.
        remove jaxp testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        6.
        move SerializationUtils to top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        7.
        move FilterClassLoader and ParentLastURLClassLoader to top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        8.
        remove jdk.testlibrary.IOUtils Sub-task Resolved Igor Ignatyev (Inactive)  
        9.
        move jdk.testlibrary.LockFreeLogManager to the top level test library Sub-task Resolved Igor Ignatyev (Inactive)  
        10.
        remove jdk.testlibrary.management.InputArguments Sub-task Resolved Igor Ignatyev (Inactive)  
        11.
        move jdk.testlibrary.NetworkConfiguration to the top level test library Sub-task Resolved Igor Ignatyev (Inactive)  
        12.
        move ModuleInfoMaker to the top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        13.
        move jdk.test.lib.wrappers.* to jdk.test.lib package Sub-task Resolved Igor Ignatyev (Inactive)  
        14.
        remove jdk.testlibrary.TimeLimitedRunner Sub-task Resolved Igor Ignatyev (Inactive)  
        15.
        move jdk.testlibrary.management.ThreadMXBeanTool to top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        16.
        move RandomFactory to the top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        17.
        move FileUtils to top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        18.
        move jdk.testlibrary.JarUtils to the top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        19.
        move c.o.testlibrary.jsr292 classes to jdk/test/java/lang/invoke directory Sub-task Resolved Igor Ignatyev (Inactive)  
        20.
        remove JavaToolUtils testlibrary class Sub-task Resolved Igor Ignatyev (Inactive)  
        21.
        update java/time tests to use RandomFactory from the top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        22.
        remove packageless CompilerUtils Sub-task Resolved Igor Ignatyev (Inactive)  
        23.
        remove jdk.testlibrary.JDKToolFinder and JDKToolLauncher Sub-task Resolved Igor Ignatyev (Inactive)  
        24.
        merge jdk.testlibrary.Platform and jdk.test.lib.Platform Sub-task Resolved Igor Ignatyev (Inactive)  
        25.
        remove jdk.testlibrary.Utils::tryFindJvmPid and waitForJvmPid methods Sub-task Resolved Igor Ignatyev (Inactive)  
        26.
        move jdk.testlibrary.JcmdBase closer to tests Sub-task Resolved Igor Ignatyev (Inactive)  
        27.
        remove ClassFileInstaller from jdk/test/lib/testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        28.
        remove jdk.testlibrary.ProcessThread, TestThread and XRun Sub-task Resolved Igor Ignatyev (Inactive)  
        29.
        move OSInfo to top level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  
        30.
        remove jdk.testlibrary.ProcessTools Sub-task Resolved Igor Ignatyev (Inactive)  
        31.
        remove jdk.testlibrary.Utils Sub-task Resolved Igor Ignatyev (Inactive)  
        32.
        remove jdk/testlibrary/Asserts Sub-task Resolved Igor Ignatyev (Inactive)  
        33.
        move JarUtils to top-level testlibrary Sub-task Resolved Igor Ignatyev (Inactive)  

            iignatyev Igor Ignatyev (Inactive)
            iignatyev Igor Ignatyev (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            18 Start watching this issue

              Created:
              Updated:
              Resolved: