NO-JIRA stopping object on finalize on openWire test

trying to avoid a few test failure seen on CI
This commit is contained in:
Clebert Suconic 2022-04-29 08:29:39 -04:00
parent 48cd586ac5
commit 1dbbad5582
1 changed files with 23 additions and 16 deletions

View File

@ -37,23 +37,30 @@ public class TcpTransportServerTest extends TestCase {
TcpTransportServer server = (TcpTransportServer) TransportFactory.bind(new URI("tcp://localhost:61616?trace=true"));
server.setTransportOption(new HashMap<String, Object>());
server.setAcceptListener(new TransportAcceptListener() {
@Override
public void onAccept(Transport transport) {
assertTrue("This transport does not have a TransportLogger!!", hasTransportLogger(transport));
try {
server.setAcceptListener(new TransportAcceptListener() {
@Override
public void onAccept(Transport transport) {
assertTrue("This transport does not have a TransportLogger!!", hasTransportLogger(transport));
}
@Override
public void onAcceptError(Exception error) {
fail("Should not have received an error!");
}
});
server.start();
Socket socket = new Socket("localhost", 61616);
server.handleSocket(socket);
} finally {
try {
server.stop();
} catch (Throwable e) {
e.printStackTrace();
}
@Override
public void onAcceptError(Exception error) {
fail("Should not have received an error!");
}
});
server.start();
Socket socket = new Socket("localhost", 61616);
server.handleSocket(socket);
server.stop();
}
}