Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch006/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/AddToSystemClassLoaderSearch/systemclssearch006.28* VM Testbase keywords: [quick, jpda, jvmti, onload_only_logic, noras, vm6]29* VM Testbase readme:30* DESCRIPTION31* This JVMTI test exercises JVMTI thread function AddToSystemClassLoaderSearch()32* in Live phase.33* This test checks that AddToSystemClassLoaderSearch() adds segment34* to system class search path and system classloader will find35* debuggee class using that segment while loading debugge supper class36* from original classpath.37* The following checks are performed by the test:38* - AddToSystemClassLoaderSearch() returns no errors in OnLoad phase39* - debuggee class will be loaded from system40* classpath using added segment41* - superclass needed for debuggee class will be found by system42* classloader using original classpath43* Source of debuggee class 'systemclssearch002' is located in 'systemclssearch002.jar'44* which is located in subdirectory 'newclass/nsk/jvmti/AddToSystemClassLoaderSearch/'.45* It will be compiled to46* '$COMMON_CLASSES_LOCATION/newclass/nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch002.jar'47* jar file where it usually cannot be found by system classloader.48* If AddToSystemClassLoaderSearch() does not adds segment to system49* classloader search path, then debuggee class is not found and VM50* fails on initialization.51* If system classloader cannot find superclass located by the original52* system classpath, then VM also fails on initialization.53* If segment is successfully added and debuggee super class are found, loaded, and executed,54* then it returns PASS. and the test passes with exit code 95.55* COMMENTS56* Ported from systemclssearch002.57*58* @library /vmTestbase59* /test/lib60* @build nsk.jvmti.AddToSystemClassLoaderSearch.systemclssearch002p61* nsk.share.jvmti.JVMTITest62*63* @comment compile ../systemclssearch002/newclassXX to bin/newclassXX64* @run driver nsk.share.ExtraClassesBuilder65* ../systemclssearch002/newclass66*67* @comment create systemclssearch002.jar in current directory68* @run driver ExecDriver --cmd69* ${compile.jdk}/bin/jar70* -cf systemclssearch002.jar71* -C ./bin/newclass/72* nsk/jvmti/AddToSystemClassLoaderSearch/systemclssearch002.class73*74* @comment ExecDriver is used b/c main class isn't on source/class path75* @run main/othervm/native ExecDriver --java76* -agentlib:systemclssearch_agent=-waittime=5,phasetocheck=live,segment1=systemclssearch002.jar77* nsk.jvmti.AddToSystemClassLoaderSearch.systemclssearch00278*/79808182