test/jdk/java/net/Socket/asyncClose/AsyncClose.java
branchniosocketimpl-branch
changeset 57358 f0a1d9760c5e
parent 57340 9026cb618cdd
parent 54811 9db7c0f561a6
child 58679 9c3209ff7550
equal deleted inserted replaced
57355:ceb5c3fd71d2 57358:f0a1d9760c5e
    22  */
    22  */
    23 
    23 
    24 import java.util.ArrayList;
    24 import java.util.ArrayList;
    25 import java.util.List;
    25 import java.util.List;
    26 import java.util.concurrent.CompletableFuture;
    26 import java.util.concurrent.CompletableFuture;
       
    27 import jdk.test.lib.net.IPSupport;
    27 import static java.util.concurrent.CompletableFuture.*;
    28 import static java.util.concurrent.CompletableFuture.*;
    28 
    29 
    29 /*
    30 /*
    30  * @test
    31  * @test
    31  * @bug 4344135
    32  * @bug 4344135
       
    33  * @library /test/lib
    32  * @summary Check that {Socket,ServerSocket,DatagramSocket}.close will
    34  * @summary Check that {Socket,ServerSocket,DatagramSocket}.close will
    33  *          cause any thread blocked on the socket to throw a SocketException.
    35  *          cause any thread blocked on the socket to throw a SocketException.
    34  * @run main AsyncClose
    36  * @run main AsyncClose
    35  * @run main/othervm -Djava.net.preferIPv4Stack=true AsyncClose
    37  * @run main/othervm -Djava.net.preferIPv4Stack=true AsyncClose
    36  * @run main/othervm -Djdk.net.usePlainSocketImpl AsyncClose
    38  * @run main/othervm -Djdk.net.usePlainSocketImpl AsyncClose
    37  */
    39  */
    38 
    40 
    39 public class AsyncClose {
    41 public class AsyncClose {
    40 
    42 
    41     public static void main(String args[]) throws Exception {
    43     public static void main(String args[]) throws Exception {
       
    44         IPSupport.throwSkippedExceptionIfNonOperational();
    42 
    45 
    43         AsyncCloseTest tests[] = {
    46         AsyncCloseTest tests[] = {
    44             new Socket_getInputStream_read(),
    47             new Socket_getInputStream_read(),
    45             new Socket_getInputStream_read(20000),
    48             new Socket_getInputStream_read(20000),
    46             new Socket_getOutputStream_write(),
    49             new Socket_getOutputStream_write(),