@Test public void testConnectorHandlerConnect() throws Exception { LOGGER.log(Level.INFO, "Running: testConnectorHandlerConnect ({0})", transport.getName()); Connection connection = null; try { transport.bind(PORT); transport.start(); Future<Connection> future = transport.connect("localhost", PORT); connection = future.get(10, TimeUnit.SECONDS); assertTrue(connection != null); } finally { if (connection != null) { connection.closeSilently(); } transport.shutdownNow(); } }
@Test public void testStartStopStart() throws Exception { LOGGER.log(Level.INFO, "Running: testStartStopStart ({0})", transport.getName()); try { transport.bind(PORT); transport.start(); Future<Connection> future = transport.connect("localhost", PORT); Connection connection = future.get(10, TimeUnit.SECONDS); assertTrue(connection != null); connection.closeSilently(); transport.shutdownNow(); assertTrue(transport.isStopped()); transport.bind(PORT); transport.start(); assertTrue(!transport.isStopped()); future = transport.connect("localhost", PORT); connection = future.get(10, TimeUnit.SECONDS); assertTrue(connection != null); connection.closeSilently(); } finally { transport.shutdownNow(); } }
transport.connect("localhost", startPort + i); connection = future.get(10, TimeUnit.SECONDS); assertTrue(connection != null);
transport.connect( new InetSocketAddress("localhost", PORT), Futures.toCompletionHandler(
transport.connect( new InetSocketAddress("localhost", PORT), Futures.toCompletionHandler(
transport.connect( new InetSocketAddress("localhost", PORT), Futures.toCompletionHandler(
transport.connect( new InetSocketAddress("localhost", PORT), Futures.toCompletionHandler(
transport.connect( new InetSocketAddress("localhost", PORT), Futures.toCompletionHandler(
transport.connect( new InetSocketAddress("localhost", PORT), Futures.toCompletionHandler(