Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8064579

[cmm] MXBeanRequiresCommercialFeatures should be filtered when -XX:-UnlockCommercialFeatures is used

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P4
    • None
    • 8u40, 9
    • other-libs

    Description

      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");
               }

      Attachments

        Issue Links

          Activity

            People

              bchristi Brent Christian
              lmesnik Leonid Mesnik
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: