Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/ClassFileLoadHook/classfloadhk003/TestDescription.java
40955 views
/*1* Copyright (c) 2018, 2020, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/222324/*25* @test26*27* @summary converted from VM Testbase nsk/jvmti/ClassFileLoadHook/classfloadhk003.28* VM Testbase keywords: [quick, jpda, jvmti, noras]29* VM Testbase readme:30* DESCRIPTION31* This JVMTI test exercises JVMTI event ClassFileLoadHook().32* This test checks if CLASS_FILE_LOAD_HOOK event with expected33* bytecode and classloader is received upon loading of tested class.34* The tested class is loaded with custom classloader.35* The test performs the following checks:36* - CLASS_FILE_LOAD_HOOK event callback is invoked and only once37* for the tested class upon its loading38* - redefined class reference passed to callback for tested class39* is NULL40* - classloader reference passed to callback for tested class41* is not NULL42* - classloader reference passed to callback for tested class43* is equal to expected classloader44* - original bytecode passed to callback for tested class45* is equal to expected one46* The debuggee class preliminary loads original bytecode of the47* tested class as a byte array into static field and agent gets48* this bytecode and then compares it with bytecode received with49* tested event.50* If all checks are successfull the test passes with exit code 95,51* otherwise the test fails with exit code 97.52* COMMENTS53* Modified due to fix of the rfe54* 5010823 TEST_RFE: some JVMTI tests use the replaced capability55*56* @library /vmTestbase57* /test/lib58* @build nsk.jvmti.ClassFileLoadHook.classfloadhk00359*60* @comment compile loadclassXX to bin/loadclassXX61* @run driver nsk.share.ExtraClassesBuilder62* loadclass63*64* @run main/othervm/native65* -agentlib:classfloadhk003=-waittime=566* nsk.jvmti.ClassFileLoadHook.classfloadhk00367* ./bin68*/69707172