Mercurial > stress-tester
changeset 1224:cff85e9bf7a8
FlowUtils - more util methods, SessionPayloadEvent - more contructors
author | Devel 2 |
---|---|
date | Thu, 25 Jun 2020 11:50:54 +0200 |
parents | fedf5100fdd3 |
children | 214d097dd288 |
files | stress-tester/src/main/java/com/passus/st/client/FlowUtils.java stress-tester/src/main/java/com/passus/st/client/SessionPayloadEvent.java |
diffstat | 2 files changed, 36 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/FlowUtils.java Thu Jun 25 11:28:37 2020 +0200 +++ b/stress-tester/src/main/java/com/passus/st/client/FlowUtils.java Thu Jun 25 11:50:54 2020 +0200 @@ -97,6 +97,34 @@ || flowContext.error.code() == CODE_IDE_TIMEOUT); } + public static void queueLastRequestSessionPayload(FlowContext flowContext, byte[] request) { + queueLastRequestSessionPayload(flowContext, request, true); + } + + public static void queueLastRequestSessionPayload(FlowContext flowContext, Object request) { + queueLastRequestSessionPayload(flowContext, request, false); + } + + public static void queueLastRequestSessionPayload(FlowContext flowContext, Object request, boolean raw) { + SessionInfo session = flowContext.session; + SessionPayloadEvent event = new SessionPayloadEvent(session, request, null, raw); + flowContext.queueAddLast(event); + } + + public static void queueFirstRequestSessionPayload(FlowContext flowContext, byte[] request) { + queueFirstRequestSessionPayload(flowContext, request, true); + } + + public static void queueFirstRequestSessionPayload(FlowContext flowContext, Object request) { + queueFirstRequestSessionPayload(flowContext, request, false); + } + + public static void queueFirstRequestSessionPayload(FlowContext flowContext, Object request, boolean raw) { + SessionInfo session = flowContext.session; + SessionPayloadEvent event = new SessionPayloadEvent(session, request, null, raw); + flowContext.queueAddFirst(event); + } + public static boolean checkMayConnectIfPartial(FlowContext flowContext, boolean connectPartialSession) { return connectPartialSession && !flowContext.sessionEstablishedSeen
--- a/stress-tester/src/main/java/com/passus/st/client/SessionPayloadEvent.java Thu Jun 25 11:28:37 2020 +0200 +++ b/stress-tester/src/main/java/com/passus/st/client/SessionPayloadEvent.java Thu Jun 25 11:50:54 2020 +0200 @@ -21,6 +21,14 @@ private final boolean raw; + public SessionPayloadEvent(SessionInfo sessionInfo, R request, S response) { + this(sessionInfo, request, response, sessionInfo.getProtocolId(), sessionInfo.getSourceName(), false); + } + + public SessionPayloadEvent(SessionInfo sessionInfo, R request, S response, boolean raw) { + this(sessionInfo, request, response, sessionInfo.getProtocolId(), sessionInfo.getSourceName(), raw); + } + public SessionPayloadEvent(SessionInfo sessionInfo, R request, S response, int protocolId, String sourceName) { this(sessionInfo, request, response, protocolId, sourceName, false); }