< prev index next >

test/jdk/jdk/jfr/jmx/TestRecordingOptions.java

Print this page
rev 51054 : imported patch 9000013-aixDisableJFR-requires.patch


  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.jfr.jmx;
  27 
  28 import java.util.HashMap;
  29 import java.util.LinkedHashMap;
  30 import java.util.Map;
  31 
  32 import jdk.management.jfr.FlightRecorderMXBean;
  33 import jdk.test.lib.Asserts;
  34 
  35 /*
  36  * @test
  37  * @key jfr

  38  * @library /test/lib /test/jdk
  39  * @run main/othervm jdk.jfr.jmx.TestRecordingOptions
  40  */
  41 public class TestRecordingOptions {
  42     @SuppressWarnings({ "rawtypes", "unchecked" })
  43     public static void main(String[] args) throws Exception {
  44         Map<String, String> options = new HashMap<>();
  45         options.put("name", "myName");
  46         options.put("maxAge", "2 h");
  47         options.put("maxSize", "1234567890");
  48         options.put("dumpOnExit", "false");
  49         options.put("disk", "false");
  50         options.put("duration", "1 h"); // don't want recording to stop
  51 
  52         FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean();
  53         long recId = bean.newRecording();
  54         Map<String, String> defaults = bean.getRecordingOptions(recId);
  55         bean.setRecordingOptions(recId, options);
  56 
  57         // Verify that all options have been set. We only check the option we




  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 package jdk.jfr.jmx;
  27 
  28 import java.util.HashMap;
  29 import java.util.LinkedHashMap;
  30 import java.util.Map;
  31 
  32 import jdk.management.jfr.FlightRecorderMXBean;
  33 import jdk.test.lib.Asserts;
  34 
  35 /**
  36  * @test
  37  * @key jfr
  38  * @requires vm.hasJFR
  39  * @library /test/lib /test/jdk
  40  * @run main/othervm jdk.jfr.jmx.TestRecordingOptions
  41  */
  42 public class TestRecordingOptions {
  43     @SuppressWarnings({ "rawtypes", "unchecked" })
  44     public static void main(String[] args) throws Exception {
  45         Map<String, String> options = new HashMap<>();
  46         options.put("name", "myName");
  47         options.put("maxAge", "2 h");
  48         options.put("maxSize", "1234567890");
  49         options.put("dumpOnExit", "false");
  50         options.put("disk", "false");
  51         options.put("duration", "1 h"); // don't want recording to stop
  52 
  53         FlightRecorderMXBean bean = JmxHelper.getFlighteRecorderMXBean();
  54         long recId = bean.newRecording();
  55         Map<String, String> defaults = bean.getRecordingOptions(recId);
  56         bean.setRecordingOptions(recId, options);
  57 
  58         // Verify that all options have been set. We only check the option we


< prev index next >