Path: blob/master/test/hotspot/jtreg/vmTestbase/nsk/jvmti/AttachOnDemand/attach045/TestDescription.java
40951 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/AttachOnDemand/attach045.28* VM Testbase keywords: [jpda, jvmti, noras, feature_282, vm6, jdk]29* VM Testbase readme:30* Description :31* Test tries to load 4 jvmti agents to the VM after the VM has started using32* Attach API (com.sun.tools.attach).33* Test is based on the nsk.share.aod framework. In the terms of this framework34* java application running in the VM where agent is loaded to is called 'target application'.35* This is stress test, 4 jvmti agents are loaded to the VM. Agents execute following actions:36* - agent045Agent00: enables ClassLoad event and from event handler calls GetClassSignature37* for loaded class38* - agent045Agent01: enables ClassPrepare event and from event handler calls GetClassSignature39* for loaded class and also class GetLoadedClasses40* - agent045Agent02: enables ThreadStart and ThreadEnd events, from event handlers calls GetThreadInfo41* for started or ended thread, and also calls GetAllThreads42* - agent045Agent03: enables ThreadStart and ThreadEnd events, from event handlers calls GetThreadInfo43* for started or ended thread, and also calls GetAllThreads44* - agent045Agent04: enables VMObjectAlloc event, from event handler calls GetThreadInfo for thread45* allocating object and calls GetClassSignature for allocated object class. Also after after each 10th event46* agent calls ForceGarbageCollection47* When each agent receives expected number of events agent finishes work (all events received by agents are48* provoked by the target application).49*50* @library /vmTestbase51* /test/lib52* @build nsk.share.aod.AODTestRunner53* nsk.jvmti.AttachOnDemand.attach045.attach045Target54* nsk.jvmti.AttachOnDemand.attach045.ClassToLoad55* @run main/othervm/native56* nsk.share.aod.AODTestRunner57* -jdk ${test.jdk}58* -target "nsk.jvmti.AttachOnDemand.attach045.attach045Target -classPath ${test.class.path}"59* -javaOpts="-XX:+UsePerfData ${test.vm.opts} ${test.java.opts}"60* -na attach045Agent00,attach045Agent01,attach045Agent02,attach045Agent0361*/62636465