test/jdk/jdk/jfr/api/consumer/TestReadTwice.java
changeset 50225 2942ae532175
parent 50113 caf115bb98ad
child 51214 67736b4846a0
equal deleted inserted replaced
50224:67066e7971e1 50225:2942ae532175
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package jdk.jfr.api.consumer;
    26 package jdk.jfr.api.consumer;
    27 
    27 
    28 import java.nio.file.Files;
       
    29 import java.nio.file.Path;
    28 import java.nio.file.Path;
       
    29 import java.nio.file.Paths;
    30 import java.util.LinkedList;
    30 import java.util.LinkedList;
    31 import java.util.List;
    31 import java.util.List;
    32 
    32 
    33 import jdk.jfr.Event;
    33 import jdk.jfr.Event;
    34 import jdk.jfr.Recording;
    34 import jdk.jfr.Recording;
    35 import jdk.jfr.consumer.RecordedEvent;
    35 import jdk.jfr.consumer.RecordedEvent;
    36 import jdk.jfr.consumer.RecordingFile;
    36 import jdk.jfr.consumer.RecordingFile;
    37 import jdk.test.lib.Asserts;
    37 import jdk.test.lib.Asserts;
       
    38 import jdk.test.lib.Utils;
    38 
    39 
    39 
    40 
    40 /*
    41 /*
    41  * @test
    42  * @test
    42  * @summary Reads the recorded file two times and verifies that both reads are the same
    43  * @summary Reads the recorded file two times and verifies that both reads are the same
    59         event.commit();
    60         event.commit();
    60 
    61 
    61         r.stop();
    62         r.stop();
    62 
    63 
    63         // Dump the recording to a file
    64         // Dump the recording to a file
    64         Path path = Files.createTempFile("recording", ".jfr");
    65         Path path = Utils.createTempFile("read-twice", ".jfr");
    65         System.out.println("Dumping to " + path);
    66         System.out.println("Dumping to " + path);
    66         r.dump(path);
    67         r.dump(path);
    67         r.close();
    68         r.close();
    68 
    69 
    69         // Read all events from the file in one go
    70         // Read all events from the file in one go