Synchronisation API and related refactorings / improvements

-> lets you synchronize with the Bitmessage network without staying connected
This commit is contained in:
2015-10-07 21:50:41 +02:00
parent c3fdee79ca
commit f9ff22bebe
13 changed files with 154 additions and 49 deletions

View File

@ -55,8 +55,9 @@ public class NetworkHandlerTest {
.nodeRegistry(new TestNodeRegistry())
.networkHandler(new DefaultNetworkHandler())
.security(new BouncySecurity())
.listener(Mockito.mock(BitmessageContext.Listener.class))
.build();
peer.startup(Mockito.mock(BitmessageContext.Listener.class));
peer.startup();
nodeInventory = new TestInventory();
networkHandler = new DefaultNetworkHandler();
@ -68,13 +69,14 @@ public class NetworkHandlerTest {
.nodeRegistry(new TestNodeRegistry(localhost))
.networkHandler(networkHandler)
.security(new BouncySecurity())
.listener(Mockito.mock(BitmessageContext.Listener.class))
.build();
}
@Test(timeout = 20_000)
public void ensureNodesAreConnecting() {
try {
node.startup(Mockito.mock(BitmessageContext.Listener.class));
node.startup();
Property status;
do {
Thread.yield();