< prev index next >

test/jdk/jdk/jfr/jcmd/TestJcmdStartStopDefault.java

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


  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.jcmd;
  27 
  28 import java.nio.file.Path;
  29 import java.nio.file.Paths;
  30 import java.util.regex.Matcher;
  31 import java.util.regex.Pattern;
  32 
  33 import jdk.test.lib.Asserts;
  34 import jdk.test.lib.jfr.FileHelper;
  35 import jdk.test.lib.process.OutputAnalyzer;
  36 
  37 /*
  38  * @test
  39  * @summary Start a recording without name.
  40  * @key jfr

  41  * @library /test/lib /test/jdk
  42  * @run main/othervm jdk.jfr.jcmd.TestJcmdStartStopDefault
  43  */
  44 public class TestJcmdStartStopDefault {
  45 
  46     public static void main(String[] args) throws Exception {
  47         Path recording = Paths.get(".","TestJcmdStartStopDefault.jfr").toAbsolutePath().normalize();
  48 
  49         OutputAnalyzer output = JcmdHelper.jcmd("JFR.start");
  50         JcmdAsserts.assertRecordingHasStarted(output);
  51 
  52         String name = parseRecordingName(output);
  53         JcmdHelper.waitUntilRunning(name);
  54 
  55         output = JcmdHelper.jcmd("JFR.dump",
  56                 "name=" + name,
  57                 "filename=" + recording);
  58         JcmdAsserts.assertRecordingDumpedToFile(output, recording.toFile());
  59         JcmdHelper.stopAndCheck(name);
  60         FileHelper.verifyRecording(recording.toFile());


  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.jcmd;
  27 
  28 import java.nio.file.Path;
  29 import java.nio.file.Paths;
  30 import java.util.regex.Matcher;
  31 import java.util.regex.Pattern;
  32 
  33 import jdk.test.lib.Asserts;
  34 import jdk.test.lib.jfr.FileHelper;
  35 import jdk.test.lib.process.OutputAnalyzer;
  36 
  37 /**
  38  * @test
  39  * @summary Start a recording without name.
  40  * @key jfr
  41  * @requires vm.hasJFR
  42  * @library /test/lib /test/jdk
  43  * @run main/othervm jdk.jfr.jcmd.TestJcmdStartStopDefault
  44  */
  45 public class TestJcmdStartStopDefault {
  46 
  47     public static void main(String[] args) throws Exception {
  48         Path recording = Paths.get(".","TestJcmdStartStopDefault.jfr").toAbsolutePath().normalize();
  49 
  50         OutputAnalyzer output = JcmdHelper.jcmd("JFR.start");
  51         JcmdAsserts.assertRecordingHasStarted(output);
  52 
  53         String name = parseRecordingName(output);
  54         JcmdHelper.waitUntilRunning(name);
  55 
  56         output = JcmdHelper.jcmd("JFR.dump",
  57                 "name=" + name,
  58                 "filename=" + recording);
  59         JcmdAsserts.assertRecordingDumpedToFile(output, recording.toFile());
  60         JcmdHelper.stopAndCheck(name);
  61         FileHelper.verifyRecording(recording.toFile());
< prev index next >