< prev index next >

test/hotspot/jtreg/serviceability/jvmti/events/MonitorWaited/monitorwaited01/monitorwaited01.java

Print this page

 23 
 24 import jdk.test.lib.jvmti.DebugeeClass;
 25 
 26 /*
 27  * @test
 28  *
 29  * @summary converted from VM Testbase nsk/jvmti/MonitorWaited/monitorwaited001.
 30  * VM Testbase keywords: [quick, jpda, jvmti, noras]
 31  * VM Testbase readme:
 32  * DESCRIPTION
 33  *     The test exercises JVMTI event callback function
 34  *         MonitorWaited(jni, thread, object, timed_out).
 35  *     The test checks if the thread, object, and timed_out parameters of
 36  *     the function contain expected values for callback when a thread finishes
 37  *     waiting on an object.
 38  * COMMENTS
 39  *     The test updated to match new JVMTI spec 0.2.90:
 40  *     - change signature of agentProc function
 41  *       and save JNIEnv pointer now passed as argument.
 42  *

 43  * @library /test/lib
 44  * @compile monitorwaited01.java
 45  * @run main/othervm/native -agentlib:monitorwaited01 monitorwaited01 platform
 46  * @run main/othervm/native -agentlib:monitorwaited01 monitorwaited01 virtual
 47  */
 48 
 49 
 50 
 51 public class monitorwaited01 extends DebugeeClass {
 52 
 53     static {
 54         loadLibrary("monitorwaited01");
 55     }
 56 
 57     public static void main(String args[]) {
 58         boolean isVirtual = "virtual".equals(args[0]);
 59         int result = new monitorwaited01().runIt(isVirtual);
 60         if (result != 0) {
 61             throw new RuntimeException("Unexpected status: " + result);
 62         }

 23 
 24 import jdk.test.lib.jvmti.DebugeeClass;
 25 
 26 /*
 27  * @test
 28  *
 29  * @summary converted from VM Testbase nsk/jvmti/MonitorWaited/monitorwaited001.
 30  * VM Testbase keywords: [quick, jpda, jvmti, noras]
 31  * VM Testbase readme:
 32  * DESCRIPTION
 33  *     The test exercises JVMTI event callback function
 34  *         MonitorWaited(jni, thread, object, timed_out).
 35  *     The test checks if the thread, object, and timed_out parameters of
 36  *     the function contain expected values for callback when a thread finishes
 37  *     waiting on an object.
 38  * COMMENTS
 39  *     The test updated to match new JVMTI spec 0.2.90:
 40  *     - change signature of agentProc function
 41  *       and save JNIEnv pointer now passed as argument.
 42  *
 43  * @requires vm.continuations
 44  * @library /test/lib
 45  * @compile monitorwaited01.java
 46  * @run main/othervm/native -agentlib:monitorwaited01 monitorwaited01 platform
 47  * @run main/othervm/native -agentlib:monitorwaited01 monitorwaited01 virtual
 48  */
 49 
 50 
 51 
 52 public class monitorwaited01 extends DebugeeClass {
 53 
 54     static {
 55         loadLibrary("monitorwaited01");
 56     }
 57 
 58     public static void main(String args[]) {
 59         boolean isVirtual = "virtual".equals(args[0]);
 60         int result = new monitorwaited01().runIt(isVirtual);
 61         if (result != 0) {
 62             throw new RuntimeException("Unexpected status: " + result);
 63         }
< prev index next >