50018
|
1 |
/*
|
|
2 |
* Copyright (c) 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/jdi/ThreadReference/stop/stop001.
|
|
29 |
* VM Testbase keywords: [quick, jpda, jdi, quarantine]
|
51298
|
30 |
* VM Testbase comments: 7034630
|
50018
|
31 |
* VM Testbase readme:
|
|
32 |
* DESCRIPTION:
|
|
33 |
* The test for the implementation of an object of the type
|
|
34 |
* ThreadReference.
|
|
35 |
* The test checks up that a result of the method
|
|
36 |
* com.sun.jdi.ThreadReference.stop()
|
|
37 |
* complies with its spec:
|
|
38 |
* public void stop(ObjectReference throwable)
|
|
39 |
* throws InvalidTypeException
|
|
40 |
* Stops this thread with an asynchronous exception.
|
|
41 |
* A debugger thread in the target VM will stop this thread with the
|
|
42 |
* given Throwable object.
|
|
43 |
* Parameters: throwable - the asynchronous exception to throw.
|
|
44 |
* Throws: InvalidTypeException -
|
|
45 |
* if throwable is not an instance of java.lang.Throwable in
|
|
46 |
* the target VM.
|
|
47 |
* ObjectCollectedException -
|
|
48 |
* if this object or the asynchronous exception has been garbage collected.
|
|
49 |
* See Also: java.lang.Thread#stop(Throwable)
|
|
50 |
* when a ThreadReference object has not been garbage collected,
|
|
51 |
* hence ObjectCollectedException is not expected to be thrown.
|
|
52 |
* The test works as follows:
|
|
53 |
* The debugger program - nsk.jdi.ThreadReference.stop.stop001;
|
|
54 |
* the debuggee program - nsk.jdi.ThreadReference.stop.stop001a.
|
|
55 |
* Using nsk.jdi.share classes,
|
|
56 |
* the debugger gets the debuggee running on another JavaVM,
|
|
57 |
* creates the object debuggee.VM,
|
|
58 |
* establishes a pipe with the debuggee program, and then
|
|
59 |
* send to the programm commands, to which the debuggee replies
|
|
60 |
* via the pipe. Upon getting reply,
|
|
61 |
* the debugger calls corresponding debuggee.VM methods to get
|
|
62 |
* needed data and compares the data got to the data expected.
|
|
63 |
* In case of error the test produces the return value 97 and
|
|
64 |
* a corresponding error message(s).
|
|
65 |
* Otherwise, the test is passed and produces
|
|
66 |
* the return value 95 and no message.
|
|
67 |
* COMMENTS:
|
|
68 |
* The test ws modified to fixe the bug:
|
|
69 |
* 4637894 TEST_BUG: stop001a does not check object against null
|
|
70 |
*
|
|
71 |
* @library /vmTestbase
|
|
72 |
* /test/lib
|
|
73 |
* @run driver jdk.test.lib.FileInstaller . .
|
|
74 |
* @build nsk.jdi.ThreadReference.stop.stop001
|
|
75 |
* nsk.jdi.ThreadReference.stop.stop001a
|
|
76 |
* @run main/othervm PropertyResolvingWrapper
|
|
77 |
* nsk.jdi.ThreadReference.stop.stop001
|
|
78 |
* -verbose
|
|
79 |
* -arch=${os.family}-${os.simpleArch}
|
|
80 |
* -waittime=5
|
|
81 |
* -debugee.vmkind=java
|
|
82 |
* -transport.address=dynamic
|
|
83 |
* "-debugee.vmkeys=${test.vm.opts} ${test.java.opts}"
|
|
84 |
*/
|
|
85 |
|