test/jdk/jdk/jfr/jcmd/TestJcmdLegacy.java
changeset 50745 a390cbb82d47
parent 50225 2942ae532175
child 51214 67736b4846a0
equal deleted inserted replaced
50744:6c306d54366d 50745:a390cbb82d47
    26 package jdk.jfr.jcmd;
    26 package jdk.jfr.jcmd;
    27 
    27 
    28 import java.io.File;
    28 import java.io.File;
    29 import java.io.IOException;
    29 import java.io.IOException;
    30 import java.nio.file.Path;
    30 import java.nio.file.Path;
       
    31 import java.nio.file.Paths;
    31 
    32 
    32 import jdk.jfr.Recording;
    33 import jdk.jfr.Recording;
    33 import jdk.jfr.consumer.RecordedEvent;
    34 import jdk.jfr.consumer.RecordedEvent;
    34 import jdk.jfr.consumer.RecordingFile;
    35 import jdk.jfr.consumer.RecordingFile;
    35 import jdk.test.lib.Utils;
    36 import jdk.test.lib.Utils;
    56         testJcmd();
    57         testJcmd();
    57     }
    58     }
    58 
    59 
    59     private static void testJcmd() throws Exception {
    60     private static void testJcmd() throws Exception {
    60         String name = "testLegacy";
    61         String name = "testLegacy";
    61         File p = new File(name + ".jfr");
    62         Path p = Paths.get(name + ".jfr").toAbsolutePath().normalize();
    62         OutputAnalyzer output = JcmdHelper.jcmd("JFR.start", "name=" + name, "settings=" + SETTINGS.getCanonicalPath());
    63         OutputAnalyzer output = JcmdHelper.jcmd("JFR.start", "name=" + name, "settings=" + SETTINGS.getCanonicalPath());
    63         JcmdAsserts.assertRecordingHasStarted(output);
    64         JcmdAsserts.assertRecordingHasStarted(output);
    64         JcmdHelper.waitUntilRunning(name);
    65         JcmdHelper.waitUntilRunning(name);
    65         JcmdHelper.stopWriteToFileAndCheck(name, p);
    66         JcmdHelper.stopWriteToFileAndCheck(name, p.toFile());
    66         FileHelper.verifyRecording(p);
    67         FileHelper.verifyRecording(p.toFile());
    67         verify(p.toPath());
    68         verify(p);
    68     }
    69     }
    69 
    70 
    70     private static void testAPI() throws IOException, Exception {
    71     private static void testAPI() throws IOException, Exception {
    71         Path p = Utils.createTempFile("enable-legacy-event", ".jfr");
    72         Path p = Utils.createTempFile("enable-legacy-event", ".jfr");
    72 
    73