test/jdk/java/net/SocketInputStream/SocketClosedException.java
changeset 54770 62b6e7587b1f
parent 49431 5812849b5027
child 54811 9db7c0f561a6
equal deleted inserted replaced
54769:925ee7a89325 54770:62b6e7587b1f
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 4681556
    26  * @bug 4681556
       
    27  * @library /test/lib
    27  * @summary Wrong text if a read is performed on a socket after it
    28  * @summary Wrong text if a read is performed on a socket after it
    28  *      has been closed
    29  *      has been closed
    29  * @run main SocketClosedException
    30  * @run main SocketClosedException
    30  * @run main/othervm -Djava.net.preferIPv4Stack=true SocketClosedException
    31  * @run main/othervm -Djava.net.preferIPv4Stack=true SocketClosedException
    31  */
    32  */
    32 
    33 
    33 import java.io.*;
    34 import java.io.*;
    34 import java.net.*;
    35 import java.net.*;
       
    36 import jdk.test.lib.net.IPSupport;
    35 
    37 
    36 public class SocketClosedException {
    38 public class SocketClosedException {
    37     static void doServerSide() throws Exception {
    39     static void doServerSide() throws Exception {
    38         try {
    40         try {
    39             Socket socket = serverSocket.accept();
    41             Socket socket = serverSocket.accept();
    59 
    61 
    60     static ServerSocket serverSocket;
    62     static ServerSocket serverSocket;
    61     static Exception serverException = null;
    63     static Exception serverException = null;
    62 
    64 
    63     public static void main(String[] args) throws Exception {
    65     public static void main(String[] args) throws Exception {
       
    66         IPSupport.skipIfCurrentConfigurationIsInvalid();
    64         serverSocket = new ServerSocket(0);
    67         serverSocket = new ServerSocket(0);
    65         startServer();
    68         startServer();
    66         try {
    69         try {
    67             doClientSide(serverSocket.getLocalPort());
    70             doClientSide(serverSocket.getLocalPort());
    68         } catch (SocketException e) {
    71         } catch (SocketException e) {