mirror of
https://github.com/Qortal/altcoinj.git
synced 2025-02-01 07:42:17 +00:00
TestWithPeerGroup: don't stopAsync if the peergroup isn't running and update the class description.
This commit is contained in:
parent
5a8ed59029
commit
34017e16f8
@ -34,7 +34,9 @@ import static com.google.common.base.Preconditions.checkArgument;
|
||||
import static com.google.common.base.Preconditions.checkState;
|
||||
|
||||
/**
|
||||
* Utility class that makes it easy to work with mock NetworkConnections in PeerGroups.
|
||||
* You can derive from this class and call peerGroup.start() in your tests to get a functional PeerGroup that can be
|
||||
* used with loopback peers created using connectPeer. This involves real TCP connections so is a pretty accurate
|
||||
* mock, but means unit tests cannot be run simultaneously.
|
||||
*/
|
||||
public class TestWithPeerGroup extends TestWithNetworkConnections {
|
||||
protected static final NetworkParameters params = UnitTestParams.get();
|
||||
@ -72,7 +74,8 @@ public class TestWithPeerGroup extends TestWithNetworkConnections {
|
||||
super.tearDown();
|
||||
blockJobs = false;
|
||||
Utils.finishMockSleep();
|
||||
peerGroup.stopAsync();
|
||||
if (peerGroup.isRunning())
|
||||
peerGroup.stopAsync();
|
||||
} catch (Exception e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user