Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdb/classpath/classpath001/classpath001.java
40951 views
/*1* Copyright (c) 2002, 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/jdb/classpath/classpath001.28* VM Testbase keywords: [jpda, jdb]29* VM Testbase readme:30* DECSRIPTION31* An "is it alive & breathing" test for the 'classpath' command.32* The test passes if reply on 'classpath' command is not empty.33* COMMENTS34*35* @library /vmTestbase36* /test/lib37* @build nsk.jdb.classpath.classpath001.classpath001a38* @run main/othervm39* nsk.jdb.classpath.classpath001.classpath00140* -arch=${os.family}-${os.simpleArch}41* -waittime=542* -debugee.vmkind=java43* -transport.address=dynamic44* -jdb=${test.jdk}/bin/jdb45* -java.options="${test.vm.opts} ${test.java.opts}"46* -workdir=.47* -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"48*/4950package nsk.jdb.classpath.classpath001;5152import nsk.share.*;53import nsk.share.jdb.*;5455import java.io.*;56import java.util.*;5758public class classpath001 extends JdbTest {5960public static void main (String argv[]) {61System.exit(run(argv, System.out) + JCK_STATUS_BASE);62}6364public static int run(String argv[], PrintStream out) {65debuggeeClass = DEBUGGEE_CLASS;66firstBreak = FIRST_BREAK;67lastBreak = LAST_BREAK;68return new classpath001().runTest(argv, out);69}7071static final String PACKAGE_NAME = "nsk.jdb.classpath.classpath001";72static final String TEST_CLASS = PACKAGE_NAME + ".classpath001";73static final String DEBUGGEE_CLASS = TEST_CLASS + "a";74static final String FIRST_BREAK = DEBUGGEE_CLASS + ".main";75static final String LAST_BREAK = DEBUGGEE_CLASS + ".lastBreak";7677protected void runCases() {78String[] reply;79Paragrep grep;80int count;81Vector v;82String found;8384reply = jdb.receiveReplyFor(JdbCommand.classpath);8586grep = new Paragrep(reply);87found = grep.findFirst("lasspath");88if (found.length() == 0) {89log.complain("Failed to report classpath");90success = false;91}9293jdb.contToExit(1);94}95}969798