提交 52dbf4b5 编写于 作者: J jbachorik

7144200: java/lang/management/ClassLoadingMXBean/LoadCounts.java failed with JFR enabled

Summary: Make the test less stringent by not requiring the number of loaded classes to increase by a specific number
Reviewed-by: sla
上级 9d1f044a
......@@ -312,9 +312,6 @@ tools/pack200/Pack200Test.java solaris-all, mac
# 8007410
tools/launcher/FXLauncherTest.java linux-all
# 7144200
java/lang/management/ClassLoadingMXBean/LoadCounts.java generic-all
############################################################################
# jdk_jdi
......
......@@ -28,10 +28,10 @@
* ClassLoadingMXBean.getTotalLoadedClassCount()
* ClassLoadingMXBean.getUnloadedClassCount()
* @author Alexei Guibadoulline
* @run main/othervm LoadCounts
*/
import java.lang.management.*;
import java.util.*;
public class LoadCounts {
private static ClassLoadingMXBean mbean
......@@ -55,13 +55,15 @@ public class LoadCounts {
throw new RuntimeException("getLoadedClassCount() > "
+ "getTotalLoadedClassCount()");
if (classesNowPrev + 4 != classesNow)
if (classesNowPrev + 4 > classesNow)
throw new RuntimeException("Number of loaded classes is "
+ "expected to be at least "
+ (classesNowPrev + 4) + ", but "
+ "MBean.getLoadedClassCount() returned "
+ classesNow);
if (classesTotalPrev + 4 != classesTotal)
if (classesTotalPrev + 4 > classesTotal)
throw new RuntimeException("Total number of loaded classes is "
+ "expected to be at least "
+ (classesTotalPrev + 4) + ", but "
+ "MBean.getTotalLoadedClassCount() "
+ "returned " + classesTotal);
......@@ -95,13 +97,15 @@ public class LoadCounts {
// Expected 2 classes got loaded since they are loaded by
// same defining class loader
if (classesNowPrev + 2 != classesNow)
throw new RuntimeException("Expected Number of loaded classes is "
if (classesNowPrev + 2 > classesNow)
throw new RuntimeException("Number of loaded classes is "
+ "expected to be at least "
+ (classesNowPrev + 4) + ", but "
+ "MBean.getLoadedClassCount() returned "
+ classesNow);
if (classesTotalPrev + 2 != classesTotal)
if (classesTotalPrev + 2 > classesTotal)
throw new RuntimeException("Total number of loaded classes is "
+ "expected to be at least "
+ (classesTotalPrev + 4) + ", but "
+ "MBean.getTotalLoadedClassCount() "
+ "returned " + classesTotal);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册