Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk003/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/ClassFileLoadHook/classfloadhk003.
29
* VM Testbase keywords: [quick, jpda, jvmti, noras]
30
* VM Testbase readme:
31
* DESCRIPTION
32
* This JVMTI test exercises JVMTI event ClassFileLoadHook().
33
* This test checks if CLASS_FILE_LOAD_HOOK event with expected
34
* bytecode and classloader is received upon loading of tested class.
35
* The tested class is loaded with custom classloader.
36
* The test performs the following checks:
37
* - CLASS_FILE_LOAD_HOOK event callback is invoked and only once
38
* for the tested class upon its loading
39
* - redefined class reference passed to callback for tested class
40
* is NULL
41
* - classloader reference passed to callback for tested class
42
* is not NULL
43
* - classloader reference passed to callback for tested class
44
* is equal to expected classloader
45
* - original bytecode passed to callback for tested class
46
* is equal to expected one
47
* The debuggee class preliminary loads original bytecode of the
48
* tested class as a byte array into static field and agent gets
49
* this bytecode and then compares it with bytecode received with
50
* tested event.
51
* If all checks are successfull the test passes with exit code 95,
52
* otherwise the test fails with exit code 97.
53
* COMMENTS
54
* Modified due to fix of the rfe
55
* 5010823 TEST_RFE: some JVMTI tests use the replaced capability
56
*
57
* @library /vmTestbase
58
* /test/lib
59
* @build nsk.jvmti.ClassFileLoadHook.classfloadhk003
60
*
61
* @comment compile loadclassXX to bin/loadclassXX
62
* @run driver nsk.share.ExtraClassesBuilder
63
* loadclass
64
*
65
* @run main/othervm/native
66
* -agentlib:classfloadhk003=-waittime=5
67
* nsk.jvmti.ClassFileLoadHook.classfloadhk003
68
* ./bin
69
*/
70
71
72