Code example for HandshakeCompletedEvent

Methods: getSocket

0
     * @throws IOException 
     * javax.net.ssl.HandshakeCompletedEvent#getSocket() 
     */ 
    public final void test_getSocket() throws IOException { 
        SSLSocket socket = (SSLSocket) SSLSocketFactory.getDefault().createSocket();
        HandshakeCompletedEvent event = new HandshakeCompletedEvent(socket, null);
        SSLSocket ss = event.getSocket();
        assertNotNull(ss);
        assertEquals(socket, ss);
    } 
 
 
    // Regression test for CompletedHandshakeEvent not firing with a custom 
    // TrustManager 
 
 
    SSLSocket socket;
    SSLSocket serverSocket;
    MyHandshakeListener listener;
    int port = Support_PortManager.getNextPort();
    String host = "localhost";