1 /*
2  * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * This code is free software; you can redistribute it and/or modify it
6  * under the terms of the GNU General Public License version 2 only, as
7  * published by the Free Software Foundation.
8  *
9  * This code is distributed in the hope that it will be useful, but WITHOUT
10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
12  * version 2 for more details (a copy is included in the LICENSE file that
13  * accompanied this code).
14  *
15  * You should have received a copy of the GNU General Public License version
16  * 2 along with this work; if not, write to the Free Software Foundation,
17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18  *
19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20  * or visit www.oracle.com if you need additional information or have any
21  * questions.
22  */
23 
24 
25 /*
26  * @test
27  *
28  * @summary converted from VM Testbase nsk/jdwp/Event/SINGLE_STEP/singlestep001.
29  * VM Testbase keywords: [quick, jpda, jdwp]
30  * VM Testbase readme:
31  * DESCRIPTION
32  *     This test performs checking for
33  *         command set: Event
34  *         command: Composite
35  *         command set: EventRequest
36  *         command: Set, Clear
37  *         event kind: SINGLE_STEP
38  *     Test checks that
39  *         1) debuggee successfully creates SINGLE_STEP event request
40  *            for particular threadID with attributes:
41  *            depth=OVER, size=LINE
42  *         2) expected SINGLE_STEP event is received when the thread
43  *            in debuggee steps to the next line after breakpoint
44  *         3) debuggee successfully removes event request
45  *     Test consists of two compoments:
46  *         debugger: singlestep001
47  *         debuggee: singlestep001a
48  *     First, debugger uses nsk.share support classes to launch debuggee,
49  *     and obtains Transport object, that represents JDWP transport channel.
50  *     Next, debugger waits for tested class loaded and gets methodID
51  *     and location for expected single step event after breakpoint.
52  *     Then debugger waits for breakpoint reached with some thread
53  *     and makes request for SINGLE_STEP event for this threadID.
54  *     When event is received debugger checks if the received event is for
55  *     expected request, thread, and location and has correct attributes.
56  *     Then debugger removes event request.
57  *     Finally, debugger disconnects debuggee, waits for it exited
58  *     and exits too with proper exit code.
59  * COMMENTS
60  *     Test was fixed due to test bug:
61  *     4797978 TEST_BUG: potential race condition in a number of JDWP tests
62  *
63  * @library /vmTestbase /test/hotspot/jtreg/vmTestbase
64  *          /test/lib
65  * @run driver jdk.test.lib.FileInstaller . .
66  * @build nsk.jdwp.Event.SINGLE_STEP.singlestep001
67  *        nsk.jdwp.Event.SINGLE_STEP.singlestep001a
68  * @run main/othervm PropertyResolvingWrapper
69  *      nsk.jdwp.Event.SINGLE_STEP.singlestep001
70  *      -arch=${os.family}-${os.simpleArch}
71  *      -verbose
72  *      -waittime=5
73  *      -debugee.vmkind=java
74  *      -transport.address=dynamic
75  *      -debugee.vmkeys="${test.vm.opts} ${test.java.opts}"
76  */
77 
78