Mercurial > stress-tester
changeset 854:b680a2485161
Configurable.configure(Configuration config, ConfigurationContext context)
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/Main.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/Main.java Wed Jan 24 08:29:58 2018 +0100 @@ -36,6 +36,7 @@ private final CliHelper cliHelper = new CliHelper(); private final SummaryMetricsCollectionHandler summMetricsHandler = new SummaryMetricsCollectionHandler(); + private long startTime; static void printHelp(Options options) {
--- a/stress-tester/src/main/java/com/passus/st/client/credentials/CsvUsernamePasswordCredentialsProvider.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/credentials/CsvUsernamePasswordCredentialsProvider.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,11 +2,10 @@ import com.opencsv.CSVReader; import com.passus.commons.Assert; -import com.passus.commons.ConversionException; import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.StringToEnumValueTransformer; -import com.passus.config.ValueTransformer; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; @@ -114,7 +113,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { fileName = config.getString("fileName"); readMode = convertReadMode(config.get("readMode")); separator = config.getString("separator", "" + DEFAULT_SEPARATOR).charAt(0);
--- a/stress-tester/src/main/java/com/passus/st/client/credentials/MultiCredentialsProvider.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/credentials/MultiCredentialsProvider.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,7 +2,8 @@ import com.passus.commons.Assert; import com.passus.config.Configuration; -import static com.passus.st.client.credentials.UsernamePasswordCredentialsProvider.TYPE; +import com.passus.config.ConfigurationContext; + import java.util.List; /** @@ -44,7 +45,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { }
--- a/stress-tester/src/main/java/com/passus/st/client/credentials/MultiCredentialsProviderTransformer.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/credentials/MultiCredentialsProviderTransformer.java Wed Jan 24 08:29:58 2018 +0100 @@ -50,7 +50,7 @@ errors.popNestedPath(); } - provider.configure(new ConfigurationImpl(configNode)); + provider.configure(new ConfigurationImpl(configNode), null); providers.add(provider); }
--- a/stress-tester/src/main/java/com/passus/st/client/credentials/SingleCredentialsProvider.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/credentials/SingleCredentialsProvider.java Wed Jan 24 08:29:58 2018 +0100 @@ -1,6 +1,7 @@ package com.passus.st.client.credentials; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; /** * @@ -31,7 +32,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { } }
--- a/stress-tester/src/main/java/com/passus/st/client/credentials/UsernamePasswordCredentialsProvider.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/credentials/UsernamePasswordCredentialsProvider.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.*; import com.passus.config.schema.NodeDefinition; @@ -57,7 +58,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { username = (String) config.get("username"); password = (String) config.get("password", ""); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/HttpClient.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/HttpClient.java Wed Jan 24 08:29:58 2018 +0100 @@ -4,6 +4,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.commons.service.ServiceException; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import com.passus.config.schema.NodeDefinition; import com.passus.config.schema.NodeDefinitionCreator; @@ -23,9 +24,8 @@ import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.valueDefInteger; import static com.passus.config.schema.ConfigurationSchemaBuilder.valueDefBool; -import com.passus.config.schema.DynaKeyValueVaryListNodeDefinition; + import com.passus.config.validation.LongValidator; -import com.passus.st.client.http.filter.HttpFilterFactory; import com.passus.st.client.http.filter.HttpFiltersNodeDefinitionCreator; import java.util.Collection; import java.util.Collections; @@ -199,7 +199,7 @@ @SuppressWarnings("unchecked") @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { setFilters((List<HttpFilter>) config.get("filters", Collections.EMPTY_LIST)); setWorkersNum(config.getInteger("workers", DEFAULT_WORKERS_NUM)); connectPartialSession = config.getBoolean("connectPartialSession", DEFAULT_CONNECT_PARTIAL_SESSION);
--- a/stress-tester/src/main/java/com/passus/st/client/http/ReporterConfigurator.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/ReporterConfigurator.java Wed Jan 24 08:29:58 2018 +0100 @@ -39,7 +39,7 @@ boolean active = config.getBoolean("active", true); if (active) { ReporterRemoteDestination remote = new ReporterRemoteDestination(); - remote.configure(config); + remote.configure(config, null); context.add(REPORTER_DEFAULT_DESTINATION, remote); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/ReporterDestination.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/ReporterDestination.java Wed Jan 24 08:29:58 2018 +0100 @@ -3,6 +3,7 @@ import com.passus.commons.service.Service; import com.passus.config.Configurable; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.data.ByteString; import com.passus.net.http.HttpHeaders; import com.passus.net.http.HttpMessage; @@ -30,7 +31,7 @@ )); @Override - public default void configure(Configuration config) { + public default void configure(Configuration config, ConfigurationContext context) { }
--- a/stress-tester/src/main/java/com/passus/st/client/http/ReporterFileDestination.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/ReporterFileDestination.java Wed Jan 24 08:29:58 2018 +0100 @@ -7,6 +7,7 @@ import com.passus.commons.metric.MetricsCollection; import com.passus.commons.service.ServiceException; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import com.passus.config.schema.NodeDefinition; import com.passus.config.schema.NodeDefinitionCreator; @@ -109,7 +110,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { setDirectory(config.getString("directory")); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/ReporterRemoteDestination.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/ReporterRemoteDestination.java Wed Jan 24 08:29:58 2018 +0100 @@ -6,6 +6,7 @@ import com.passus.commons.metric.MetricsCollection; import com.passus.commons.service.ServiceException; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import com.passus.config.schema.NodeDefinition; import com.passus.config.schema.NodeDefinitionCreator; @@ -101,7 +102,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { setHost(config.getString("host", SocketReporterClient.DEFAULT_HOST)); setPort(config.getInteger("port", SocketReporterClient.DEFAULT_PORT)); setThreads(config.getInteger("threads", SocketReporterClient.DEFAULT_THREADS));
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpAbstractLoginFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpAbstractLoginFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.plugin.PluginInfo; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; @@ -55,7 +56,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { predicate = (HttpMessagePredicate) config.get("applyIf"); credentialsProvider = (CredentialsProvider) config.get("provider", null); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCounterFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCounterFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; @@ -68,7 +69,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { predicate = (HttpMessagePredicate) config.get("applyIf"); limit = config.getInteger("limit"); name = config.getString("name", "counter_" + ID.getAndIncrement());
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCsrfFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCsrfFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -3,6 +3,7 @@ import com.passus.commons.Assert; import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; @@ -255,7 +256,7 @@ } @Override - public void configure(Configuration cfg) { + public void configure(Configuration cfg, ConfigurationContext context) { setExtractors((List<Extractor>) cfg.get("extract", Collections.EMPTY_LIST)); setInjectors((List<Injector>) cfg.get("inject", Collections.EMPTY_LIST)); setTokenStore((Store) cfg.get("store", tokenStore));
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCsrfFormFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpCsrfFormFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.listDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; @@ -81,7 +82,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { setInputName((String) config.get("inputName")); Object types = config.get("contentTypesToScan"); if (types != null) {
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.config.Configurable; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.net.http.HttpRequest; import com.passus.net.http.HttpResponse; import com.passus.st.client.http.HttpFlowContext; @@ -23,7 +24,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFiltersConfigurator.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFiltersConfigurator.java Wed Jan 24 08:29:58 2018 +0100 @@ -58,7 +58,7 @@ HttpFilter filter = factory.getInstanceByName(filterType); if (configNode.hasChild()) { Configuration filterConfig = new ConfigurationImpl(configNode); - filter.configure(filterConfig); + filter.configure(filterConfig, null); } filters.add(filter);
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFormLoginFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFormLoginFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.valueDef; import com.passus.config.schema.MapNodeDefinition; @@ -47,8 +48,8 @@ } @Override - public void configure(Configuration config) { - super.configure(config); + public void configure(Configuration config, ConfigurationContext context) { + super.configure(config, context); userField = (CharSequence) config.get("userField"); passwordField = (CharSequence) config.get("passwordField"); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpHostRewriterFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpHostRewriterFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.*; import com.passus.config.schema.MappingNodeDefinition; @@ -50,7 +51,7 @@ @SuppressWarnings("unchecked") @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { Map map = (Map) config.get("hostMap", Collections.EMPTY_MAP); setHostMap(map); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpLogoutFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpLogoutFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; @@ -55,7 +56,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { predicate = (HttpMessagePredicate) config.get("applyIf"); invalidateSession = config.getBoolean("invalidateSession", true); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMarkFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMarkFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -75,7 +75,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { this.markRules.addAll((Collection<? extends MarkerRule>) config.get("rules", Collections.EMPTY_LIST)); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMatchFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMatchFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; import com.passus.config.schema.NodeDefinition; @@ -43,7 +44,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { predicate = (HttpMessagePredicate) config.get("matches"); acceptOnMatch = (boolean) config.get("acceptOnMatch", true); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -3,6 +3,7 @@ import com.passus.commons.Assert; import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import com.passus.config.schema.KeyNameVaryListNodeDefinition; import com.passus.config.schema.NodeDefinition; @@ -538,7 +539,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { List<Operation> ops = (List<Operation>) config.get("operations"); operations.clear();
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMvelFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMvelFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -3,6 +3,7 @@ import com.passus.commons.Assert; import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; @@ -12,9 +13,6 @@ import com.passus.net.http.HttpRequest; import com.passus.net.http.HttpResponse; import com.passus.st.client.http.HttpFlowContext; -import static com.passus.st.client.http.filter.HttpFilter.ACCEPT; -import static com.passus.st.client.http.filter.HttpFilter.DENY; -import static com.passus.st.client.http.filter.HttpFilter.DUNNO; import com.passus.st.config.StringSourceNodeDefinition; import com.passus.st.config.StringToExecutableStatementValueTransformer; import com.passus.st.plugin.PluginConstants; @@ -80,7 +78,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { direction = (HttpFilterDirection) config.get("dir", HttpFilterDirection.OUT); statement = (ExecutableStatement) config.get("script"); }
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpScopeModificationFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpScopeModificationFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -3,6 +3,7 @@ import com.passus.commons.Assert; import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.enumDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; @@ -215,7 +216,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { List<Operation> ops = (List<Operation>) config.get("operations"); operations.clear();
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSequenceFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSequenceFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -370,7 +370,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { List<SequenceItem> itemsList = (List<SequenceItem>) config.get("sequence"); seqItems = itemsList.toArray(new SequenceItem[itemsList.size()]); for (int i = 0; i < seqItems.length; ++i) {
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionCookieFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpSessionCookieFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.annotations.Plugin; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.listDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; @@ -104,7 +105,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { cookieNames.clear(); cookieNames.addAll((Collection) config.get("sessionCookieNames", DEFAULT_COOKIE_NAMES)); removeInvalidSessionId = (Boolean) config.get("removeInvalidSessionId", false);
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpZoneFilter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpZoneFilter.java Wed Jan 24 08:29:58 2018 +0100 @@ -84,7 +84,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { List<Rule> cfgRules = (List<Rule>) config.get("zones", Collections.EMPTY_LIST); rules.clear(); rules.addAll(cfgRules);
--- a/stress-tester/src/main/java/com/passus/st/emitter/Emitter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/emitter/Emitter.java Wed Jan 24 08:29:58 2018 +0100 @@ -5,6 +5,8 @@ import com.passus.config.Configuration; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; + +import com.passus.config.ConfigurationContext; import com.passus.config.schema.MapNodeDefinition; import com.passus.config.schema.NodeDefinitionCreator; import com.passus.st.metric.MetricSource; @@ -25,7 +27,7 @@ public void connect(SessionInfo session, EmitterHandler handler, int workerIndex) throws IOException; @Override - public default void configure(Configuration config) { + public default void configure(Configuration config, ConfigurationContext context) { setSessionMapper((SessionMapper) config.get("sessionMapper")); }
--- a/stress-tester/src/main/java/com/passus/st/emitter/nio/NioEmitter.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/emitter/nio/NioEmitter.java Wed Jan 24 08:29:58 2018 +0100 @@ -1,5 +1,6 @@ package com.passus.st.emitter.nio; +import com.passus.config.ConfigurationContext; import com.passus.st.emitter.SessionMapper; import com.passus.commons.Assert; import com.passus.commons.annotations.Plugin; @@ -132,8 +133,8 @@ } @Override - public void configure(Configuration config) { - Emitter.super.configure(config); + public void configure(Configuration config, ConfigurationContext context) { + Emitter.super.configure(config, context); setMaxThreads(config.getInteger("threads", DEFAULT_NUM_THREADS)); setConnectionTimeout(config.getLong("connectionTimeout", DEFAULT_CONNECTION_TIMEOUT)); setCollectMetrics(config.getBoolean("collectMetrics", DEFAULT_COLLECT_METRICS));
--- a/stress-tester/src/main/java/com/passus/st/job/TestJob.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/job/TestJob.java Wed Jan 24 08:29:58 2018 +0100 @@ -1,11 +1,20 @@ package com.passus.st.job; +import com.passus.config.ConfigurationContext; + /** * * @author Mirosław Hawrot */ public class TestJob implements Job { + public TestJob() { + } + + public TestJob(ConfigurationContext context) { + + } + @Override public void start() { throw new UnsupportedOperationException("Not supported yet.");
--- a/stress-tester/src/main/java/com/passus/st/metric/FileMetricsCollectionAppender.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/metric/FileMetricsCollectionAppender.java Wed Jan 24 08:29:58 2018 +0100 @@ -5,6 +5,7 @@ import com.passus.commons.metric.MetricsCollection; import com.passus.commons.utils.StringUtils; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import static com.passus.config.schema.ConfigurationSchemaBuilder.mapDef; import static com.passus.config.schema.ConfigurationSchemaBuilder.tupleDef; @@ -120,7 +121,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { setFileName(config.getString("fileName")); setMaxBackupIndex(config.getInteger(TYPE, 1)); setMaxFileSize(config.getLong("maxFileSize", 0L));
--- a/stress-tester/src/main/java/com/passus/st/metric/MetricsCollectionAppender.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/metric/MetricsCollectionAppender.java Wed Jan 24 08:29:58 2018 +0100 @@ -3,6 +3,7 @@ import com.passus.commons.service.Service; import com.passus.config.Configurable; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; /** * @@ -15,7 +16,7 @@ public String getName(); @Override - public default void configure(Configuration config) { + public default void configure(Configuration config, ConfigurationContext context) { } }
--- a/stress-tester/src/main/java/com/passus/st/source/ArrayListEventDestination.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/source/ArrayListEventDestination.java Wed Jan 24 08:29:58 2018 +0100 @@ -1,6 +1,7 @@ package com.passus.st.source; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.st.client.ArrayListEventHandler; /** @@ -23,7 +24,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { } }
--- a/stress-tester/src/main/java/com/passus/st/source/EventSource.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/source/EventSource.java Wed Jan 24 08:29:58 2018 +0100 @@ -3,6 +3,7 @@ import com.passus.commons.service.Service; import com.passus.config.Configurable; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.st.client.EventHandler; /** @@ -28,7 +29,7 @@ public void setHandler(EventHandler handler); @Override - public default void configure(Configuration config) { + public default void configure(Configuration config, ConfigurationContext context) { }
--- a/stress-tester/src/main/java/com/passus/st/source/NcEventDestination.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/source/NcEventDestination.java Wed Jan 24 08:29:58 2018 +0100 @@ -2,6 +2,7 @@ import com.passus.commons.service.ServiceException; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.data.ByteBuff; import com.passus.data.HeapByteBuff; import com.passus.net.http.HttpRequestEncoder; @@ -134,7 +135,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { }
--- a/stress-tester/src/main/java/com/passus/st/source/NcEventSource.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/source/NcEventSource.java Wed Jan 24 08:29:58 2018 +0100 @@ -5,6 +5,7 @@ import com.passus.commons.service.ServiceException; import com.passus.commons.utils.UniqueIdGenerator; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import com.passus.config.schema.NodeDefinition; import com.passus.config.schema.NodeDefinitionCreator; @@ -144,7 +145,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { ncFile = config.getString("fileName"); loops = config.getInteger("loops"); }
--- a/stress-tester/src/main/java/com/passus/st/source/NullEventDestination.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/source/NullEventDestination.java Wed Jan 24 08:29:58 2018 +0100 @@ -1,6 +1,7 @@ package com.passus.st.source; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.st.client.Event; /** @@ -23,7 +24,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { } @Override
--- a/stress-tester/src/main/java/com/passus/st/source/PcapSessionEventSource.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/main/java/com/passus/st/source/PcapSessionEventSource.java Wed Jan 24 08:29:58 2018 +0100 @@ -6,6 +6,7 @@ import com.passus.commons.time.CustomTimeGenerator; import com.passus.commons.utils.UniqueIdGenerator; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.config.annotations.NodeDefinitionCreate; import com.passus.config.schema.NodeDefinition; import com.passus.config.schema.NodeDefinitionCreator; @@ -191,7 +192,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { pcapFile = config.getString("fileName"); loops = config.getInteger("loops", EventSource.DEFAULT_LOOPS); loopDelay = config.getLong("loopDelay", 0L);
--- a/stress-tester/src/test/java/com/passus/st/client/http/HttpSynchClientWorkerTest.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/HttpSynchClientWorkerTest.java Wed Jan 24 08:29:58 2018 +0100 @@ -1,6 +1,7 @@ package com.passus.st.client.http; import com.passus.config.Configuration; +import com.passus.config.ConfigurationContext; import com.passus.data.ByteBuff; import com.passus.data.HeapByteBuff; import com.passus.net.SocketAddress; @@ -124,7 +125,7 @@ } @Override - public void configure(Configuration config) { + public void configure(Configuration config, ConfigurationContext context) { } }
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpBasicAuthLoginFilterTest.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpBasicAuthLoginFilterTest.java Wed Jan 24 08:29:58 2018 +0100 @@ -52,7 +52,7 @@ ConfigurationImpl cfg = new ConfigurationImpl(); cfg.set("provider", provider); HttpBasicAuthLoginFilter filter = new HttpBasicAuthLoginFilter(); - filter.configure(cfg); + filter.configure(cfg, null); return filter; }
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpDigestAuthLoginFilterTest.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpDigestAuthLoginFilterTest.java Wed Jan 24 08:29:58 2018 +0100 @@ -43,7 +43,7 @@ ConfigurationImpl cfg = new ConfigurationImpl(); cfg.set("provider", new SingleCredentialsProvider(cred)); HttpDigestAuthLoginFilter filter = new HttpDigestAuthLoginFilter(); - filter.configure(cfg); + filter.configure(cfg, null); return filter; }
--- a/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpFormLoginFilterTest.java Tue Jan 23 16:02:42 2018 +0100 +++ b/stress-tester/src/test/java/com/passus/st/client/http/filter/HttpFormLoginFilterTest.java Wed Jan 24 08:29:58 2018 +0100 @@ -52,7 +52,7 @@ cfg.set("userField", "_username"); cfg.set("passwordField", "_password"); HttpFormLoginFilter filter = new HttpFormLoginFilter(); - filter.configure(cfg); + filter.configure(cfg, null); return filter; }