test/jdk/jdk/jfr/api/consumer/streaming/TestUnstarted.java
author egahlin
Thu, 15 Aug 2019 03:00:02 +0200
branchJEP-349-branch
changeset 57755 8173090d2794
child 58076 ca625d28c580
permissions -rw-r--r--
Test streaming without repository being created

package jdk.jfr.api.consumer.streaming;

import jdk.jfr.consumer.EventStream;

/**
 * @test
 * @summary Verifies that is possible to open a stream when a repository doesn't
 *          exists
 * @key jfr
 * @requires vm.hasJFR
 * @library /test/lib
 * @run main/othervm jdk.jfr.api.consumer.streaming.TestUnstarted
 */
public class TestUnstarted {
    public static void main(String... args) throws Exception {
        try (EventStream es = EventStream.openRepository()) {
            es.onEvent(e -> {
                // ignore
            });
            es.startAsync();
        }
    }
}