< prev index next >
test/compiler/codecache/jmx/ThresholdNotificationsTest.java
Print this page
rev 11557 : 8132919: use package in compiler tests
Reviewed-by: duke
*** 19,53 ****
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
- import jdk.test.lib.Asserts;
- import jdk.test.lib.Utils;
- import java.lang.management.ManagementFactory;
- import java.lang.management.MemoryNotificationInfo;
- import java.lang.management.MemoryPoolMXBean;
- import javax.management.ListenerNotFoundException;
- import javax.management.Notification;
- import javax.management.NotificationEmitter;
- import javax.management.NotificationListener;
- import sun.hotspot.code.BlobType;
-
/*
* @test ThresholdNotificationsTest
! * @library /testlibrary /test/lib
* @modules java.base/jdk.internal.misc
* java.management
! * @build ThresholdNotificationsTest
! * @run main ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
! * -XX:-MethodFlushing -XX:+UnlockDiagnosticVMOptions -XX:+WhiteBoxAPI
! * -XX:+SegmentedCodeCache -XX:CompileCommand=compileonly,null::*
! * ThresholdNotificationsTest
! * @summary testing of getUsageThreshold()
*/
public class ThresholdNotificationsTest implements NotificationListener {
private final static long WAIT_TIME = 10000L;
private volatile long counter;
private final BlobType btype;
--- 19,62 ----
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/*
* @test ThresholdNotificationsTest
! * @summary testing of getUsageThreshold()
! * @library /testlibrary /test/lib /
* @modules java.base/jdk.internal.misc
* java.management
! *
! * @build compiler.codecache.jmx.ThresholdNotificationsTest
! * @run driver ClassFileInstaller sun.hotspot.WhiteBox
* sun.hotspot.WhiteBox$WhiteBoxPermission
* @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
! * -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::*
! * -XX:+SegmentedCodeCache
! * compiler.codecache.jmx.ThresholdNotificationsTest
! * @run main/othervm -Xbootclasspath/a:. -XX:-UseCodeCacheFlushing
! * -XX:+WhiteBoxAPI -XX:-MethodFlushing -XX:CompileCommand=compileonly,null::*
! * -XX:-SegmentedCodeCache
! * compiler.codecache.jmx.ThresholdNotificationsTest
*/
+
+ package compiler.codecache.jmx;
+
+ import jdk.test.lib.Asserts;
+ import jdk.test.lib.Utils;
+ import sun.hotspot.code.BlobType;
+
+ import javax.management.ListenerNotFoundException;
+ import javax.management.Notification;
+ import javax.management.NotificationEmitter;
+ import javax.management.NotificationListener;
+ import java.lang.management.ManagementFactory;
+ import java.lang.management.MemoryNotificationInfo;
+ import java.lang.management.MemoryPoolMXBean;
+
public class ThresholdNotificationsTest implements NotificationListener {
private final static long WAIT_TIME = 10000L;
private volatile long counter;
private final BlobType btype;
*** 78,89 ****
}
}
}
protected void runTest() {
! int iterationsCount =
! Integer.getInteger("jdk.test.lib.iterations", 1);
MemoryPoolMXBean bean = btype.getMemoryPool();
((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
addNotificationListener(this, null, null);
for (int i = 0; i < iterationsCount; i++) {
CodeCacheUtils.hitUsageThreshold(bean, btype);
--- 87,98 ----
}
}
}
protected void runTest() {
! int iterationsCount
! = Integer.getInteger("jdk.test.lib.iterations", 1);
MemoryPoolMXBean bean = btype.getMemoryPool();
((NotificationEmitter) ManagementFactory.getMemoryMXBean()).
addNotificationListener(this, null, null);
for (int i = 0; i < iterationsCount; i++) {
CodeCacheUtils.hitUsageThreshold(bean, btype);
< prev index next >