public TestWithNetworkConnections(ClientType clientType) { this.clientType = clientType; if (clientType == ClientType.NIO_CLIENT_MANAGER) channels = new NioClientManager(); else if (clientType == ClientType.BLOCKING_CLIENT_MANAGER) channels = new BlockingClientManager(); else channels = null; }
public NetworkAbstractionTests(Integer clientType) throws Exception { this.clientType = clientType; if (clientType == 0) { channels = new NioClientManager(); channels.startAsync(); } else if (clientType == 1) { channels = new BlockingClientManager(); channels.startAsync(); } else channels = null; }
checkNotNull(torClient); DRMWorkaround.maybeDisableExportControls(); BlockingClientManager manager = new BlockingClientManager(torClient.getSocketFactory()); final int CONNECT_TIMEOUT_MSEC = TOR_TIMEOUT_SECONDS * 1000; manager.setConnectTimeoutMillis(CONNECT_TIMEOUT_MSEC);
checkNotNull(torClient); DRMWorkaround.maybeDisableExportControls(); BlockingClientManager manager = new BlockingClientManager(torClient.getSocketFactory()); final int CONNECT_TIMEOUT_MSEC = TOR_TIMEOUT_SECONDS * 1000; manager.setConnectTimeoutMillis(CONNECT_TIMEOUT_MSEC);
protected void initPeerGroup() { if (clientType == ClientType.NIO_CLIENT_MANAGER) peerGroup = createPeerGroup(new NioClientManager()); else peerGroup = createPeerGroup(new BlockingClientManager()); peerGroup.setPingIntervalMsec(0); // Disable the pings as they just get in the way of most tests. peerGroup.addWallet(wallet); peerGroup.setUseLocalhostPeerWhenPossible(false); // Prevents from connecting to bitcoin nodes on localhost. }