test/jdk/jdk/jfr/jcmd/TestJcmdConfigure.java
changeset 52669 e21361bccfa1
parent 51214 67736b4846a0
child 55199 3a09397c147e
child 58678 9cf78a70fa4f
equal deleted inserted replaced
52668:02747dfbd776 52669:e21361bccfa1
    97         }
    97         }
    98     }
    98     }
    99 
    99 
   100     private static void testNegative(String configName, Object value) {
   100     private static void testNegative(String configName, Object value) {
   101         try {
   101         try {
   102             // Syntactically invalid arguments are catched by the JCMD framework where an error code of 1 is returned.
   102             JcmdHelper.jcmd(1, "JFR.configure", configName + "=" + value);
   103             // Syntactically valid arguments that are semantically invalid (invalid value ranges for example) are handled by JFR code, it will always return a value of 0.
       
   104             JcmdHelper.jcmd(configName.equals(UNSUPPORTED_OPTION) ? 1 : 0, "JFR.configure", configName + "=" + value);
       
   105         } catch(Exception e) {
   103         } catch(Exception e) {
   106             testExceptions.add(e);
   104             testExceptions.add(e);
   107         }
   105         }
   108     }
   106     }
   109 
   107