Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch001/TestDescription.java
40955 views
1
/*
2
* Copyright (c) 2018, 2020, 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/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch001.
29
* VM Testbase keywords: [quick, jpda, jvmti, onload_only_logic, noras, no_cds]
30
* VM Testbase readme:
31
* DESCRIPTION
32
* This JVMTI test exercises JVMTI thread function AddToBootstrapClassLoaderSearch().
33
* This test checks that AddToBootstrapClassLoaderSearch() adds segment
34
* to bootstrap class search path in OnLoad phase and bootstrap classloader
35
* will find debuggee class using that segment.
36
* Debuggee class does not have direct superclass to be loaded too.
37
* The following checks are performed by the test:
38
* - AddToBootstrapClassLoaderSearch() returns no errors in OnLoad phase
39
* - debuggee class will be found by bootstrap classloader using added segment
40
* Source of debuggee class 'bootclssearch001' is located in special subdirectory
41
* 'newclass' and thus will be compiled to '$COMMON_CLASSES_LOCATION/newclass'
42
* subdirectory, where it usually can not be found by bootstrap classloader.
43
* The agent adds this subdirectory to the bootstrap class search path
44
* in Agent_OnLoad(), and thus the debuggee class should be found by
45
* bootstrap classloader and executed normally.
46
* If AddToBootstrapClassLoaderSearch() returns error in Agent_OnLoad(),
47
* then agent returns JNI_ERR and VM fails on initialization.
48
* If AddToBootstrapClassLoaderSearch() does not adds segment to bootstrap
49
* class search path, then debuggee class is not found and VM fails on
50
* initialization.
51
* Otherwise, if debuggee class is found, loaded, executed, it returns PASS
52
* and the test passes with exit code 95.
53
* COMMENTS
54
* Made code cleanup: nsk/share/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch_agent
55
* agent is used now.
56
*
57
* @library /vmTestbase
58
* /test/lib
59
* @build nsk.share.Consts
60
*
61
* @comment compile newclassXX to bin/newclassXX
62
* @run driver nsk.share.ExtraClassesBuilder
63
* newclass
64
*
65
* @comment ExecDriver is used b/c main class isn't on source/class path
66
* @run main/othervm/native ExecDriver --java
67
* -agentlib:bootclssearch_agent=-waittime=5,phasetocheck=onload,segment1=./bin/newclass
68
* nsk.jvmti.AddToBootstrapClassLoaderSearch.bootclssearch001
69
*/
70
71
72