-
Bug
-
Resolution: Duplicate
-
P4
-
None
-
8u40, 9
Test verify that CMM doesn't work without unlocking options. It fails when these options are forced externally. It is needed to skip it in such case.
Here is the fix:
diff -r c4f0dadaaa37 jdk/management/cmm/MXBeanRequiresCommercialFeatures.java
--- a/jdk/management/cmm/MXBeanRequiresCommercialFeatures.java Fri Nov 07 09:22:58 2014 -0800
+++ b/jdk/management/cmm/MXBeanRequiresCommercialFeatures.java Tue Nov 11 17:41:47 2014 +0300
@@ -11,6 +11,7 @@
* @test
* @bug 8062565
* @summary Fail to acquire CMM MXBean impl w/o -XX:+UnlockCommercialFeatures
+ * @requires vm.opt.UnlockCommercialFeatures == "null" | vm.opt.UnlockCommercialFeatures == "false"
* @run main MXBeanRequiresCommercialFeatures
*/
public class MXBeanRequiresCommercialFeatures {
@@ -19,8 +20,7 @@
MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer();
SystemResourcePressureMXBean mbean = ManagementFactory
.getPlatformMXBean(SystemResourcePressureMXBean.class);
- throw new RuntimeException("Should have thrown IAE. Running with "+
- "-XX:+UnlockCommercialFeatures?");
+ throw new RuntimeException("Should have thrown IAE.");
} catch (IllegalArgumentException e) {
System.out.println("IAE thrown - test passes");
}
Here is the fix:
diff -r c4f0dadaaa37 jdk/management/cmm/MXBeanRequiresCommercialFeatures.java
--- a/jdk/management/cmm/MXBeanRequiresCommercialFeatures.java Fri Nov 07 09:22:58 2014 -0800
+++ b/jdk/management/cmm/MXBeanRequiresCommercialFeatures.java Tue Nov 11 17:41:47 2014 +0300
@@ -11,6 +11,7 @@
* @test
* @bug 8062565
* @summary Fail to acquire CMM MXBean impl w/o -XX:+UnlockCommercialFeatures
+ * @requires vm.opt.UnlockCommercialFeatures == "null" | vm.opt.UnlockCommercialFeatures == "false"
* @run main MXBeanRequiresCommercialFeatures
*/
public class MXBeanRequiresCommercialFeatures {
@@ -19,8 +20,7 @@
MBeanServer jmxServer = ManagementFactory.getPlatformMBeanServer();
SystemResourcePressureMXBean mbean = ManagementFactory
.getPlatformMXBean(SystemResourcePressureMXBean.class);
- throw new RuntimeException("Should have thrown IAE. Running with "+
- "-XX:+UnlockCommercialFeatures?");
+ throw new RuntimeException("Should have thrown IAE.");
} catch (IllegalArgumentException e) {
System.out.println("IAE thrown - test passes");
}
- duplicates
-
JDK-8064288 sun.management.Flag should loadLibrary()
-
- Resolved
-