< prev index next >

test/jdk/jdk/jfr/jvm/TestGetAllEventClasses.java

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


  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  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.jvm;
  27 
  28 import jdk.jfr.Event;
  29 import jdk.jfr.internal.JVM;
  30 
  31 import java.util.List;
  32 
  33 /*
  34  * @test TestGetAllEventClasses
  35  * @key jfr

  36  * @library /test/lib /test/jdk
  37  * @modules jdk.jfr/jdk.jfr.internal
  38  *
  39  * @build jdk.jfr.jvm.HelloWorldEvent1
  40  * @build jdk.jfr.jvm.HelloWorldEvent2
  41  * @run main/othervm jdk.jfr.jvm.TestGetAllEventClasses
  42  */
  43 public class TestGetAllEventClasses {
  44 
  45     public static void main(String... args) throws ClassNotFoundException {
  46         JVM jvm = JVM.getJVM();
  47         // before creating  native
  48         assertEmptyEventList(jvm);
  49         jvm.createNativeJFR();
  50         // after creating native
  51         assertEmptyEventList(jvm);
  52 
  53         // Test event class load is triggered and only once
  54         Class<? extends Event> clazz = initialize("jdk.jfr.jvm.HelloWorldEvent1");
  55         // check that the event class is registered




  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  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.jvm;
  27 
  28 import jdk.jfr.Event;
  29 import jdk.jfr.internal.JVM;
  30 
  31 import java.util.List;
  32 
  33 /**
  34  * @test TestGetAllEventClasses
  35  * @key jfr
  36  * @requires vm.hasJFR
  37  * @library /test/lib /test/jdk
  38  * @modules jdk.jfr/jdk.jfr.internal
  39  *
  40  * @build jdk.jfr.jvm.HelloWorldEvent1
  41  * @build jdk.jfr.jvm.HelloWorldEvent2
  42  * @run main/othervm jdk.jfr.jvm.TestGetAllEventClasses
  43  */
  44 public class TestGetAllEventClasses {
  45 
  46     public static void main(String... args) throws ClassNotFoundException {
  47         JVM jvm = JVM.getJVM();
  48         // before creating  native
  49         assertEmptyEventList(jvm);
  50         jvm.createNativeJFR();
  51         // after creating native
  52         assertEmptyEventList(jvm);
  53 
  54         // Test event class load is triggered and only once
  55         Class<? extends Event> clazz = initialize("jdk.jfr.jvm.HelloWorldEvent1");
  56         // check that the event class is registered


< prev index next >