PeerGroupTest: Add listeners before calling start()

PeerGroupTest.listener() currently starts the PeerGroup before adding listeners to
it. While the events being listened for are not triggered until later in
the test, it is good practice to add listeners before calling start()
This commit is contained in:
Ross Nicoll 2016-02-13 15:50:27 +00:00 committed by Andreas Schildbach
parent 509df8c232
commit aa33c0e843

View file

@ -108,9 +108,9 @@ public class PeerGroupTest extends TestWithPeerGroup {
@Test @Test
public void listener() throws Exception { public void listener() throws Exception {
peerGroup.start();
peerGroup.addConnectionEventListener(listener); peerGroup.addConnectionEventListener(listener);
peerGroup.addPreMessageReceivedEventListener(preMessageReceivedListener); peerGroup.addPreMessageReceivedEventListener(preMessageReceivedListener);
peerGroup.start();
// Create a couple of peers. // Create a couple of peers.
InboundMessageQueuer p1 = connectPeer(1); InboundMessageQueuer p1 = connectPeer(1);