Fixes, improved tests and other improvements

This commit is contained in:
2016-07-29 07:49:53 +02:00
parent 56ebb7b8fa
commit 334a510743
10 changed files with 99 additions and 93 deletions

View File

@ -169,15 +169,24 @@ public class NetworkHandlerTest {
} while (networkHandler.isRunning());
}
@Test
public void ensureNodesAreConnecting() throws Exception {
node.startup();
private Property waitForNetworkStatus(BitmessageContext ctx) throws InterruptedException {
Property status;
do {
Thread.sleep(100);
status = node.status().getProperty("network", "connections", "stream 0");
status = ctx.status().getProperty("network", "connections", "stream 1");
} while (status == null);
assertEquals(1, status.getProperty("outgoing").getValue());
return status;
}
@Test
public void ensureNodesAreConnecting() throws Exception {
node.startup();
Property nodeStatus = waitForNetworkStatus(node);
Property peerStatus = waitForNetworkStatus(peer);
assertEquals(1, nodeStatus.getProperty("outgoing").getValue());
assertEquals(1, peerStatus.getProperty("incoming").getValue());
}
@Test