RFR: 8251999: remove usage of PropertyResolvingWrapper in vmTestbase/nsk/aod

Igor Ignatyev iignatyev at openjdk.java.net
Thu Sep 24 00:41:21 UTC 2020


On Wed, 23 Sep 2020 05:34:23 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> the patch
>> - removes `PropertyResolvingWrapper` from `vmTestbase/nsk/aod` tests
>> - updates `AODRunnerArgParser` to remove surrounding `"` symbols from `javaOpts` option values
>> - updates vmTestbase/nsk/aod test descriptions to have `"` in `javaOpts` values (as opposed of around `-javaOpts=$value`
>>   as it's now)
>> - mechanically reformats/cleans up the tests (whitespaces, imports, etc)
>> 
>> testing:
>> * [x] vmTestbase/nsk/aod on  {macosx,windows,linux}-x64
>> * [x] vmTestbase/nsk/aod on macosx-x64 w/ `VM_OPTIONS`, `JAVA_OPTIONS` being empty and having value
>
> test/hotspot/jtreg/vmTestbase/nsk/aod/VirtualMachineDescriptor/VirtualMachineDescriptor01/VirtualMachineDescriptor01.java
> line 112:
>> 110:
>> 111:             TestUtils.assertEquals(targetVMDesc.hashCode(), targetVMDesc2.hashCode(),
>> 112:                     "VirtualMachineDescriptor.hashCode() returns different values for '" + targetVMDesc + "' and
>> '" + targetVMDesc2 + "'");
> 
> Does `TestUtils.assertEquals` print out actual/expected value as well? If not, dropping `hashCode` printout here loses
> debugging data.

it does for both a reference type and `int`, [TestUtils.java]:
    public static void assertEquals(int i1, int i2) {
        if (i1 != i2) {
            throw new TestFailure(
                    format("Check failed: %d != %d", i1, i2));
        }
    }

    public static void assertEquals(Object obj1, Object obj2, Object errorMessage) {
        assertTrue(obj1.equals(obj2), new LazyFormatString("%s: [%s] != [%s]", errorMessage,  obj1, obj2));
    }
[TestUtils.java]:
https://github.com/openjdk/jdk/blob/master/test/hotspot/jtreg/vmTestbase/nsk/share/test/TestUtils.java#L70

-------------

PR: https://git.openjdk.java.net/jdk/pull/311


More information about the serviceability-dev mailing list