Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk002/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/classfloadhk002.
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 is received upon loading of tested class.
35
* The tested class is loaded with default 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
* - original bytecode passed to callback for tested class
42
* is equal to expected one
43
* The debuggee class preliminary loads bytecode of the tested class
44
* as a byte array into static field and agent gets this bytecode
45
* and then compares it with bytecode received with tested event.
46
* If all checks are successfull the test passes with exit code 95,
47
* otherwise the test fails with exit code 97.
48
* COMMENTS
49
* Modified due to fix of the rfe
50
* 5010823 TEST_RFE: some JVMTI tests use the replaced capability
51
*
52
* @library /vmTestbase
53
* /test/lib
54
* @build nsk.jvmti.ClassFileLoadHook.classfloadhk002r
55
* @run main/othervm/native
56
* -agentlib:classfloadhk002=-waittime=5
57
* nsk.jvmti.ClassFileLoadHook.classfloadhk002
58
* ./bin
59
*/
60
61
62