< prev index next >

test/jdk/jdk/jfr/api/consumer/TestFieldAccess.java

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


  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.consumer;
  27 
  28 import java.util.List;
  29 
  30 import jdk.jfr.Event;
  31 import jdk.jfr.Recording;
  32 import jdk.jfr.consumer.RecordedClass;
  33 import jdk.jfr.consumer.RecordedEvent;
  34 import jdk.jfr.consumer.RecordedThread;
  35 import jdk.test.lib.Asserts;
  36 import jdk.test.lib.jfr.Events;
  37 
  38 /*
  39  * @test
  40  * @key jfr

  41  * @library /test/lib
  42  * @run main/othervm jdk.jfr.api.consumer.TestFieldAccess
  43  */
  44 public class TestFieldAccess {
  45 
  46     private static class MyEvent extends Event {
  47         String stringField = "Hello";
  48         int intField = 4711;
  49         long longField = 4712L;
  50         short shortField = (short)67;
  51         double doubleField = Double.NaN;
  52         float floatField = Float.MIN_VALUE;
  53         boolean booleanField = false;
  54         Thread threadField = Thread.currentThread();
  55         Class<?> classField = MyEvent.class;
  56     }
  57 
  58     public static void main(String[] args) throws Throwable {
  59         try (Recording r = new Recording()) {
  60             r.enable(MyEvent.class);




  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.consumer;
  27 
  28 import java.util.List;
  29 
  30 import jdk.jfr.Event;
  31 import jdk.jfr.Recording;
  32 import jdk.jfr.consumer.RecordedClass;
  33 import jdk.jfr.consumer.RecordedEvent;
  34 import jdk.jfr.consumer.RecordedThread;
  35 import jdk.test.lib.Asserts;
  36 import jdk.test.lib.jfr.Events;
  37 
  38 /**
  39  * @test
  40  * @key jfr
  41  * @requires vm.hasJFR
  42  * @library /test/lib
  43  * @run main/othervm jdk.jfr.api.consumer.TestFieldAccess
  44  */
  45 public class TestFieldAccess {
  46 
  47     private static class MyEvent extends Event {
  48         String stringField = "Hello";
  49         int intField = 4711;
  50         long longField = 4712L;
  51         short shortField = (short)67;
  52         double doubleField = Double.NaN;
  53         float floatField = Float.MIN_VALUE;
  54         boolean booleanField = false;
  55         Thread threadField = Thread.currentThread();
  56         Class<?> classField = MyEvent.class;
  57     }
  58 
  59     public static void main(String[] args) throws Throwable {
  60         try (Recording r = new Recording()) {
  61             r.enable(MyEvent.class);


< prev index next >