30 import java.time.Instant;
31 import java.util.Arrays;
32 import java.util.HashSet;
33 import java.util.List;
34 import java.util.Set;
35 import java.util.function.Function;
36
37 import jdk.jfr.Event;
38 import jdk.jfr.Recording;
39 import jdk.jfr.StackTrace;
40 import jdk.jfr.Timespan;
41 import jdk.jfr.Timestamp;
42 import jdk.jfr.Unsigned;
43 import jdk.jfr.consumer.RecordedClass;
44 import jdk.jfr.consumer.RecordedEvent;
45 import jdk.jfr.consumer.RecordedObject;
46 import jdk.jfr.consumer.RecordedThread;
47 import jdk.test.lib.Asserts;
48 import jdk.test.lib.jfr.Events;
49
50 /*
51 * @test
52 * @summary Verifies the methods of the RecordedObject
53 * @key jfr
54 * @library /test/lib
55 * @run main/othervm jdk.jfr.api.consumer.TestRecordedObject
56 */
57 public class TestRecordedObject {
58
59 private final static boolean BOOLEAN_VALUE = true;
60 private final static byte VALUE = 47;
61 private final static String STRING_VALUE = "47";
62 private final static Class<?> CLASS_VALUE = String.class;
63 private final static Thread THREAD_VALUE = Thread.currentThread();
64 private final static Instant INSTANT_VALUE = Instant.now();
65 private final static Duration DURATION_VALUE = Duration.ofSeconds(47);
66
67 @StackTrace(false)
68 static final class EventWithValues extends Event {
69 boolean booleanField = BOOLEAN_VALUE;
70 byte byteField = VALUE;
71 char charField = VALUE;
72 short shortField = VALUE;
73 int intField = VALUE;
|
30 import java.time.Instant;
31 import java.util.Arrays;
32 import java.util.HashSet;
33 import java.util.List;
34 import java.util.Set;
35 import java.util.function.Function;
36
37 import jdk.jfr.Event;
38 import jdk.jfr.Recording;
39 import jdk.jfr.StackTrace;
40 import jdk.jfr.Timespan;
41 import jdk.jfr.Timestamp;
42 import jdk.jfr.Unsigned;
43 import jdk.jfr.consumer.RecordedClass;
44 import jdk.jfr.consumer.RecordedEvent;
45 import jdk.jfr.consumer.RecordedObject;
46 import jdk.jfr.consumer.RecordedThread;
47 import jdk.test.lib.Asserts;
48 import jdk.test.lib.jfr.Events;
49
50 /**
51 * @test
52 * @summary Verifies the methods of the RecordedObject
53 * @key jfr
54 * @requires vm.hasJFR
55 * @library /test/lib
56 * @run main/othervm jdk.jfr.api.consumer.TestRecordedObject
57 */
58 public class TestRecordedObject {
59
60 private final static boolean BOOLEAN_VALUE = true;
61 private final static byte VALUE = 47;
62 private final static String STRING_VALUE = "47";
63 private final static Class<?> CLASS_VALUE = String.class;
64 private final static Thread THREAD_VALUE = Thread.currentThread();
65 private final static Instant INSTANT_VALUE = Instant.now();
66 private final static Duration DURATION_VALUE = Duration.ofSeconds(47);
67
68 @StackTrace(false)
69 static final class EventWithValues extends Event {
70 boolean booleanField = BOOLEAN_VALUE;
71 byte byteField = VALUE;
72 char charField = VALUE;
73 short shortField = VALUE;
74 int intField = VALUE;
|