Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch004/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/systemclssearch004.
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 Live phase.
34
* This test checks that AddToSystemClassLoaderSearch() can add two segments
35
* to system 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
* - AddToSystemClassLoaderSearch() 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
* Source of "positive" implementation is located in jar file 'systemclssearch003.jar'
45
* which is located in subdirectory 'newclass01/nsk/jvmti/AddToSystemClassLoaderSearch/'.
46
* It will be compiled to
47
* '$COMMON_CLASSES_LOCATION/newclass01/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch003.jar',
48
* that will be added first to system class search path.
49
* This implementation returns PASS.
50
* Source of "negative" implementation is located in jar file 'systemclssearch003.jar'
51
* which is located in subdirectory 'newclass02/nsk/jvmti/AddToSystemClassLoaderSearch/'.
52
* It will be compiled to
53
* '$COMMON_CLASSES_LOCATION/newclass02/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch003.jar',
54
* that will be added second to system class search path.
55
* This implementation returns FAIL.
56
* The agent adds both jars to the system class search path
57
* in VM_INIT callback, and expects that positive implementation of debuggee class
58
* from the first added segment will be loaded and executed.
59
* If AddToSystemClassLoaderSearch() returns error in VM_INIT callback,
60
* then VM fails on initialization.
61
* If negative implementation of debuggee class is loaded and executed,
62
* then it returns FAIL and test fails with exit code 97.
63
* Otherwise, if both segments are successfully added and positive implementation
64
* of debuggee class is loaded and executed, then it returns PASS and test
65
* passes with exit code 95.
66
* COMMENTS
67
* Ported from systemclssearch003.
68
*
69
* @library /vmTestbase
70
* /test/lib
71
* @build nsk.share.jvmti.JVMTITest
72
* nsk.share.Consts
73
*
74
* @comment compile ../systemclssearch003/newclassXX to bin/newclassXX
75
* @run driver nsk.share.ExtraClassesBuilder
76
* ../systemclssearch003/newclass01
77
* ../systemclssearch003/newclass02
78
*
79
* @comment create systemclssearch003.jar in current directory
80
* @run driver ExecDriver --cmd
81
* ${compile.jdk}/bin/jar
82
* -cf ./bin/newclass01/systemclssearch003.jar
83
* -C ./bin/newclass01/
84
* nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch003.class
85
*
86
* @comment create systemclssearch003.jar in current directory
87
* @run driver ExecDriver --cmd
88
* ${compile.jdk}/bin/jar
89
* -cf ./bin/newclass02/systemclssearch003.jar
90
* -C ./bin/newclass02/
91
* nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch003.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:systemclssearch_agent=-waittime=5,phasetocheck=live,segment1=./bin/newclass01/systemclssearch003.jar,segment2=./bin/newclass02/systemclssearch003.jar
96
* nsk.jvmti.AddToSystemClassLoaderSearch.systemclssearch003
97
*/
98
99
100