Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/EventSet/toString/tostring001a.java
41161 views
/*1* Copyright (c) 2002, 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.jdi.EventSet.toString;2324import nsk.share.*;25import nsk.share.jpda.*;26import nsk.share.jdi.*;2728// THIS TEST IS LINE NUMBER SENSITIVE2930/**31* The debugged application of the test.32*/33public class tostring001a {3435//------------------------------------------------------- immutable common fields3637private static int exitStatus;38private static ArgumentHandler argHandler;39private static Log log;40private static IOPipe pipe;4142//------------------------------------------------------- immutable common methods4344static void display(String msg) {45log.display("debuggee > " + msg);46}4748static void complain(String msg) {49log.complain("debuggee FAILURE > " + msg);50}5152public static void receiveSignal(String signal) {53String line = pipe.readln();5455if ( !line.equals(signal) )56throw new Failure("UNEXPECTED debugger's signal " + line);5758display("debuger's <" + signal + "> signal received.");59}6061//------------------------------------------------------ mutable common fields6263//------------------------------------------------------ test specific fields6465public final static String brkpMethodName = "breakHere";66public final static int brkpLineNumber = 91;6768//------------------------------------------------------ mutable common method6970public static void main (String argv[]) {71exitStatus = Consts.TEST_FAILED;72argHandler = new ArgumentHandler(argv);73log = new Log(System.err, argHandler);74pipe = argHandler.createDebugeeIOPipe(log);75try {76pipe.println(tostring001.SIGNAL_READY);77breakHere();78receiveSignal(tostring001.SIGNAL_QUIT);79display("completed succesfully.");80System.exit(Consts.TEST_PASSED + Consts.JCK_STATUS_BASE);81} catch (Failure e) {82log.complain(e.getMessage());83System.exit(Consts.TEST_FAILED + Consts.JCK_STATUS_BASE);84}85}8687//--------------------------------------------------------- test specific methods88public static void breakHere () {89receiveSignal(tostring001.SIGNAL_GO);90log.display("breakpoint line"); // brkpLineNumber91}92}9394//--------------------------------------------------------- test specific classes959697