changeset 1172:0e280ef89e8e

SynchFlowWorker bugfix
author Devel 2
date Tue, 16 Jun 2020 15:57:21 +0200
parents 0fc158f0ca19
children 00b81be47b1c
files stress-tester/src/main/java/com/passus/st/client/SynchFlowWorker.java
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/SynchFlowWorker.java	Tue Jun 16 15:57:01 2020 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/SynchFlowWorker.java	Tue Jun 16 15:57:21 2020 +0200
@@ -16,8 +16,7 @@
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.LinkedBlockingDeque;
 
-import static com.passus.st.client.FlowContext.STATE_CONNECTED;
-import static com.passus.st.client.FlowContext.STATE_DISCONNECTED;
+import static com.passus.st.client.FlowContext.*;
 import static com.passus.st.client.FlowExecutor.SLEEP_FACTOR_NO_SLEEP;
 import static com.passus.st.client.FlowUtils.*;
 
@@ -157,7 +156,15 @@
                 return flowContext;
             }
 
-            throw new RuntimeException("Not implemented yet.");
+            if (flowContext.state == STATE_CONNECTED) {
+                return flowContext;
+            } else if (flowContext.state == STATE_DISCONNECTED
+                    || flowContext.state == STATE_DISCONNECTING
+                    || flowContext.state == STATE_ERROR) {
+                flowContext = register(session);
+            } else {
+                throw new RuntimeException("Invalid session state '" + stateToString(flowContext.state) + "'.");
+            }
         } else {
             flowContext = register(session);
         }