8182838485868788899091
for (int i = port + 1; i <= maxPort; i++) new SocketId().releasePort(); sid = new SocketId(); sid.releasePort(); assertTrue(sid.getPort() == port + 1); for (int i = port + 2; i <= maxPort; i++) new SocketId().releasePort();
106107108109110111112113114115116
}; TestThread t = new TestThread(); t.start(); assertNull(t.getS()); sid.releasePort(); Thread.sleep(1000); assertTrue(t.getS().getPort() == port + 1); SocketId.setMaxPort(Integer.MAX_VALUE - 1); log.info("testSocketIds() PASSES");