test/jdk/jdk/jfr/api/consumer/streaming/TestUnstarted.java
branchJEP-349-branch
changeset 57755 8173090d2794
child 58076 ca625d28c580
equal deleted inserted replaced
57754:5693904ecbde 57755:8173090d2794
       
     1 package jdk.jfr.api.consumer.streaming;
       
     2 
       
     3 import jdk.jfr.consumer.EventStream;
       
     4 
       
     5 /**
       
     6  * @test
       
     7  * @summary Verifies that is possible to open a stream when a repository doesn't
       
     8  *          exists
       
     9  * @key jfr
       
    10  * @requires vm.hasJFR
       
    11  * @library /test/lib
       
    12  * @run main/othervm jdk.jfr.api.consumer.streaming.TestUnstarted
       
    13  */
       
    14 public class TestUnstarted {
       
    15     public static void main(String... args) throws Exception {
       
    16         try (EventStream es = EventStream.openRepository()) {
       
    17             es.onEvent(e -> {
       
    18                 // ignore
       
    19             });
       
    20             es.startAsync();
       
    21         }
       
    22     }
       
    23 }