RFR(S): 8164944: Refactor ProcessTools to get rid of dependency on java.management
igor.ignatyev at oracle.com
Thu Apr 13 01:56:06 UTC 2017
right. executeTestJvmAllArgs prepends the VM options which the current JVM was started with, which is all options from jtreg harness: @run, @module, and the options specified in the command line by -javaoptions and -vmoptions to the passed arguments. executeTestJvm prepends only the options specified in the command line. so if there is no options from @run or @module, there is no difference b/w executeTestJvmAllArgs and executeTestJvm. in other cases, we need to do some extra steps.
> On Apr 12, 2017, at 6:47 PM, David Holmes <david.holmes at oracle.com> wrote:
> Hi Igor,
> Overall this looks good.
> To be clear the old executeTestJvmAllArgs() presumably provides the VM options from @run _and_ @module - right? So if they don't exist in a test we can simply replace the usage of executeTestJvmAllArgs with executeTestJvm - as done in:
> And for other tests we either grab the VM input arguments as a separate step, or else reconstruct them as needed (eg for the module flags in DebugOutputTest).
> On 13/04/2017 5:03 AM, Igor Ignatyev wrote:
>>> 92 lines changed: 36 ins; 36 del; 20 mod;
>> Hi all,
>> could you please review this small fix which removes dependency on java.management module from the testlibrary?
>> jdk.test.lib.process.ProcessTools class has getVmInputArgs method which depend on java.management, this method is used only by j.d.t.process.ProcessTools::executeTestJvmAll and j.t.l.cli.CommandLineOptionTest class.
>> - ProcessTools::executeTestJvmAll is a variation of executeTestJvm which prepends vm flags from jtreg @run.
>> - CommandLineOptionTest is a library class for cli testing, it uses flags from ProcessTools::getVmInputArgs to create a new jvm with all flags
>> the fix removes ProcessTools::executeTestJvmAll method, moves getVmInputArgs to a separate class jdk.test.lib.management.InputArguments. c.c.s.scenario.Executor and j.t.l.cli.CommandLineOptionTest are updated to use getVmInputArgs from that class. c.j.compilerToVM.DebugOutputTest is refactored to pass add-exports and patch module directly. all the affected classes and obviously updated to use executeTestJvm instead of executeTestJvmAll.
>> after this fix many hotspot tests won't depend on java.management, hence that module might be removed from their @modules, this will be done separately by 8178416.
>> jbs: https://bugs.openjdk.java.net/browse/JDK-8164944
>> webrev: http://cr.openjdk.java.net/~iignatyev//8164944/webrev.00/index.html
>> testing: :hotspot_all
>> 8178416: https://bugs.openjdk.java.net/browse/JDK-8178416
>> -- Igor
More information about the hotspot-dev