RFR(XS) 8166155: Create tests for VM module option handling

Dmitry Dmitriev dmitry.dmitriev at oracle.com
Fri Oct 14 12:46:09 UTC 2016


Hi George,

Thank you for moving the test to the separate file.
Few comments:
1) Why you not use createJavaProcessBuilder from 
jdk.test.lib.process.ProcessTools testlibrary class?
2) You can reduce size of the test by introducing common test function:
private static void checkInvalidModuleOption(String VMOptionFile, String 
expectedOutput) {
          ProcessBuilder pb = createJavaProcessBuilder(
              "-XX:VMOptionsFile=" + 
getAbsolutePathFromSource(VMOptionFile));
          output = new OutputAnalyzer(pb.start());
          output.shouldContain(expectedOutput);
          output.shouldHaveExitValue(1);
}

In this case main test function will looks like this:
checkInvalidModuleOption(ADD_MODULES_BAD1, "Usage");
checkInvalidModuleOption(ADD_MODULES_BAD2, "Unrecognized option");
...

Thanks,
Dmitry

On 13.10.2016 14:40, George Triantafillou wrote:
> After offline feedback from Dmitry Dmitriev, here's an updated webrev:
>
> http://cr.openjdk.java.net/~gtriantafill/8166155/webrev.01/ 
> <http://cr.openjdk.java.net/%7Egtriantafill/8166155/webrev.01/>
>
> The test was moved to a separate test for VM module option handling.  
> Thanks.
>
> -George
>
> On 9/15/2016 2:25 PM, George Triantafillou wrote:
>> Please review this change that adds test coverage for the new VM 
>> module option handling implemented in 
>> https://bugs.openjdk.java.net/browse/JDK-8157038.
>>
>> JBS: https://bugs.openjdk.java.net/browse/JDK-8166155
>> webrev: http://cr.openjdk.java.net/~gtriantafill/8166155/webrev/ 
>> <http://cr.openjdk.java.net/%7Egtriantafill/8166155/webrev/>
>>
>> Tested locally on Linux.
>>
>> Thanks.
>>
>> -George
>>
>



More information about the hotspot-runtime-dev mailing list