< prev index next >

test/jdk/jdk/jfr/jcmd/TestJcmdLegacy.java

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


  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.jcmd;
  27 
  28 import java.io.File;
  29 import java.io.IOException;
  30 import java.nio.file.Path;
  31 import java.nio.file.Paths;
  32 
  33 import jdk.jfr.Recording;
  34 import jdk.jfr.consumer.RecordedEvent;
  35 import jdk.jfr.consumer.RecordingFile;
  36 import jdk.test.lib.Utils;
  37 import jdk.test.lib.jfr.EventNames;
  38 import jdk.test.lib.jfr.FileHelper;
  39 import jdk.test.lib.process.OutputAnalyzer;
  40 
  41 /*
  42  * @test TestClassId
  43  * @key jfr

  44  * @library /test/lib /test/jdk
  45  * @modules jdk.jfr/jdk.jfr.internal
  46  * @run main/othervm jdk.jfr.jcmd.TestJcmdLegacy
  47  */
  48 public class TestJcmdLegacy {
  49 
  50     private static final String DIR = System.getProperty("test.src", ".");
  51     private static final File SETTINGS = new File(DIR, "legacy.jfc");
  52 
  53     private static final String LEGACY_EVENT = "com.oracle.jdk.JVMInformation";
  54 
  55     public static void main(String... args) throws Exception {
  56         testAPI();
  57         testJcmd();
  58     }
  59 
  60     private static void testJcmd() throws Exception {
  61         String name = "testLegacy";
  62         Path p = Paths.get(name + ".jfr").toAbsolutePath().normalize();
  63         OutputAnalyzer output = JcmdHelper.jcmd("JFR.start", "name=" + name, "settings=" + SETTINGS.getCanonicalPath());




  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.jcmd;
  27 
  28 import java.io.File;
  29 import java.io.IOException;
  30 import java.nio.file.Path;
  31 import java.nio.file.Paths;
  32 
  33 import jdk.jfr.Recording;
  34 import jdk.jfr.consumer.RecordedEvent;
  35 import jdk.jfr.consumer.RecordingFile;
  36 import jdk.test.lib.Utils;
  37 import jdk.test.lib.jfr.EventNames;
  38 import jdk.test.lib.jfr.FileHelper;
  39 import jdk.test.lib.process.OutputAnalyzer;
  40 
  41 /**
  42  * @test TestClassId
  43  * @key jfr
  44  * @requires vm.hasJFR
  45  * @library /test/lib /test/jdk
  46  * @modules jdk.jfr/jdk.jfr.internal
  47  * @run main/othervm jdk.jfr.jcmd.TestJcmdLegacy
  48  */
  49 public class TestJcmdLegacy {
  50 
  51     private static final String DIR = System.getProperty("test.src", ".");
  52     private static final File SETTINGS = new File(DIR, "legacy.jfc");
  53 
  54     private static final String LEGACY_EVENT = "com.oracle.jdk.JVMInformation";
  55 
  56     public static void main(String... args) throws Exception {
  57         testAPI();
  58         testJcmd();
  59     }
  60 
  61     private static void testJcmd() throws Exception {
  62         String name = "testLegacy";
  63         Path p = Paths.get(name + ".jfr").toAbsolutePath().normalize();
  64         OutputAnalyzer output = JcmdHelper.jcmd("JFR.start", "name=" + name, "settings=" + SETTINGS.getCanonicalPath());


< prev index next >