< prev index next >

test/jdk/jdk/jfr/api/recording/misc/TestGetStream.java

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


  26 
  27 import java.io.IOException;
  28 import java.io.InputStream;
  29 import java.nio.file.Files;
  30 import java.nio.file.Path;
  31 import java.nio.file.Paths;
  32 import java.nio.file.StandardCopyOption;
  33 import java.time.Duration;
  34 import java.time.Instant;
  35 import java.util.ArrayList;
  36 import java.util.Arrays;
  37 import java.util.List;
  38 import java.util.stream.Collectors;
  39 
  40 import jdk.jfr.Recording;
  41 import jdk.jfr.consumer.RecordedEvent;
  42 import jdk.jfr.consumer.RecordingFile;
  43 import jdk.test.lib.Asserts;
  44 import jdk.test.lib.jfr.SimpleEvent;
  45 
  46 /*
  47  * @test
  48  * @summary A simple test for Recording.getStream()
  49  * @key jfr

  50  * @library /test/lib
  51  * @run main/othervm jdk.jfr.api.recording.misc.TestGetStream
  52  */
  53 public class TestGetStream {
  54 
  55     private final static Instant offset = Instant.now();
  56     private static Instant previous;
  57 
  58     public static void main(String[] args) throws Exception {
  59 
  60         Recording recording = new Recording();
  61         Instant t0 = newTimestamp();
  62         recording.start();
  63         Instant t1 = newTimestamp();
  64         createChunkWithId(1);
  65         Instant t2 = newTimestamp();
  66         createChunkWithId(2);
  67         Instant t3 = newTimestamp();
  68         createChunkWithId(3);
  69         Instant t4 = newTimestamp();




  26 
  27 import java.io.IOException;
  28 import java.io.InputStream;
  29 import java.nio.file.Files;
  30 import java.nio.file.Path;
  31 import java.nio.file.Paths;
  32 import java.nio.file.StandardCopyOption;
  33 import java.time.Duration;
  34 import java.time.Instant;
  35 import java.util.ArrayList;
  36 import java.util.Arrays;
  37 import java.util.List;
  38 import java.util.stream.Collectors;
  39 
  40 import jdk.jfr.Recording;
  41 import jdk.jfr.consumer.RecordedEvent;
  42 import jdk.jfr.consumer.RecordingFile;
  43 import jdk.test.lib.Asserts;
  44 import jdk.test.lib.jfr.SimpleEvent;
  45 
  46 /**
  47  * @test
  48  * @summary A simple test for Recording.getStream()
  49  * @key jfr
  50  * @requires vm.hasJFR
  51  * @library /test/lib
  52  * @run main/othervm jdk.jfr.api.recording.misc.TestGetStream
  53  */
  54 public class TestGetStream {
  55 
  56     private final static Instant offset = Instant.now();
  57     private static Instant previous;
  58 
  59     public static void main(String[] args) throws Exception {
  60 
  61         Recording recording = new Recording();
  62         Instant t0 = newTimestamp();
  63         recording.start();
  64         Instant t1 = newTimestamp();
  65         createChunkWithId(1);
  66         Instant t2 = newTimestamp();
  67         createChunkWithId(2);
  68         Instant t3 = newTimestamp();
  69         createChunkWithId(3);
  70         Instant t4 = newTimestamp();


< prev index next >