6687508: Update test/sun/management jtreg tests due to sun.management.ManagementFactory class rename
Modified the jtreg tests to use ManagementFactoryHelper instead Reviewed-by: emcmanus
This commit is contained in:
parent
85ae69c481
commit
6c33c4e721
@ -37,7 +37,7 @@ import sun.management.*;
|
|||||||
public class GetClassInitializationTime {
|
public class GetClassInitializationTime {
|
||||||
|
|
||||||
private static HotspotClassLoadingMBean mbean =
|
private static HotspotClassLoadingMBean mbean =
|
||||||
(HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
|
(HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
|
||||||
|
|
||||||
// Careful with these values.
|
// Careful with these values.
|
||||||
private static final long MIN_TIME_FOR_PASS = 1;
|
private static final long MIN_TIME_FOR_PASS = 1;
|
||||||
|
@ -39,7 +39,7 @@ import sun.management.*;
|
|||||||
public class GetClassLoadingTime {
|
public class GetClassLoadingTime {
|
||||||
|
|
||||||
private static HotspotClassLoadingMBean mbean =
|
private static HotspotClassLoadingMBean mbean =
|
||||||
(HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
|
(HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
|
||||||
|
|
||||||
// Careful with these values.
|
// Careful with these values.
|
||||||
private static final long MIN_TIME_FOR_PASS = 1;
|
private static final long MIN_TIME_FOR_PASS = 1;
|
||||||
|
@ -37,7 +37,7 @@ import sun.management.*;
|
|||||||
public class GetInitializedClassCount {
|
public class GetInitializedClassCount {
|
||||||
|
|
||||||
private static HotspotClassLoadingMBean mbean =
|
private static HotspotClassLoadingMBean mbean =
|
||||||
(HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
|
(HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
|
||||||
|
|
||||||
// Careful with these values.
|
// Careful with these values.
|
||||||
private static final long MIN_VALUE_FOR_PASS = 1;
|
private static final long MIN_VALUE_FOR_PASS = 1;
|
||||||
|
@ -37,7 +37,7 @@ import sun.management.*;
|
|||||||
public class GetLoadedClassSize {
|
public class GetLoadedClassSize {
|
||||||
|
|
||||||
private static HotspotClassLoadingMBean mbean =
|
private static HotspotClassLoadingMBean mbean =
|
||||||
(HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
|
(HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
|
||||||
|
|
||||||
// Careful with these values.
|
// Careful with these values.
|
||||||
private static final long MIN_VALUE_FOR_PASS = 1;
|
private static final long MIN_VALUE_FOR_PASS = 1;
|
||||||
|
@ -37,7 +37,7 @@ import sun.management.*;
|
|||||||
public class GetMethodDataSize {
|
public class GetMethodDataSize {
|
||||||
|
|
||||||
private static HotspotClassLoadingMBean mbean =
|
private static HotspotClassLoadingMBean mbean =
|
||||||
(HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
|
(HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
|
||||||
|
|
||||||
// Careful with these values.
|
// Careful with these values.
|
||||||
private static final long MIN_VALUE_FOR_PASS = 1;
|
private static final long MIN_VALUE_FOR_PASS = 1;
|
||||||
|
@ -37,7 +37,7 @@ import sun.management.*;
|
|||||||
public class GetUnloadedClassSize {
|
public class GetUnloadedClassSize {
|
||||||
|
|
||||||
private static HotspotClassLoadingMBean mbean =
|
private static HotspotClassLoadingMBean mbean =
|
||||||
(HotspotClassLoadingMBean)ManagementFactory.getHotspotClassLoadingMBean();
|
(HotspotClassLoadingMBean)ManagementFactoryHelper.getHotspotClassLoadingMBean();
|
||||||
|
|
||||||
// Careful with these values.
|
// Careful with these values.
|
||||||
private static final long MIN_VALUE_FOR_PASS = 0;
|
private static final long MIN_VALUE_FOR_PASS = 0;
|
||||||
|
@ -37,7 +37,7 @@ import sun.management.*;
|
|||||||
public class GetSafepointCount {
|
public class GetSafepointCount {
|
||||||
|
|
||||||
private static HotspotRuntimeMBean mbean =
|
private static HotspotRuntimeMBean mbean =
|
||||||
(HotspotRuntimeMBean)ManagementFactory.getHotspotRuntimeMBean();
|
(HotspotRuntimeMBean)ManagementFactoryHelper.getHotspotRuntimeMBean();
|
||||||
|
|
||||||
private static final long NUM_THREAD_DUMPS = 5;
|
private static final long NUM_THREAD_DUMPS = 5;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ import sun.management.*;
|
|||||||
public class GetSafepointSyncTime {
|
public class GetSafepointSyncTime {
|
||||||
|
|
||||||
private static HotspotRuntimeMBean mbean =
|
private static HotspotRuntimeMBean mbean =
|
||||||
(HotspotRuntimeMBean)ManagementFactory.getHotspotRuntimeMBean();
|
(HotspotRuntimeMBean)ManagementFactoryHelper.getHotspotRuntimeMBean();
|
||||||
|
|
||||||
private static final long NUM_THREAD_DUMPS = 300;
|
private static final long NUM_THREAD_DUMPS = 300;
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ import sun.management.*;
|
|||||||
public class GetTotalSafepointTime {
|
public class GetTotalSafepointTime {
|
||||||
|
|
||||||
private static HotspotRuntimeMBean mbean =
|
private static HotspotRuntimeMBean mbean =
|
||||||
(HotspotRuntimeMBean)ManagementFactory.getHotspotRuntimeMBean();
|
(HotspotRuntimeMBean)ManagementFactoryHelper.getHotspotRuntimeMBean();
|
||||||
|
|
||||||
private static final long NUM_THREAD_DUMPS = 100;
|
private static final long NUM_THREAD_DUMPS = 100;
|
||||||
|
|
||||||
|
@ -32,10 +32,11 @@
|
|||||||
import sun.management.*;
|
import sun.management.*;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.lang.management.ThreadMXBean;
|
import java.lang.management.ThreadMXBean;
|
||||||
|
import java.lang.management.ManagementFactory;
|
||||||
|
|
||||||
public class GetInternalThreads {
|
public class GetInternalThreads {
|
||||||
private static HotspotThreadMBean mbean =
|
private static HotspotThreadMBean mbean =
|
||||||
ManagementFactory.getHotspotThreadMBean();
|
ManagementFactoryHelper.getHotspotThreadMBean();
|
||||||
|
|
||||||
// Minimum number of VM internal threads
|
// Minimum number of VM internal threads
|
||||||
// VM thread, watcher thread, Low memory detector, compiler thread
|
// VM thread, watcher thread, Low memory detector, compiler thread
|
||||||
@ -55,7 +56,7 @@ public class GetInternalThreads {
|
|||||||
System.out.println("Internal Thread Count = " + value);
|
System.out.println("Internal Thread Count = " + value);
|
||||||
|
|
||||||
ThreadMXBean thread =
|
ThreadMXBean thread =
|
||||||
java.lang.management.ManagementFactory.getThreadMXBean();
|
ManagementFactory.getThreadMXBean();
|
||||||
if (!thread.isThreadCpuTimeSupported()) {
|
if (!thread.isThreadCpuTimeSupported()) {
|
||||||
System.out.println("Thread Cpu Time is not supported.");
|
System.out.println("Thread Cpu Time is not supported.");
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user