< prev index next >

test/jdk/jdk/jfr/startupargs/TestDumpOnExit.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.startupargs;
  27 
  28 import java.io.IOException;
  29 import java.nio.file.DirectoryStream;
  30 import java.nio.file.Files;
  31 import java.nio.file.Path;
  32 import java.nio.file.Paths;
  33 import java.util.Iterator;
  34 import java.util.function.Supplier;
  35 
  36 import jdk.jfr.consumer.RecordingFile;
  37 import jdk.test.lib.Asserts;
  38 import jdk.test.lib.process.OutputAnalyzer;
  39 import jdk.test.lib.process.ProcessTools;
  40 
  41 /*
  42  * @test
  43  * @summary Start a FlightRecording with dumponexit. Verify dump exists.
  44  * @key jfr

  45  * @library /test/lib
  46  * @run main/othervm jdk.jfr.startupargs.TestDumpOnExit
  47  */
  48 public class TestDumpOnExit {
  49 
  50     public static void main(String[] args) throws Exception {
  51         Path dumpPath = Paths.get(".", "dumped.jfr");
  52 
  53         // Test without security manager and a file name relative to current directory
  54         testDumponExit(() -> dumpPath,
  55                 "-Xlog:jfr=trace",
  56                 "-XX:StartFlightRecording=filename=./dumped.jfr,dumponexit=true,settings=profile",
  57                 "jdk.jfr.startupargs.TestDumpOnExit$TestMain"
  58         );
  59         // Test a memory recording without a security manager
  60         testDumponExit(() -> findJFRFileInCurrentDirectory(),
  61                 "-Xlog:jfr=trace",
  62                 "-XX:StartFlightRecording=dumponexit=true,disk=false",
  63                 "jdk.jfr.startupargs.TestDumpOnExit$TestMain"
  64         );




  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.startupargs;
  27 
  28 import java.io.IOException;
  29 import java.nio.file.DirectoryStream;
  30 import java.nio.file.Files;
  31 import java.nio.file.Path;
  32 import java.nio.file.Paths;
  33 import java.util.Iterator;
  34 import java.util.function.Supplier;
  35 
  36 import jdk.jfr.consumer.RecordingFile;
  37 import jdk.test.lib.Asserts;
  38 import jdk.test.lib.process.OutputAnalyzer;
  39 import jdk.test.lib.process.ProcessTools;
  40 
  41 /**
  42  * @test
  43  * @summary Start a FlightRecording with dumponexit. Verify dump exists.
  44  * @key jfr
  45  * @requires vm.hasJFR
  46  * @library /test/lib
  47  * @run main/othervm jdk.jfr.startupargs.TestDumpOnExit
  48  */
  49 public class TestDumpOnExit {
  50 
  51     public static void main(String[] args) throws Exception {
  52         Path dumpPath = Paths.get(".", "dumped.jfr");
  53 
  54         // Test without security manager and a file name relative to current directory
  55         testDumponExit(() -> dumpPath,
  56                 "-Xlog:jfr=trace",
  57                 "-XX:StartFlightRecording=filename=./dumped.jfr,dumponexit=true,settings=profile",
  58                 "jdk.jfr.startupargs.TestDumpOnExit$TestMain"
  59         );
  60         // Test a memory recording without a security manager
  61         testDumponExit(() -> findJFRFileInCurrentDirectory(),
  62                 "-Xlog:jfr=trace",
  63                 "-XX:StartFlightRecording=dumponexit=true,disk=false",
  64                 "jdk.jfr.startupargs.TestDumpOnExit$TestMain"
  65         );


< prev index next >