changeset 911:7f83606b0a27

bugfix
author Devel 1
date Thu, 19 Apr 2018 10:52:33 +0200
parents 82931aa4de74
children f3957e7bf48c
files stress-tester/src/main/java/com/passus/st/CliHelper.java stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTransformer.java
diffstat 2 files changed, 6 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/CliHelper.java	Thu Apr 19 10:29:42 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/CliHelper.java	Thu Apr 19 10:52:33 2018 +0200
@@ -8,7 +8,6 @@
 import static com.passus.config.validation.ErrorsUtils.objectErrorToString;
 import com.passus.config.validation.ObjectError;
 import com.passus.filter.ValueExtractor;
-import com.passus.lookup.Lookup;
 import com.passus.net.PortRangeSet;
 import com.passus.st.client.http.HttpClient;
 import com.passus.st.client.http.filter.HttpFilter;
@@ -24,7 +23,6 @@
 import com.passus.st.source.EventSource;
 import com.passus.st.source.NcEventSource;
 import com.passus.st.source.PcapSessionEventSource;
-import com.passus.st.utils.ConfigurationContextConsts;
 import com.passus.st.vars.VarsConfigurator;
 import java.io.File;
 import java.io.InputStream;
@@ -160,20 +158,15 @@
     }
 
     public void readLookupsToContext(CommandLine cl, ConfigurationContext context) throws Exception {
-        List<Lookup> lookups = readLookups(cl, context);
-        context.add(ConfigurationContextConsts.LOOKUPS, lookups);
-    }
-
-    public List<Lookup> readLookups(CommandLine cl, ConfigurationContext context) throws Exception {
         if (cl.hasOption("lf")) {
             File file = new File(cl.getOptionValue("lf"));
             Errors errors = new Errors();
-            List<Lookup> lookups = LookupsDomainConfigurator.getLookups(file, errors, context);
-            handleErrors(errors, file);
-            return lookups;
+            Configuration config = YamlConfigurationReader.readFromFile(file);
+
+            LookupsDomainConfigurator configurator = new LookupsDomainConfigurator();
+            Configuration subConfiguration = config.subConfiguration(LookupsDomainConfigurator.DOMAIN);
+            configurator.configure(subConfiguration, errors, context);
         }
-
-        return Collections.EMPTY_LIST;
     }
 
     @SuppressWarnings("unchecked")
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTransformer.java	Thu Apr 19 10:29:42 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTransformer.java	Thu Apr 19 10:52:33 2018 +0200
@@ -74,7 +74,7 @@
                 } catch(NodeConversionException e) {
                     errors.reject(valNode, "Invalid lookup definition. " + e.getMessage());
                 } catch(Exception e) {
-                    errors.reject("Invalid lookup definition.", valNode);
+                    errors.reject(valNode, "Invalid lookup definition.");
                 }
             }
         } else {