< prev index next >

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

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


  24  */
  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.nio.ByteBuffer;
  32 import java.nio.channels.ServerSocketChannel;
  33 import java.nio.channels.SocketChannel;
  34 import java.time.Duration;
  35 import java.util.ArrayList;
  36 import java.util.List;
  37 
  38 import jdk.jfr.Recording;
  39 import jdk.jfr.consumer.RecordedEvent;
  40 import jdk.test.lib.jfr.Events;
  41 import jdk.test.lib.thread.TestThread;
  42 import jdk.test.lib.thread.XRun;
  43 
  44 /*
  45  * @test
  46  * @key jfr

  47  * @library /test/lib /test/jdk
  48  * @run main/othervm jdk.jfr.event.io.TestSocketChannelEvents
  49  */
  50 public class TestSocketChannelEvents {
  51     private static final int bufSizeA = 10;
  52     private static final int bufSizeB = 20;
  53 
  54     private List<IOEvent> expectedEvents = new ArrayList<>();
  55     private synchronized void addExpectedEvent(IOEvent event) {
  56         expectedEvents.add(event);
  57     }
  58 
  59     public static void main(String[] args) throws Throwable {
  60         new TestSocketChannelEvents().test();
  61     }
  62 
  63     public void test() throws Throwable {
  64         Recording recording = new Recording();
  65 
  66         try (ServerSocketChannel ss = ServerSocketChannel.open()) {




  24  */
  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.nio.ByteBuffer;
  32 import java.nio.channels.ServerSocketChannel;
  33 import java.nio.channels.SocketChannel;
  34 import java.time.Duration;
  35 import java.util.ArrayList;
  36 import java.util.List;
  37 
  38 import jdk.jfr.Recording;
  39 import jdk.jfr.consumer.RecordedEvent;
  40 import jdk.test.lib.jfr.Events;
  41 import jdk.test.lib.thread.TestThread;
  42 import jdk.test.lib.thread.XRun;
  43 
  44 /**
  45  * @test
  46  * @key jfr
  47  * @requires vm.hasJFR
  48  * @library /test/lib /test/jdk
  49  * @run main/othervm jdk.jfr.event.io.TestSocketChannelEvents
  50  */
  51 public class TestSocketChannelEvents {
  52     private static final int bufSizeA = 10;
  53     private static final int bufSizeB = 20;
  54 
  55     private List<IOEvent> expectedEvents = new ArrayList<>();
  56     private synchronized void addExpectedEvent(IOEvent event) {
  57         expectedEvents.add(event);
  58     }
  59 
  60     public static void main(String[] args) throws Throwable {
  61         new TestSocketChannelEvents().test();
  62     }
  63 
  64     public void test() throws Throwable {
  65         Recording recording = new Recording();
  66 
  67         try (ServerSocketChannel ss = ServerSocketChannel.open()) {


< prev index next >