< prev index next >

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

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


  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.api.consumer;
  27 
  28 import jdk.jfr.Recording;
  29 import jdk.jfr.consumer.RecordedEvent;
  30 import jdk.jfr.consumer.RecordedThread;
  31 import jdk.test.lib.Asserts;
  32 import jdk.test.lib.jfr.Events;
  33 import jdk.test.lib.jfr.SimpleEvent;
  34 
  35 /*
  36  * @test
  37  * @summary Tests that chunks are read in order and constant pools from multiple chunks can be read
  38  * @key jfr

  39  * @library /test/lib
  40  * @run main/othervm jdk.jfr.api.consumer.TestRecordingInternals
  41  */
  42 public class TestRecordingInternals {
  43 
  44     public static void main(String[] args) throws Throwable {
  45         try (Recording continuous = new Recording()) {
  46             continuous.start();
  47             for (int i = 0; i < 3; i++) {
  48                 // Each new recording will create a new chunk
  49                 // with a new set of constant pools, i.e.
  50                 // constant pools for threads and thread groups
  51                 createProfilingRecording(i);
  52             }
  53             continuous.stop();
  54             int i = 0;
  55             for (RecordedEvent e : Events.fromRecording(continuous)) {
  56                 Integer id = e.getValue("id");
  57                 RecordedThread rt = e.getThread();
  58                 Asserts.assertEquals(id.toString(), rt.getJavaName(), "Thread name should match id");




  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.api.consumer;
  27 
  28 import jdk.jfr.Recording;
  29 import jdk.jfr.consumer.RecordedEvent;
  30 import jdk.jfr.consumer.RecordedThread;
  31 import jdk.test.lib.Asserts;
  32 import jdk.test.lib.jfr.Events;
  33 import jdk.test.lib.jfr.SimpleEvent;
  34 
  35 /**
  36  * @test
  37  * @summary Tests that chunks are read in order and constant pools from multiple chunks can be read
  38  * @key jfr
  39  * @requires vm.hasJFR
  40  * @library /test/lib
  41  * @run main/othervm jdk.jfr.api.consumer.TestRecordingInternals
  42  */
  43 public class TestRecordingInternals {
  44 
  45     public static void main(String[] args) throws Throwable {
  46         try (Recording continuous = new Recording()) {
  47             continuous.start();
  48             for (int i = 0; i < 3; i++) {
  49                 // Each new recording will create a new chunk
  50                 // with a new set of constant pools, i.e.
  51                 // constant pools for threads and thread groups
  52                 createProfilingRecording(i);
  53             }
  54             continuous.stop();
  55             int i = 0;
  56             for (RecordedEvent e : Events.fromRecording(continuous)) {
  57                 Integer id = e.getValue("id");
  58                 RecordedThread rt = e.getThread();
  59                 Asserts.assertEquals(id.toString(), rt.getJavaName(), "Thread name should match id");


< prev index next >