< prev index next >

test/jdk/jdk/jfr/event/io/TestSocketEvents.java

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


  25 
  26 package jdk.jfr.event.io;
  27 
  28 import static jdk.test.lib.Asserts.assertEquals;
  29 
  30 import java.io.IOException;
  31 import java.io.InputStream;
  32 import java.io.OutputStream;
  33 import java.net.ServerSocket;
  34 import java.net.Socket;
  35 import java.time.Duration;
  36 import java.util.ArrayList;
  37 import java.util.List;
  38 
  39 import jdk.jfr.Recording;
  40 import jdk.jfr.consumer.RecordedEvent;
  41 import jdk.test.lib.jfr.Events;
  42 import jdk.test.lib.thread.TestThread;
  43 import jdk.test.lib.thread.XRun;
  44 
  45 /*
  46  * @test
  47  * @key jfr

  48  * @library /test/lib /test/jdk
  49  * @run main/othervm jdk.jfr.event.io.TestSocketEvents
  50  */
  51 public class TestSocketEvents {
  52 
  53     private static final int writeInt = 'A';
  54     private static final byte[] writeBuf = { 'B', 'C', 'D', 'E' };
  55 
  56     private List<IOEvent> expectedEvents = new ArrayList<>();
  57     private synchronized void addExpectedEvent(IOEvent event) {
  58         expectedEvents.add(event);
  59     }
  60 
  61     public static void main(String[] args) throws Throwable {
  62         new TestSocketEvents().test();
  63     }
  64 
  65     private void test() throws Throwable {
  66         Recording recording = new Recording();
  67 




  25 
  26 package jdk.jfr.event.io;
  27 
  28 import static jdk.test.lib.Asserts.assertEquals;
  29 
  30 import java.io.IOException;
  31 import java.io.InputStream;
  32 import java.io.OutputStream;
  33 import java.net.ServerSocket;
  34 import java.net.Socket;
  35 import java.time.Duration;
  36 import java.util.ArrayList;
  37 import java.util.List;
  38 
  39 import jdk.jfr.Recording;
  40 import jdk.jfr.consumer.RecordedEvent;
  41 import jdk.test.lib.jfr.Events;
  42 import jdk.test.lib.thread.TestThread;
  43 import jdk.test.lib.thread.XRun;
  44 
  45 /**
  46  * @test
  47  * @key jfr
  48  * @requires vm.hasJFR
  49  * @library /test/lib /test/jdk
  50  * @run main/othervm jdk.jfr.event.io.TestSocketEvents
  51  */
  52 public class TestSocketEvents {
  53 
  54     private static final int writeInt = 'A';
  55     private static final byte[] writeBuf = { 'B', 'C', 'D', 'E' };
  56 
  57     private List<IOEvent> expectedEvents = new ArrayList<>();
  58     private synchronized void addExpectedEvent(IOEvent event) {
  59         expectedEvents.add(event);
  60     }
  61 
  62     public static void main(String[] args) throws Throwable {
  63         new TestSocketEvents().test();
  64     }
  65 
  66     private void test() throws Throwable {
  67         Recording recording = new Recording();
  68 


< prev index next >