< prev index next >

test/hotspot/jtreg/serviceability/jvmti/HeapMonitor/MyPackage/HeapMonitorStatSimpleTest.java

Print this page
rev 49267 : [mq]: event5
rev 49268 : [mq]: event6

@@ -24,24 +24,25 @@
 package MyPackage;
 
 /**
  * @test
  * @build Frame HeapMonitor
- * @summary Verifies the JVMTI Heap Monitor Statistics
+ * @summary Verifies the JVMTI Heap Monitor events are only sent after enabling.
  * @compile HeapMonitorStatSimpleTest.java
  * @run main/othervm/native -agentlib:HeapMonitor MyPackage.HeapMonitorStatSimpleTest
  */
 
 public class HeapMonitorStatSimpleTest {
   private native static int areSamplingStatisticsZero();
 
   public static void main(String[] args) {
+    HeapMonitor.allocate();
     if (!HeapMonitor.eventStorageIsEmpty()) {
       throw new RuntimeException("Statistics should be null to begin with.");
     }
 
-    HeapMonitor.enableSamplingRate();
+    HeapMonitor.enableSamplingEvents();
     HeapMonitor.allocate();
 
     if (HeapMonitor.eventStorageIsEmpty()) {
       throw new RuntimeException("Statistics should not be null now.");
     }
< prev index next >