Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddCapabilities/addcaps003.java
40948 views
/*1* Copyright (c) 2007, 2018, 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*/22package nsk.jvmti.AddCapabilities;2324import java.io.PrintStream;2526import nsk.share.*;27import nsk.share.jvmti.*;2829public class addcaps003 extends DebugeeClass {3031// load native library if required32static {33System.loadLibrary("addcaps003");34}3536// run test from command line37public static void main(String argv[]) {38argv = nsk.share.jvmti.JVMTITest.commonInit(argv);3940// JCK-compatible exit41System.exit(run(argv, System.out) + Consts.JCK_STATUS_BASE);42}4344// run test from JCK-compatible environment45public static int run(String argv[], PrintStream out) {46return new addcaps003().runIt(argv, out);47}4849/* =================================================================== */5051// scaffold objects52ArgumentHandler argHandler = null;53Log log = null;54long timeout = 0;55int status = Consts.TEST_PASSED;5657// run debuggee58public int runIt(String argv[], PrintStream out) {59argHandler = new ArgumentHandler(argv);60log = new Log(out, argHandler);61timeout = argHandler.getWaitTime() * 60 * 1000; // milliseconds6263// testing sync64log.display("Sync: debugee ready");65status = checkStatus(status);6667return status;68}69}707172