Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch008/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/bootclssearch008.
29
* VM Testbase keywords: [quick, jpda, jvmti, onload_only_logic, noras, vm6, no_cds]
30
* VM Testbase readme:
31
* DESCRIPTION
32
* This JVMTI test exercises JVMTI thread function AddToBootstrapClassLoaderSearch()
33
* in Live phase (actually only in VM_INIT callback).
34
* This test checks that AddToBootstrapClassLoaderSearch() can add two segments
35
* to bootstrap class search path in Live phase, and debuggee class will be
36
* loaded from the first segment even if it is found in the second segment too,
37
* The following checks are performed by the test:
38
* - AddToBootstrapClassLoaderSearch() adds two segments and returns
39
* no errors in Live phase
40
* - also it checks that anything other than an
41
* existing JAR file is an invalid path
42
* - debuggee class located by the first added segment will be loaded
43
* - debuggee class located by the second added segment will NOT be loaded
44
* There are two different implementations of debuggee class 'bootclssearch004'.
45
* Source of "positive" implementation is located in jar file 'bootclssearch004.jar'
46
* which is located in subdirectory 'newclass01/nsk/jvmti/AddToBootstrapClassLoaderSearch/'.
47
* It will be compiled to
48
* '$COMMON_CLASSES_LOCATION/newclass01/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch004.jar',
49
* that will be added first to bootstrap class search path.
50
* This implementation returns PASS.
51
* Source of "negative" implementation is located in jar file 'bootclssearch004.jar'
52
* which is located in subdirectory 'newclass02/nsk/jvmti/AddToBootstrapClassLoaderSearch/'.
53
* It will be compiled to
54
* '$COMMON_CLASSES_LOCATION/newclass02/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch004.jar',
55
* that will be added second to bootstrap class search path.
56
* This implementation returns FAIL.
57
* The agent adds both jars to the bootstrap class search path
58
* in VM_INIT callback, and expects that positive implementation of debuggee class
59
* from the first added segment will be loaded and executed.
60
* If AddToBootstrapClassLoaderSearch() returns error in VM_INIT callback,
61
* then VM fails on initialization.
62
* If negative implementation of debuggee class is loaded and executed,
63
* then it returns FAIL and test fails with exit code 97.
64
* Otherwise, if both segments are successfully added and positive implementation
65
* of debuggee class is loaded and executed, then it returns PASS and test
66
* passes with exit code 95.
67
* COMMENTS
68
* Ported from bootclssearch004.
69
*
70
* @library /vmTestbase
71
* /test/lib
72
* @build nsk.share.Consts
73
*
74
* @comment compile ../bootclssearch004/newclassXX to bin/newclassXX
75
* @run driver nsk.share.ExtraClassesBuilder
76
* ../bootclssearch004/newclass01
77
* ../bootclssearch004/newclass02
78
*
79
* @comment create bootclssearch004.jar in ./bin/newclass01/
80
* @run driver ExecDriver --cmd
81
* ${compile.jdk}/bin/jar
82
* -cf ./bin/newclass01/bootclssearch004.jar
83
* -C ./bin/newclass01/
84
* nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch004.class
85
*
86
* @comment create bootclssearch004.jar in ./bin/newclass02/
87
* @run driver ExecDriver --cmd
88
* ${compile.jdk}/bin/jar
89
* -cf ./bin/newclass02/bootclssearch004.jar
90
* -C ./bin/newclass02/
91
* nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch004.class
92
*
93
* @comment ExecDriver is used b/c main class isn't on source/class path
94
* @run main/othervm/native ExecDriver --java
95
* -agentlib:bootclssearch_agent=-waittime=5,phasetocheck=live,segment1=./bin/newclass01/bootclssearch004.jar,segment2=./bin/newclass02/bootclssearch004.jar
96
* nsk.jvmti.AddToBootstrapClassLoaderSearch.bootclssearch004
97
*/
98
99
100