Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jdi/BScenarios/hotswap/tc04x002/TestDescription.java
41893 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/BScenarios/hotswap/tc04x002.28* VM Testbase keywords: [quick, jpda, jdi, redefine]29* VM Testbase readme:30* DESCRIPTION:31* This test is from the group of so-called Borland's scenarios and32* implements the following test case:33* Suite 3 - Hot Swap34* Test case: TC435* Description: Before point of execution, different method36* Steps: 1.Set breakpoint at line 30 (call to c()37* from b())38* 2.Debug Main39* 3.Insert as first line in a():40* System.err.println("foo");41* 4.Smart Swap42* 5.Set Smart PopFrame to beginging of43* method a()44* 6.Resume45* X. Prints out "foo" and hits breakpoint46* at line 3047* 7.Resume48* X. Print numbers49* The description was drown up according to steps under JBuilder.50* Of course, the test has own line numbers and method/class names and51* works as follow:52* When the test is starting debugee, debugger sets breakpoint at53* the 43th line (method "method_B").54* After the breakpoint is reached, debugger:55* - redefines debugee adding a new line into "method_A",56* - pops frames at beginning of "method_A"57* - sets breakpoint at the 43th line again58* and resumes debugee.59* It is expected the new code will be actual after the redefining and60* it hits breakpoint.61* COMMENTS:62* Test was fixed according to test bug:63* 4778296 TEST_BUG: debuggee VM intemittently hangs after resuming64* - handling VMStartEvent was removed from the debugger part of the test65* - quit on VMDeathEvent was added to the event handling loop66* Test updated to wait for debugee VM exit:67* - standard method Debugee.endDebugee() is used instead of final Debugee.resume()68*69* @library /vmTestbase70* /test/lib71* @build nsk.jdi.BScenarios.hotswap.tc04x00272* nsk.jdi.BScenarios.hotswap.tc04x002a73*74* @comment compile newclassXX to bin/newclassXX75* with full debug info76* @run driver nsk.share.ExtraClassesBuilder77* -g:lines,source,vars78* newclass79*80* @run main/othervm81* nsk.jdi.BScenarios.hotswap.tc04x00282* ./bin83* -verbose84* -arch=${os.family}-${os.simpleArch}85* -waittime=586* -debugee.vmkind=java87* -transport.address=dynamic88* -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"89*/90919293