< prev index next >

test/jdk/jdk/jfr/api/recording/destination/TestDestState.java

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


  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.api.recording.destination;
  27 
  28 import java.nio.file.Files;
  29 import java.nio.file.Path;
  30 import java.nio.file.Paths;
  31 import java.util.List;
  32 
  33 import jdk.jfr.Recording;
  34 import jdk.jfr.consumer.RecordedEvent;
  35 import jdk.jfr.consumer.RecordingFile;
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.jfr.SimpleEventHelper;
  38 
  39 /*
  40  * @test
  41  * @summary Call setDestination() when recording in different states
  42  * @key jfr

  43  * @library /test/lib
  44  * @run main/othervm jdk.jfr.api.recording.destination.TestDestState
  45  */
  46 public class TestDestState {
  47 
  48     public static void main(String[] args) throws Throwable {
  49         Recording r = new Recording();
  50         SimpleEventHelper.enable(r, true);
  51 
  52         final Path newDest = Paths.get(".", "new.jfr");
  53         r.setDestination(newDest);
  54         System.out.println("new dest: " + r.getDestination());
  55         Asserts.assertEquals(newDest, r.getDestination(), "Wrong get/set dest when new");
  56 
  57         r.start();
  58         SimpleEventHelper.createEvent(0);
  59         Thread.sleep(100);
  60         final Path runningDest = Paths.get(".", "running.jfr");
  61         r.setDestination(runningDest);
  62         System.out.println("running dest: " + r.getDestination());


  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.api.recording.destination;
  27 
  28 import java.nio.file.Files;
  29 import java.nio.file.Path;
  30 import java.nio.file.Paths;
  31 import java.util.List;
  32 
  33 import jdk.jfr.Recording;
  34 import jdk.jfr.consumer.RecordedEvent;
  35 import jdk.jfr.consumer.RecordingFile;
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.jfr.SimpleEventHelper;
  38 
  39 /**
  40  * @test
  41  * @summary Call setDestination() when recording in different states
  42  * @key jfr
  43  * @requires vm.hasJFR
  44  * @library /test/lib
  45  * @run main/othervm jdk.jfr.api.recording.destination.TestDestState
  46  */
  47 public class TestDestState {
  48 
  49     public static void main(String[] args) throws Throwable {
  50         Recording r = new Recording();
  51         SimpleEventHelper.enable(r, true);
  52 
  53         final Path newDest = Paths.get(".", "new.jfr");
  54         r.setDestination(newDest);
  55         System.out.println("new dest: " + r.getDestination());
  56         Asserts.assertEquals(newDest, r.getDestination(), "Wrong get/set dest when new");
  57 
  58         r.start();
  59         SimpleEventHelper.createEvent(0);
  60         Thread.sleep(100);
  61         final Path runningDest = Paths.get(".", "running.jfr");
  62         r.setDestination(runningDest);
  63         System.out.println("running dest: " + r.getDestination());
< prev index next >