@Test public void testConnectEventually() throws Exception { serverSocket.close(); Thread thread = new Thread(); thread.start(); Socket socket = connector.awaitConnection(2 * DELAY); assertNull(socket); Exception lastException = exceptionHandler.awaitConnectionFailed(DELAY); assertTrue(lastException instanceof ConnectException); assertTrue(thread.isAlive()); SocketAddress address = serverSocket.getLocalSocketAddress(); serverSocket = new ServerSocket(); serverSocket.setReuseAddress(true); serverSocket.bind(address); socket = connector.awaitConnection(2 * DELAY); assertNotNull(socket); thread.join(DELAY); assertFalse(thread.isAlive()); socket.close(); }
public Socket awaitConnection() throws InterruptedException { return awaitConnection(Long.MAX_VALUE); }
SocketConnectorBase implements SocketConnector { public Socket awaitConnection() throws InterruptedException { return awaitConnection(Long.MAX_VALUE); } }
SocketConnectorBase implements SocketConnector { public Socket awaitConnection() throws InterruptedException { return awaitConnection(Long.MAX_VALUE); } SocketConnectorBase(InetAddress address, int port,
      int initialDelay, int retryDelay);  SocketConnectorBase(InetAddress address, int port,
      DelayStrategy delayStrategy); }
SocketConnectorBase implements SocketConnector { public Socket awaitConnection() throws InterruptedException { return awaitConnection(Long.MAX_VALUE); } SocketConnectorBase(InetAddress address, int port,
      int initialDelay, int retryDelay);  SocketConnectorBase(InetAddress address, int port,
      DelayStrategy delayStrategy); void run(); Socket awaitConnection(); Socket awaitConnection(long delay); void setExceptionHandler(ExceptionHandler exceptionHandler); void setSocketFactory(SocketFactory socketFactory); Socket call(); }
SocketConnectorBase implements SocketConnector { public Socket awaitConnection() throws InterruptedException { return awaitConnection(Long.MAX_VALUE); } SocketConnectorBase(InetAddress address, int port,
      int initialDelay, int retryDelay);  SocketConnectorBase(InetAddress address, int port,
      DelayStrategy delayStrategy); void run(); Socket awaitConnection(); Socket awaitConnection(long delay); void setExceptionHandler(ExceptionHandler exceptionHandler); void setSocketFactory(SocketFactory socketFactory); Socket call();  }