changeset 974:e3532e4a84fe

PcapSessionEventSource - bugfix
author Devel 2
date Wed, 24 Jul 2019 14:43:40 +0200
parents 641a1a8bcb12
children 1d6458a1c1da
files stress-tester/src/main/java/com/passus/st/source/PcapSessionEventSource.java stress-tester/src/test/java/com/passus/st/source/PcapSessionEventSourceTest.java
diffstat 2 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/source/PcapSessionEventSource.java	Wed Jul 24 14:19:28 2019 +0200
+++ b/stress-tester/src/main/java/com/passus/st/source/PcapSessionEventSource.java	Wed Jul 24 14:43:40 2019 +0200
@@ -462,6 +462,7 @@
 
         public void onLoopEnd() {
             tcpProc.closeAllSessions();
+            udpProc.closeAllSessions();
             eventHandler.flush();
         }
 
--- a/stress-tester/src/test/java/com/passus/st/source/PcapSessionEventSourceTest.java	Wed Jul 24 14:19:28 2019 +0200
+++ b/stress-tester/src/test/java/com/passus/st/source/PcapSessionEventSourceTest.java	Wed Jul 24 14:43:40 2019 +0200
@@ -97,11 +97,13 @@
         src.stop();
 
         Iterator<Event> it = handler.getEvents().iterator();
+        assertTrue(it.next() instanceof SessionStatusEvent);
+
         SessionPayloadEvent payloadEvent = (SessionPayloadEvent) it.next();
-
         assertTrue(payloadEvent.getRequest() instanceof Dns);
         assertTrue(payloadEvent.getResponse() instanceof Dns);
 
+        assertTrue(it.next() instanceof SessionStatusEvent);
         assertTrue(it.next() instanceof DataLoopEnd);
         assertTrue(it.next() instanceof DataEnd);
     }