< prev index next >

test/jdk/jdk/jfr/api/metadata/annotations/TestRelational.java

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


  23  * questions.
  24  */
  25 
  26 package jdk.jfr.api.metadata.annotations;
  27 
  28 import java.lang.annotation.ElementType;
  29 import java.lang.annotation.Retention;
  30 import java.lang.annotation.RetentionPolicy;
  31 import java.lang.annotation.Target;
  32 
  33 import jdk.jfr.AnnotationElement;
  34 import jdk.jfr.Event;
  35 import jdk.jfr.EventType;
  36 import jdk.jfr.Label;
  37 import jdk.jfr.MetadataDefinition;
  38 import jdk.jfr.Relational;
  39 import jdk.jfr.ValueDescriptor;
  40 import jdk.test.lib.Asserts;
  41 import jdk.test.lib.jfr.Events;
  42 
  43 /*
  44  * @test
  45  * @key jfr

  46  * @library /test/lib
  47  * @run main/othervm jdk.jfr.api.metadata.annotations.TestRelational
  48  */
  49 public class TestRelational {
  50 
  51     @MetadataDefinition
  52     @Label("User Id")
  53     @Relational
  54     @Target({ ElementType.FIELD })
  55     @Retention(RetentionPolicy.RUNTIME)
  56     @interface UserId {
  57     }
  58 
  59     static class UserEvent extends Event {
  60         @UserId
  61         String id;
  62     }
  63 
  64     public static void main(String[] args) throws Exception {
  65         EventType t = EventType.getEventType(UserEvent.class);


  23  * questions.
  24  */
  25 
  26 package jdk.jfr.api.metadata.annotations;
  27 
  28 import java.lang.annotation.ElementType;
  29 import java.lang.annotation.Retention;
  30 import java.lang.annotation.RetentionPolicy;
  31 import java.lang.annotation.Target;
  32 
  33 import jdk.jfr.AnnotationElement;
  34 import jdk.jfr.Event;
  35 import jdk.jfr.EventType;
  36 import jdk.jfr.Label;
  37 import jdk.jfr.MetadataDefinition;
  38 import jdk.jfr.Relational;
  39 import jdk.jfr.ValueDescriptor;
  40 import jdk.test.lib.Asserts;
  41 import jdk.test.lib.jfr.Events;
  42 
  43 /**
  44  * @test
  45  * @key jfr
  46  * @requires vm.hasJFR
  47  * @library /test/lib
  48  * @run main/othervm jdk.jfr.api.metadata.annotations.TestRelational
  49  */
  50 public class TestRelational {
  51 
  52     @MetadataDefinition
  53     @Label("User Id")
  54     @Relational
  55     @Target({ ElementType.FIELD })
  56     @Retention(RetentionPolicy.RUNTIME)
  57     @interface UserId {
  58     }
  59 
  60     static class UserEvent extends Event {
  61         @UserId
  62         String id;
  63     }
  64 
  65     public static void main(String[] args) throws Exception {
  66         EventType t = EventType.getEventType(UserEvent.class);
< prev index next >