Mercurial > stress-tester
changeset 929:bc5dbd2db8c9
minor
author | Devel 1 |
---|---|
date | Fri, 27 Apr 2018 16:02:48 +0200 |
parents | c5435062adb3 |
children | b65a8ddf4f12 |
files | stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationOperations.java |
diffstat | 1 files changed, 22 insertions(+), 28 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationOperations.java Fri Apr 27 15:33:13 2018 +0200 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationOperations.java Fri Apr 27 16:02:48 2018 +0200 @@ -22,29 +22,25 @@ private static final Logger LOGGER = LogManager.getLogger(HttpMessageModificationFilter.class); - public abstract static class Operation { + static CharSequence extractValue(ValueExtractor extractor, HttpRequest req, HttpResponse resp, HttpFlowContext context) { + Object value = HttpFiltersUtils.extractValue(extractor, req, resp, context); + if (value instanceof CharSequence) { + if (LOGGER.isDebugEnabled()) { + LOGGER.debug("extractor={} extracted={}", extractor, value); + } - private Operation() { + return (CharSequence) value; } + return null; + } + + public static interface Operation { + public abstract void process(HttpRequest req, HttpResponse resp, HttpFlowContext context); - - protected final CharSequence extractValue(ValueExtractor extractor, HttpRequest req, HttpResponse resp, HttpFlowContext context) { - Object value = HttpFiltersUtils.extractValue(extractor, req, resp, context); - if (value instanceof CharSequence) { - if (LOGGER.isDebugEnabled()) { - LOGGER.debug("extractor={} extracted={}", extractor, value); - } - - return (CharSequence) value; - } - - return null; - } - } - protected static abstract class AbstractRemoveOperation extends Operation { + protected static abstract class AbstractRemoveOperation implements Operation { protected final ValueExtractor nameExtractor; @@ -73,7 +69,7 @@ } - protected static abstract class AbstractNameValueOperation extends Operation { + protected static abstract class AbstractNameValueOperation implements Operation { protected final ByteString name; @@ -312,7 +308,7 @@ } - protected static abstract class AddParamOperation extends Operation { + protected static abstract class AddParamOperation implements Operation { protected final ByteString name; @@ -517,7 +513,7 @@ } - public static class ContentOperation extends Operation { + public static class ContentOperation implements Operation { private final ContentReplacer replacer; @@ -545,7 +541,7 @@ } - public static class SetMethodOperation extends Operation { + public static class SetMethodOperation implements Operation { private final HttpMethod method; @@ -563,7 +559,7 @@ } } - public static class SetVersionOperation extends Operation { + public static class SetVersionOperation implements Operation { private final ByteString version; @@ -581,7 +577,7 @@ } } - public static class SetUriOperation extends Operation { + public static class SetUriOperation implements Operation { private final CharSequence uri; @@ -595,7 +591,7 @@ } } - public static abstract class SetUrlPartOperation extends Operation { + public static abstract class SetUrlPartOperation implements Operation { @Override public void process(HttpRequest req, HttpResponse resp, HttpFlowContext context) { @@ -658,7 +654,7 @@ } } - public static class SetUrlPathPos extends Operation { + public static class SetUrlPathPos implements Operation { private final ValueExtractor valueExtractor; private final int index; @@ -704,9 +700,7 @@ } } - public static class SetUrlPathRegex extends Operation { - - private static final String PATH_ELEMENT_DELIMITER = "/"; + public static class SetUrlPathRegex implements Operation { private final ValueExtractor valueExtractor; private final RegexValueExtractor regexReplacer;