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) {
    }
  }
}

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 ) { } } }
javax . net . ssl . sslcontextspi # enginecreatesslengine ( string host , int port ) verify exception when sslcontextspi object wasn ' t initialiazed .
