public void testConstructor_InetAddressI() throws Exception {
  int sport=startServer("Cons InetAddress,I");
  int[] invalidPort={-1,Integer.MIN_VALUE,65536,Integer.MAX_VALUE};
  SSLSocket ssl=getSSLSocket(InetAddress.getLocalHost(),sport);
  assertNotNull(ssl);
  assertEquals(sport,ssl.getPort());
  ssl.close();
  try {
    getSSLSocket(InetAddress.getLocalHost(),sport + 1);
    fail();
  }
 catch (  IOException expected) {
  }
  for (int i=0; i < invalidPort.length; i++) {
    try {
      getSSLSocket(InetAddress.getLocalHost(),invalidPort[i]);
      fail();
    }
 catch (    IllegalArgumentException expected) {
    }
  }
}

public void testConstructor_InetAddressI ( ) throws Exception { int sport = startServer ( "Cons InetAddress,I" ) ; int [ ] invalidPort = { - 1 , Integer . MIN_VALUE , 65536 , Integer . MAX_VALUE } ; SSLSocket ssl = getSSLSocket ( InetAddress . getLocalHost ( ) , sport ) ; assertNotNull ( ssl ) ; assertEquals ( sport , ssl . getPort ( ) ) ; ssl . close ( ) ; try { getSSLSocket ( InetAddress . getLocalHost ( ) , sport + 1 ) ; fail ( ) ; } catch ( IOException expected ) { } for ( int i = 0 ; i < invalidPort . length ; i ++ ) { try { getSSLSocket ( InetAddress . getLocalHost ( ) , invalidPort [ i ] ) ; fail ( ) ; } catch ( IllegalArgumentException expected ) { } } }
javax . net . ssl . sslsocket # sslsocket ( inetaddress address , int port )
