< prev index next >

test/jdk/jdk/jfr/api/metadata/settingdescriptor/TestGetAnnotationElement.java

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


  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 package jdk.jfr.api.metadata.settingdescriptor;
  26 
  27 import java.util.List;
  28 
  29 import jdk.jfr.AnnotationElement;
  30 import jdk.jfr.Description;
  31 import jdk.jfr.EventType;
  32 import jdk.jfr.Label;
  33 import jdk.jfr.Name;
  34 import jdk.jfr.SettingDescriptor;
  35 import jdk.jfr.Timespan;
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.jfr.Events;
  38 
  39 /*
  40  * @test
  41  * @summary Test SettingDescriptor.getAnnotationElements()
  42  * @key jfr

  43  * @library /test/lib /test/jdk
  44  * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetAnnotationElement
  45  */
  46 public class TestGetAnnotationElement {
  47 
  48     public static void main(String[] args) throws Exception {
  49         EventType type = EventType.getEventType(CustomEvent.class);
  50 
  51         SettingDescriptor plain = Events.getSetting(type, "plain");
  52         Asserts.assertTrue(plain.getAnnotationElements().isEmpty());
  53 
  54         SettingDescriptor annotatedType = Events.getSetting(type, "annotatedType");
  55         for (AnnotationElement ae : annotatedType.getAnnotationElements()) {
  56             System.out.println(ae.getTypeName());
  57         }
  58         Asserts.assertTrue(annotatedType.getAnnotationElements().isEmpty());
  59 
  60         SettingDescriptor newName = Events.getSetting(type, "newName");
  61         List<AnnotationElement> ae = newName.getAnnotationElements();
  62         Asserts.assertEquals(ae.size(), 4);




  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 package jdk.jfr.api.metadata.settingdescriptor;
  26 
  27 import java.util.List;
  28 
  29 import jdk.jfr.AnnotationElement;
  30 import jdk.jfr.Description;
  31 import jdk.jfr.EventType;
  32 import jdk.jfr.Label;
  33 import jdk.jfr.Name;
  34 import jdk.jfr.SettingDescriptor;
  35 import jdk.jfr.Timespan;
  36 import jdk.test.lib.Asserts;
  37 import jdk.test.lib.jfr.Events;
  38 
  39 /**
  40  * @test
  41  * @summary Test SettingDescriptor.getAnnotationElements()
  42  * @key jfr
  43  * @requires vm.hasJFR
  44  * @library /test/lib /test/jdk
  45  * @run main/othervm jdk.jfr.api.metadata.settingdescriptor.TestGetAnnotationElement
  46  */
  47 public class TestGetAnnotationElement {
  48 
  49     public static void main(String[] args) throws Exception {
  50         EventType type = EventType.getEventType(CustomEvent.class);
  51 
  52         SettingDescriptor plain = Events.getSetting(type, "plain");
  53         Asserts.assertTrue(plain.getAnnotationElements().isEmpty());
  54 
  55         SettingDescriptor annotatedType = Events.getSetting(type, "annotatedType");
  56         for (AnnotationElement ae : annotatedType.getAnnotationElements()) {
  57             System.out.println(ae.getTypeName());
  58         }
  59         Asserts.assertTrue(annotatedType.getAnnotationElements().isEmpty());
  60 
  61         SettingDescriptor newName = Events.getSetting(type, "newName");
  62         List<AnnotationElement> ae = newName.getAnnotationElements();
  63         Asserts.assertEquals(ae.size(), 4);


< prev index next >