* method testing.
* removeHandshakeCompletedListener( HandshakeCompletedListener listener)
* method testing.
*/
public void testAddRemoveHandshakeCompletedListener() throws Exception {
HandshakeCompletedListener listener =
new HandshakeCompletedListener() {
public void handshakeCompleted(
HandshakeCompletedEvent event) { }
};
SSLSocket socket = createSSLSocket();
socket.addHandshakeCompletedListener(listener);
try {
socket.addHandshakeCompletedListener(null);
fail("Expected IllegalArgumentException was not thrown.");
} catch (IllegalArgumentException e) { }
try {
socket.removeHandshakeCompletedListener(null);
fail("Expected IllegalArgumentException was not thrown.");
} catch (IllegalArgumentException e) { }
try {
socket.removeHandshakeCompletedListener(
new HandshakeCompletedListener() {
public void handshakeCompleted(
HandshakeCompletedEvent event) { }
});
fail("Expected IllegalArgumentException was not thrown.");
} catch (IllegalArgumentException e) { }