question: public void test_engineCreateSSLEngine_02 ( ) { int [ ] invalid_port = { Integer . MIN_VALUE , - 65535 , - 1 , 65536 , Integer . MAX_VALUE } ; SSLContextSpiImpl ssl = new SSLContextSpiImpl ( ) ; try { SSLEngine sleng = ssl . engineCreateSSLEngine ( "localhost" , 1080 ) ; fail ( "RuntimeException wasn't thrown" ) ; } catch ( RuntimeException re ) { String str = re . getMessage ( ) ; if ( ! str . equals ( "Not initialiazed" ) ) fail ( "Incorrect exception message: " + str ) ; } catch ( Exception e ) { fail ( "Incorrect exception " + e + " was thrown" ) ; } for ( int i = 0 ; i < invalid_port . length ; i ++ ) { try { SSLEngine sleng = ssl . engineCreateSSLEngine ( "localhost" , invalid_port [ i ] ) ; fail ( "IllegalArgumentException wasn't thrown" ) ; } catch ( IllegalArgumentException iae ) { } } }
target:  javax.net.ssl.SSLContextSpi#engineCreateSSLEngine(String host, int port) Verify exception when SSLContextSpi object wasn't initialiazed.