Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch003/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/bootclssearch003.
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, but debuggee class
35
* located by this segment will no be loaded if this class is available
36
* from the original bootstrap classpath.
37
* The following checks are performed by the test:
38
* - AddToBootstrapClassLoaderSearch() returns no errors in OnLoad phase
39
* - debuggee class located by the original bootstrap classpath will be loaded
40
* - debuggee class located by the added segment will NOT be loaded
41
* There are two different impelmentations of debuggee class 'bootclssearch003'.
42
* Source of "positive" implementation is located in subdirectory 'loadclass'.
43
* It will be compiled to '$COMMON_CLASSES_LOCATION/loadclass' and added to
44
* original bootstrap classpath using option +Xbootclasspath/a.
45
* This implementation returns PASS status.
46
* Source of "negative" implementation is located in subdirectory 'newclass'.
47
* It will be compiled to '$COMMON_CLASSES_LOCATION/newclass' and added
48
* to bootstrap class search path with AddToBootstrapClassLoaderSearch().
49
* This implementation returns prints error and returns FAIL status.
50
* The agent adds subdirectory '$COMMON_CLASSES_LOCATION/newclass' to
51
* the bootstrap classloader search path in Agent_OnLoad(), and expects
52
* that positive implementation of debuggee class will be loaded and
53
* executed.
54
* If AddToBootstrapClassLoaderSearch() returns error in Agent_OnLoad(),
55
* then agent returns JNI_ERR and VM fails on initialization.
56
* If negative version of debuggee class will be loaded and executed,
57
* then it returns FAIL and test fails with exit code 97.
58
* Otherwise, if positive version of debuggee class will be loaded and executed,
59
* then it returns PASS and test passes with exit code 95.
60
* COMMENTS
61
* Made code cleanup: nsk/share/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch_agent
62
* agent is used now.
63
*
64
* @library /vmTestbase
65
* /test/lib
66
* @build nsk.share.Consts
67
*
68
* @comment compile loadclassXX to bin/loadclassXX
69
* @run driver nsk.share.ExtraClassesBuilder
70
* loadclass
71
*
72
* @comment compile newclassXX to bin/newclassXX
73
* @run driver nsk.share.ExtraClassesBuilder
74
* newclass
75
*
76
* @comment ExecDriver is used b/c main class isn't on source/class path
77
* @run main/othervm/native ExecDriver --java
78
* -Xbootclasspath/a:./bin/loadclass
79
* -agentlib:bootclssearch_agent=-waittime=5,phasetocheck=onload,segment1=./bin/newclass
80
* nsk.jvmti.AddToBootstrapClassLoaderSearch.bootclssearch003
81
*/
82
83
84