Mercurial > stress-tester
changeset 894:426752705914
bugfixes
author | Devel 1 |
---|---|
date | Fri, 30 Mar 2018 15:09:19 +0200 |
parents | f1ae7ba51a29 |
children | ae83d4c096cd |
files | stress-tester/src/main/java/com/passus/st/CliHelper.java stress-tester/src/main/java/com/passus/st/job/TestJob.java |
diffstat | 2 files changed, 26 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/CliHelper.java Fri Mar 30 11:47:16 2018 +0200 +++ b/stress-tester/src/main/java/com/passus/st/CliHelper.java Fri Mar 30 15:09:19 2018 +0200 @@ -32,7 +32,6 @@ import java.util.Map; import org.apache.commons.cli.CommandLine; -import static com.passus.st.utils.ConfigurationContextConsts.HTTP_FILTERS; import static org.apache.commons.io.FileUtils.openInputStream; import org.apache.commons.io.IOUtils;
--- a/stress-tester/src/main/java/com/passus/st/job/TestJob.java Fri Mar 30 11:47:16 2018 +0200 +++ b/stress-tester/src/main/java/com/passus/st/job/TestJob.java Fri Mar 30 15:09:19 2018 +0200 @@ -4,11 +4,14 @@ import com.passus.config.Configuration; import com.passus.config.ConfigurationContext; import com.passus.config.validation.Errors; +import com.passus.filter.ValueExtractor; import com.passus.st.client.Client; import com.passus.st.client.http.HttpClient; import com.passus.st.client.http.HttpClientListener; import com.passus.st.client.http.HttpSourceNameAwareClientWorkerDispatcher; import com.passus.st.client.http.ReporterDestination; +import com.passus.st.client.http.filter.HttpFilter; +import com.passus.st.client.http.filter.HttpVarsFilter; import com.passus.st.config.TestJobConfigurator; import com.passus.st.emitter.Emitter; import com.passus.st.emitter.PassThroughSessionMapper; @@ -16,6 +19,7 @@ import com.passus.st.metric.MetricSource; import com.passus.st.metric.MetricsCollector; import com.passus.st.source.EventSource; +import com.passus.st.utils.ConfigurationContextConsts; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; @@ -24,6 +28,7 @@ import java.util.List; import static com.passus.st.utils.ConfigurationContextConsts.*; +import java.util.Map; /** * @author Mirosław Hawrot @@ -216,6 +221,27 @@ } }); + Map<String, ValueExtractor> appVars = (Map<String, ValueExtractor>) context.get( + ConfigurationContextConsts.APP_VARS); + if (appVars != null) { + HttpVarsFilter httpVarsFilter = new HttpVarsFilter(appVars); + + List<HttpFilter> filters = (List<HttpFilter>) context.get( + ConfigurationContextConsts.HTTP_FILTERS); + if (filters != null) { + filters.add(httpVarsFilter); + } + + // TODO: czy dodać filtry top-level do klienta??? + + clients.forEach((client) -> { + if (client instanceof HttpClient) { + HttpClient hc = (HttpClient) client; + hc.addFilter(httpVarsFilter); + } + }); + } + } }