< prev index next >

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

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


  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  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.Event;
  34 import jdk.jfr.EventType;
  35 import jdk.jfr.MetadataDefinition;
  36 
  37 /*
  38  * @test
  39  * @key jfr

  40  * @library /test/lib
  41  * @run main/othervm jdk.jfr.api.metadata.annotations.TestSimpleMetadataEvent
  42  */
  43 public class TestSimpleMetadataEvent {
  44 
  45     @MetadataDefinition
  46     @Target(ElementType.TYPE)
  47     @Retention(RetentionPolicy.RUNTIME)
  48     @interface Severity {
  49         int value() default 50;
  50     }
  51 
  52     @Severity
  53     static class MetadataEvent extends Event {
  54     }
  55 
  56     public static void main(String[] args) throws Exception {
  57         EventType.getEventType(MetadataEvent.class);
  58     }
  59 }


  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  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.Event;
  34 import jdk.jfr.EventType;
  35 import jdk.jfr.MetadataDefinition;
  36 
  37 /**
  38  * @test
  39  * @key jfr
  40  * @requires vm.hasJFR
  41  * @library /test/lib
  42  * @run main/othervm jdk.jfr.api.metadata.annotations.TestSimpleMetadataEvent
  43  */
  44 public class TestSimpleMetadataEvent {
  45 
  46     @MetadataDefinition
  47     @Target(ElementType.TYPE)
  48     @Retention(RetentionPolicy.RUNTIME)
  49     @interface Severity {
  50         int value() default 50;
  51     }
  52 
  53     @Severity
  54     static class MetadataEvent extends Event {
  55     }
  56 
  57     public static void main(String[] args) throws Exception {
  58         EventType.getEventType(MetadataEvent.class);
  59     }
  60 }
< prev index next >