< prev index next >

test/jdk/jdk/jfr/api/event/TestClonedEvent.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.event;
  27 
  28 import java.util.List;
  29 
  30 import jdk.jfr.Event;
  31 import jdk.jfr.FlightRecorder;
  32 import jdk.jfr.Recording;
  33 import jdk.jfr.Registered;
  34 import jdk.jfr.consumer.RecordedEvent;
  35 import jdk.test.lib.Asserts;
  36 import jdk.test.lib.jfr.Events;
  37 
  38 /*
  39  * @test
  40  * @summary Tests that a cloned event can be successfully committed.
  41  * @key jfr

  42  * @library /test/lib
  43  * @run main/othervm jdk.jfr.api.event.TestClonedEvent
  44  */
  45 
  46 public class TestClonedEvent  {
  47 
  48     public static void main(String[] args) throws Throwable {
  49         Recording r = new Recording();
  50         r.enable(MyEvent.class);
  51 
  52         r.start();
  53 
  54         MyEvent event = new MyEvent();
  55 
  56         MyEvent event2 = (MyEvent)event.clone();
  57 
  58         FlightRecorder.register(MyEvent.class);
  59         event.commit();
  60         event2.commit();
  61 




  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.event;
  27 
  28 import java.util.List;
  29 
  30 import jdk.jfr.Event;
  31 import jdk.jfr.FlightRecorder;
  32 import jdk.jfr.Recording;
  33 import jdk.jfr.Registered;
  34 import jdk.jfr.consumer.RecordedEvent;
  35 import jdk.test.lib.Asserts;
  36 import jdk.test.lib.jfr.Events;
  37 
  38 /**
  39  * @test
  40  * @summary Tests that a cloned event can be successfully committed.
  41  * @key jfr
  42  * @requires vm.hasJFR
  43  * @library /test/lib
  44  * @run main/othervm jdk.jfr.api.event.TestClonedEvent
  45  */
  46 
  47 public class TestClonedEvent  {
  48 
  49     public static void main(String[] args) throws Throwable {
  50         Recording r = new Recording();
  51         r.enable(MyEvent.class);
  52 
  53         r.start();
  54 
  55         MyEvent event = new MyEvent();
  56 
  57         MyEvent event2 = (MyEvent)event.clone();
  58 
  59         FlightRecorder.register(MyEvent.class);
  60         event.commit();
  61         event2.commit();
  62 


< prev index next >