< prev index next >

test/jdk/jdk/jfr/api/metadata/valuedescriptor/TestSimpleTypes.java

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


  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.valuedescriptor;
  27 
  28 import java.util.ArrayList;
  29 import java.util.List;
  30 
  31 import jdk.jfr.Description;
  32 import jdk.jfr.Event;
  33 import jdk.jfr.EventType;
  34 import jdk.jfr.BooleanFlag;
  35 import jdk.jfr.Label;
  36 import jdk.jfr.Name;
  37 import jdk.jfr.Percentage;
  38 import jdk.jfr.ValueDescriptor;
  39 import jdk.test.lib.Asserts;
  40 
  41 /*
  42  * @test
  43  * @summary Test all basic types in ValueDescriptor.
  44  * @key jfr

  45  * @library /test/lib
  46  * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestSimpleTypes
  47  */
  48 public class TestSimpleTypes {
  49 
  50     public static void main(String[] args) throws Throwable {
  51         EventType type = EventType.getEventType(MyEvent.class);
  52 
  53         List<String> expectedStrings = new ArrayList<>();
  54         expectedStrings.add("desc=myByteDesc; label=null; name=myByte; typename=byte; contenttype=null");
  55         expectedStrings.add("desc=null; label=myShortLabel; name=myShort; typename=short; contenttype=null");
  56         expectedStrings.add("desc=myIntDesc; label=myIntLabel; name=myInt; typename=int; contenttype=null");
  57         expectedStrings.add("desc=null; label=null; name=myLongName; typename=long; contenttype=null");
  58         expectedStrings.add("desc=myCharDesc; label=myCharLabel; name=myCharName; typename=char; contenttype=null");
  59         expectedStrings.add("desc=null; label=null; name=myFloat; typename=float; contenttype=jdk.jfr.Percentage");
  60         expectedStrings.add("desc=null; label=null; name=myDouble; typename=double; contenttype=null");
  61         expectedStrings.add("desc=null; label=null; name=myBoolean; typename=boolean; contenttype=jdk.jfr.BooleanFlag");
  62         expectedStrings.add("desc=null; label=null; name=myString; typename=java.lang.String; contenttype=null");
  63         expectedStrings.add("desc=null; label=null; name=myClass; typename=java.lang.Class; contenttype=null");
  64         expectedStrings.add("desc=null; label=null; name=myThread; typename=java.lang.Thread; contenttype=null");




  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.valuedescriptor;
  27 
  28 import java.util.ArrayList;
  29 import java.util.List;
  30 
  31 import jdk.jfr.Description;
  32 import jdk.jfr.Event;
  33 import jdk.jfr.EventType;
  34 import jdk.jfr.BooleanFlag;
  35 import jdk.jfr.Label;
  36 import jdk.jfr.Name;
  37 import jdk.jfr.Percentage;
  38 import jdk.jfr.ValueDescriptor;
  39 import jdk.test.lib.Asserts;
  40 
  41 /**
  42  * @test
  43  * @summary Test all basic types in ValueDescriptor.
  44  * @key jfr
  45  * @requires vm.hasJFR
  46  * @library /test/lib
  47  * @run main/othervm jdk.jfr.api.metadata.valuedescriptor.TestSimpleTypes
  48  */
  49 public class TestSimpleTypes {
  50 
  51     public static void main(String[] args) throws Throwable {
  52         EventType type = EventType.getEventType(MyEvent.class);
  53 
  54         List<String> expectedStrings = new ArrayList<>();
  55         expectedStrings.add("desc=myByteDesc; label=null; name=myByte; typename=byte; contenttype=null");
  56         expectedStrings.add("desc=null; label=myShortLabel; name=myShort; typename=short; contenttype=null");
  57         expectedStrings.add("desc=myIntDesc; label=myIntLabel; name=myInt; typename=int; contenttype=null");
  58         expectedStrings.add("desc=null; label=null; name=myLongName; typename=long; contenttype=null");
  59         expectedStrings.add("desc=myCharDesc; label=myCharLabel; name=myCharName; typename=char; contenttype=null");
  60         expectedStrings.add("desc=null; label=null; name=myFloat; typename=float; contenttype=jdk.jfr.Percentage");
  61         expectedStrings.add("desc=null; label=null; name=myDouble; typename=double; contenttype=null");
  62         expectedStrings.add("desc=null; label=null; name=myBoolean; typename=boolean; contenttype=jdk.jfr.BooleanFlag");
  63         expectedStrings.add("desc=null; label=null; name=myString; typename=java.lang.String; contenttype=null");
  64         expectedStrings.add("desc=null; label=null; name=myClass; typename=java.lang.Class; contenttype=null");
  65         expectedStrings.add("desc=null; label=null; name=myThread; typename=java.lang.Thread; contenttype=null");


< prev index next >