more better test termination
This commit is contained in:
parent
96f424a383
commit
312c126ba9
|
@ -80,7 +80,8 @@ public class FullServerTest {
|
||||||
super.close(applicationConnectionState);
|
super.close(applicationConnectionState);
|
||||||
applicationClosed.countDown();
|
applicationClosed.countDown();
|
||||||
}
|
}
|
||||||
}; LinkManager clientManager = new LinkManager().setNeedPullData(false)) {
|
}; LinkManager clientManager = new LinkManager().setNeedPullData(false);
|
||||||
|
NetworkConnector networkConnector = new NetworkConnector()) {
|
||||||
int serverPortForControllers = 7001;
|
int serverPortForControllers = 7001;
|
||||||
|
|
||||||
|
|
||||||
|
@ -101,7 +102,7 @@ public class FullServerTest {
|
||||||
};
|
};
|
||||||
|
|
||||||
// start "rusEFI network connector" to connect controller with backend since in real life controller has only local serial port it does not have network
|
// start "rusEFI network connector" to connect controller with backend since in real life controller has only local serial port it does not have network
|
||||||
NetworkConnector.NetworkConnectorResult networkConnectorResult = new NetworkConnector().start(TestHelper.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, networkConnectorContext, NetworkConnector.ReconnectListener.VOID);
|
NetworkConnector.NetworkConnectorResult networkConnectorResult = networkConnector.start(TestHelper.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, networkConnectorContext, NetworkConnector.ReconnectListener.VOID);
|
||||||
ControllerInfo controllerInfo = networkConnectorResult.getControllerInfo();
|
ControllerInfo controllerInfo = networkConnectorResult.getControllerInfo();
|
||||||
|
|
||||||
TestHelper.assertLatch("controllerRegistered", controllerRegistered);
|
TestHelper.assertLatch("controllerRegistered", controllerRegistered);
|
||||||
|
|
|
@ -75,7 +75,8 @@ public class NetworkConnectorTest {
|
||||||
reconnectCounter.countDown();
|
reconnectCounter.countDown();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
new NetworkConnector().start(TestHelper.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, connectorContext, reconnectListener);
|
NetworkConnector networkConnector = new NetworkConnector();
|
||||||
|
networkConnector.start(TestHelper.TEST_TOKEN_1, TestHelper.LOCALHOST + ":" + controllerPort, connectorContext, reconnectListener);
|
||||||
|
|
||||||
assertLatch(reconnectCounter);
|
assertLatch(reconnectCounter);
|
||||||
|
|
||||||
|
@ -89,6 +90,7 @@ public class NetworkConnectorTest {
|
||||||
// now let's do this again with a new backend instance
|
// now let's do this again with a new backend instance
|
||||||
log.info("Second backend instance");
|
log.info("Second backend instance");
|
||||||
assertWouldConnect(serverPortForControllers, httpPort);
|
assertWouldConnect(serverPortForControllers, httpPort);
|
||||||
|
networkConnector.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void assertWouldConnect(int serverPortForControllers, int httpPort) throws InterruptedException {
|
private void assertWouldConnect(int serverPortForControllers, int httpPort) throws InterruptedException {
|
||||||
|
|
Loading…
Reference in New Issue