test/jdk/java/net/SocketImpl/SocketImplCombinations.java
branchniosocketimpl-branch
changeset 57281 c08d024d6bf9
parent 57268 adcdd45830a0
child 58678 9cf78a70fa4f
equal deleted inserted replaced
57280:a458758d1a63 57281:c08d024d6bf9
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8220493
    26  * @bug 8220493
    27  * @modules java.base/java.net:+open java.base/sun.nio.ch:+open
    27  * @modules java.base/java.net:+open java.base/sun.nio.ch:+open
    28  * @run testng/othervm SocketImplCombinations
    28  * @run testng/othervm SocketImplCombinations
    29  * @run testng/othervm -Djdk.net.usePlainSocketImpl SocketImplCombinations
       
    30  * @summary Test Socket and ServerSocket with combinations of SocketImpls
    29  * @summary Test Socket and ServerSocket with combinations of SocketImpls
    31  */
    30  */
    32 
    31 
    33 import java.io.FileDescriptor;
    32 import java.io.FileDescriptor;
    34 import java.io.IOException;
    33 import java.io.IOException;
   381         try (ServerSocket ss = new ServerSocket(serverImpl) { }) {
   380         try (ServerSocket ss = new ServerSocket(serverImpl) { }) {
   382             ss.bind(new InetSocketAddress(0));
   381             ss.bind(new InetSocketAddress(0));
   383             expectThrows(IOException.class, ss::accept);
   382             expectThrows(IOException.class, ss::accept);
   384         }
   383         }
   385     }
   384     }
   386     
   385 
   387     public void testServerSocketAccept5b() throws IOException {
   386     public void testServerSocketAccept5b() throws IOException {
   388         var socket = new Socket((SocketImpl) null) { };
   387         var socket = new Socket((SocketImpl) null) { };
   389         assertTrue(getSocketImpl(socket) == null);
   388         assertTrue(getSocketImpl(socket) == null);
   390 
   389 
   391         SocketImpl serverImpl = new CustomSocketImpl(true);
   390         SocketImpl serverImpl = new CustomSocketImpl(true);