test/hotspot/jtreg/vmTestbase/nsk/jvmti/GetPotentialCapabilities/getpotcaps001.java
author jlahoda
Wed, 27 Nov 2019 09:00:01 +0100
changeset 59285 7799a51dbe30
parent 50260 46c67f5e27c2
permissions -rw-r--r--
8231826: Implement javac changes for pattern matching for instanceof Reviewed-by: mcimadamore Contributed-by: brian.goetz@oracle.com, gavin.bierman@oracle.com, maurizio.cimadamore@oracle.com, srikanth.adayapalam@oracle.com, vicente.romero@oracle.com, jan.lahoda@oracle.com
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
50260
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     1
/*
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     2
 * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     4
 *
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     7
 * published by the Free Software Foundation.
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     8
 *
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    13
 * accompanied this code).
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    14
 *
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    18
 *
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    21
 * questions.
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    22
 */
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    23
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    24
package nsk.jvmti.GetPotentialCapabilities;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    25
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    26
import java.io.PrintStream;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    27
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    28
import nsk.share.*;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    29
import nsk.share.jvmti.*;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    30
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    31
public class getpotcaps001 extends DebugeeClass {
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    32
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    33
    // load native library if required
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    34
    static {
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    35
        System.loadLibrary("getpotcaps001");
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    36
    }
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    37
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    38
    // run test from command line
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    39
    public static void main(String argv[]) {
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    40
        argv = nsk.share.jvmti.JVMTITest.commonInit(argv);
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    41
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    42
        // JCK-compatible exit
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    43
        System.exit(run(argv, System.out) + Consts.JCK_STATUS_BASE);
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    44
    }
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    45
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    46
    // run test from JCK-compatible environment
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    47
    public static int run(String argv[], PrintStream out) {
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    48
        return new getpotcaps001().runIt(argv, out);
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    49
    }
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    50
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    51
    /* =================================================================== */
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    52
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    53
    // scaffold objects
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    54
    ArgumentHandler argHandler = null;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    55
    Log log = null;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    56
    long timeout = 0;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    57
    int status = Consts.TEST_PASSED;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    58
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    59
    // run debuggee
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    60
    public int runIt(String argv[], PrintStream out) {
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    61
        argHandler = new ArgumentHandler(argv);
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    62
        log = new Log(out, argHandler);
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    63
        timeout = argHandler.getWaitTime() * 60 * 1000; // milliseconds
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    64
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    65
        // testing sync
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    66
        log.display("Sync: debugee ready");
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    67
        status = checkStatus(status);
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    68
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    69
        return status;
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    70
    }
46c67f5e27c2 8199383: [TESTBUG] Open source VM testbase JVMTI tests
iignatyev
parents:
diff changeset
    71
}