< prev index next >

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

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


  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.MetadataDefinition;
  37 import jdk.jfr.Name;
  38 import jdk.jfr.SettingDefinition;
  39 import jdk.jfr.SettingDescriptor;
  40 import jdk.jfr.ValueDescriptor;
  41 import jdk.test.lib.Asserts;
  42 import jdk.test.lib.jfr.Events;
  43 import jdk.test.lib.jfr.SimpleSetting;
  44 
  45 /*
  46  * @test
  47  * @key jfr

  48  * @library /test/lib
  49  * @run main/othervm jdk.jfr.api.metadata.annotations.TestName
  50  */
  51 public class TestName {
  52 
  53     @MetadataDefinition
  54     @Name("com.oracle.TestAnnotation")
  55     @Target({ ElementType.TYPE })
  56     @Retention(RetentionPolicy.RUNTIME)
  57     @interface NamedAnnotation {
  58     }
  59 
  60     @NamedAnnotation
  61     @Name("com.oracle.TestEvent")
  62     static class NamedEvent extends Event {
  63         @Name("testField")
  64         boolean namedField;
  65 
  66         @SettingDefinition
  67         @Name("name")




  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.MetadataDefinition;
  37 import jdk.jfr.Name;
  38 import jdk.jfr.SettingDefinition;
  39 import jdk.jfr.SettingDescriptor;
  40 import jdk.jfr.ValueDescriptor;
  41 import jdk.test.lib.Asserts;
  42 import jdk.test.lib.jfr.Events;
  43 import jdk.test.lib.jfr.SimpleSetting;
  44 
  45 /**
  46  * @test
  47  * @key jfr
  48  * @requires vm.hasJFR
  49  * @library /test/lib
  50  * @run main/othervm jdk.jfr.api.metadata.annotations.TestName
  51  */
  52 public class TestName {
  53 
  54     @MetadataDefinition
  55     @Name("com.oracle.TestAnnotation")
  56     @Target({ ElementType.TYPE })
  57     @Retention(RetentionPolicy.RUNTIME)
  58     @interface NamedAnnotation {
  59     }
  60 
  61     @NamedAnnotation
  62     @Name("com.oracle.TestEvent")
  63     static class NamedEvent extends Event {
  64         @Name("testField")
  65         boolean namedField;
  66 
  67         @SettingDefinition
  68         @Name("name")


< prev index next >