Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/IntegerValue/compareTo/compareto001/TestDescription.java
42781 views
/*1* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/222324/*25* @test26*27* @summary converted from VM Testbase nsk/jdi/IntegerValue/compareTo/compareto001.28* VM Testbase keywords: [quick, jpda, jdi]29* VM Testbase readme:30* DESCRIPTION:31* The test for the compareTo(Object o) method of com.sun.jdi.IntegerValue32* interface. This method is inherited from java.lang.Comparable interface.33* The test checks the following assertions which imply from spec for34* Comparable.compareTo(Object o):35* - (x.compareTo(y) == 0) is identical to (x.equals(y) == true);36* - (x.compareTo(y) == 0) is identical to (y.compareTo(x) == 0);37* - if (x.compareTo(y) == i) then (y.compareTo(x) == -i);38* - if (x.compareTo(y) > 0) and (y.compareTo(z) > 0), then (x.compareTo(z) > 0);39* - if an argument is null, then NullPointerException is thrown;40* - if an argument is not of IntegerValue type, then a ClassCastException is thrown.41* where 'x', 'y' and 'z' denote IntegerValue object.42* The debugger program - nsk.jdi.IntegerValue.compareto.compareto001;43* the debuggee program - nsk.jdi.IntegerValue.compareto.compareto001a;44* The test works as follows:45* Using nsk.jdi.share classes, the debugger connects to the debuggee.46* Then the debugger gets a list of integer fields of debuggee's object of47* compareto001aClassToCheck type. For every field a mirror of IntegerValue type48* is created and the assertions are checked. A various values for comparison49* are got from values of mirrors of debuggee's static fields.50* In case of error the test produces the return value 97 and a corresponding51* error message(s). Otherwise, the test is passed and produces the return52* value 95 and no message.53* COMMENTS:54*55* @library /vmTestbase56* /test/lib57* @build nsk.jdi.IntegerValue.compareTo.compareto00158* nsk.jdi.IntegerValue.compareTo.compareto001a59* @run main/othervm60* nsk.jdi.IntegerValue.compareTo.compareto00161* -verbose62* -arch=${os.family}-${os.simpleArch}63* -waittime=564* -debugee.vmkind=java65* -transport.address=dynamic66* -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"67*/68697071