@Before
public void setUp() throws InterruptedException, ExecutionException {
tcphandler = new TcpHandler(0);
- tcphandler.start();
+ new Thread(tcphandler).start();
tcphandler.getIsOnlineFuture().get();
port = tcphandler.getPort();
address = tcphandler.getAddress();
/**
* stop {@link TcpHandler}
+ * @throws ExecutionException
+ * @throws InterruptedException
*/
@After
- public void tearDown() {
- tcphandler.shutdown();
+ public void tearDown() throws InterruptedException, ExecutionException {
+ tcphandler.shutdown().get();
}
/**