Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch003/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/AddToSystemClassLoaderSearch/systemclssearch003.
29
* VM Testbase keywords: [quick, jpda, jvmti, onload_only_logic, noras, vm6]
30
* VM Testbase readme:
31
* DESCRIPTION
32
* This JVMTI test exercises JVMTI thread function AddToSystemClassLoaderSearch()
33
* in OnLoad phase.
34
* This test checks that AddToSystemClassLoaderSearch() can add two segments
35
* to system class search path in OnLoad 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
* - AddToSystemClassLoaderSearch() adds two segments and returns
39
* no errors in OnLoad phase
40
* - debuggee class located by the first added segment will be loaded
41
* - debuggee class located by the second added segment will NOT be loaded
42
* There are two different implementations of debuggee class 'systemclssearch003'.
43
* Source of "positive" implementation is located in subdirectory 'newclass01'.
44
* It will be compiled to '$COMMON_CLASSES_LOCATION/newclass01', that will be
45
* added first to system class search path.
46
* This implementation returns PASS.
47
* Source of "negative" implementation is located in subdirectory 'newclass02'.
48
* It will be compiled to '$COMMON_CLASSES_LOCATION/newclass02', that will be
49
* added second to system class search path.
50
* This implementation returns FAIL.
51
* The agent adds both subdirectories to the system class search path
52
* in Agent_OnLoad(), and expects that positive implementation of debuggee class
53
* from the first added segment will be loaded and executed.
54
* If AddToSystemClassLoaderSearch() returns error in Agent_OnLoad(),
55
* then agent returns JNI_ERR and VM fails on initialization.
56
* If negative implementation of debuggee class is loaded and executed,
57
* then it returns FAIL and test fails with exit code 97.
58
* Otherwise, if both segments are successfully added and positive implementation
59
* of debuggee class is loaded and executed, then it returns PASS and test
60
* passes with exit code 95.
61
* COMMENTS
62
*
63
* @library /vmTestbase
64
* /test/lib
65
* @build nsk.share.jvmti.JVMTITest
66
* 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:systemclssearch_agent=-waittime=5,phasetocheck=onload,segment1=./bin/newclass01,segment2=./bin/newclass02
75
* nsk.jvmti.AddToSystemClassLoaderSearch.systemclssearch003
76
*/
77
78
79