Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddToBootstrapClassLoaderSearch/bootclssearch004/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/bootclssearch004.
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() can add two segments
34
* to bootstrap class search path in OnLoad phase, and debuggee class will be
35
* loaded from the first segment even if it is found in the second segment too,
36
* The following checks are performed by the test:
37
* - AddToBootstrapClassLoaderSearch() adds two segments and returns
38
* no errors in OnLoad phase
39
* - debuggee class located by the first added segment will be loaded
40
* - debuggee class located by the second added segment will NOT be loaded
41
* There are two different implementations of debuggee class 'bootclssearch004'.
42
* Source of "positive" implementation is located in subdirectory 'newclass01'.
43
* It will be compiled to '$COMMON_CLASSES_LOCATION/newclass01', that will be
44
* added first to bootstrap class search path.
45
* This implementation returns PASS.
46
* Source of "negative" implementation is located in subdirectory 'newclass02'.
47
* It will be compiled to '$COMMON_CLASSES_LOCATION/newclass02', that will be
48
* added second to bootstrap class search path.
49
* This implementation returns FAIL.
50
* The agent adds both subdirectories to the bootstrap class search path
51
* in Agent_OnLoad(), and expects that positive implementation of debuggee class
52
* from the first added segment will be loaded and executed.
53
* If AddToBootstrapClassLoaderSearch() returns error in Agent_OnLoad(),
54
* then agent returns JNI_ERR and VM fails on initialization.
55
* If negative implementation of debuggee class is loaded and executed,
56
* then it returns FAIL and test fails with exit code 97.
57
* Otherwise, if both segments are successfully added and positive implementation
58
* of debuggee class is loaded and executed, then it returns PASS and test
59
* 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 newclassXX to bin/newclassXX
69
* @run driver nsk.share.ExtraClassesBuilder
70
* newclass02 newclass01
71
*
72
* @comment ExecDriver is used b/c main class isn't on source/class path
73
* @run main/othervm/native ExecDriver --java
74
* -agentlib:bootclssearch_agent=-waittime=5,phasetocheck=onload,segment1=./bin/newclass01,segment2=./bin/newclass02
75
* nsk.jvmti.AddToBootstrapClassLoaderSearch.bootclssearch004
76
*/
77
78
79