Skip to content
Snippets Groups Projects
Commit 894c95df authored by terry-norbraten's avatar terry-norbraten
Browse files

pdu dup checking

parent f5a8323c
No related branches found
No related tags found
No related merge requests found
......@@ -144,7 +144,7 @@ public class AllPduRoundTripTest
pdusSent.forEach(p -> {
disnetworking.send(p);
sleep(1l); // give receiver time to process
sleep(5l); // give receiver time to process
});
shutDownSenderRecorder();
......@@ -169,23 +169,24 @@ public class AllPduRoundTripTest
assertNull(ex, "Exception should be null if successful creation of all objects");
}
private void setupSenderRecorder() throws Exception
{
recorder = new PduRecorder(); // default mcaddr, port, logfile dir
disnetworking = recorder.getDisThreadedNetIF();
// When the DisThreadedNetIF receives a pdu, a call is made to the
// everyTypeListeners which makes a lamba call back here to capture received
// pdus
lis = new DisThreadedNetIF.PduListener() {
@Override
public void incomingPdu(Pdu pdu) {
pdusReceived.add(pdu);
}
};
disnetworking.addListener(lis);
System.out.println("Recorder log at " + recorder.getLogFile());
}
private void setupSenderRecorder() throws Exception {
recorder = new PduRecorder(); // default mcaddr, port, logfile dir
disnetworking = recorder.getDisThreadedNetIF();
// When the DisThreadedNetIF receives a pdu, a call is made to the
// everyTypeListeners which makes a lamba call back here to capture received
// pdus
lis = new DisThreadedNetIF.PduListener() {
@Override
public void incomingPdu(Pdu pdu) {
if (!pdusReceived.contains(pdu)) {
pdusReceived.add(pdu);
}
}
};
disnetworking.addListener(lis);
System.out.println("Recorder log at " + recorder.getLogFile());
}
/** Will shutdown the common send/receive network interface */
private void shutDownSenderRecorder() throws Exception
......
......@@ -82,7 +82,7 @@ public class SignalPdusTest {
sentPdus.forEach(p -> {
netif.send(p);
sleep(10l); // give receiver time to process
sleep(5l); // give receiver time to process
});
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment