changeset 923:76514f9e0346

ST-126
author Devel 1
date Thu, 26 Apr 2018 13:56:09 +0200
parents ca0b914c317d
children 3a6dc239361d
files stress-tester/src/main/java/com/passus/st/CliHelper.java stress-tester/src/main/java/com/passus/st/config/TestJobConfigurator.java stress-tester/src/main/java/com/passus/st/lookup/LookupsDomainConfigurator.java
diffstat 3 files changed, 11 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/CliHelper.java	Thu Apr 26 13:38:44 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/CliHelper.java	Thu Apr 26 13:56:09 2018 +0200
@@ -170,6 +170,7 @@
             LookupsDomainConfigurator configurator = new LookupsDomainConfigurator();
             Configuration subConfiguration = config.subConfiguration(LookupsDomainConfigurator.DOMAIN);
             configurator.configure(subConfiguration, errors, context);
+            configurator.afterConfigurationSet(errors, context);
         }
     }
 
--- a/stress-tester/src/main/java/com/passus/st/config/TestJobConfigurator.java	Thu Apr 26 13:38:44 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/config/TestJobConfigurator.java	Thu Apr 26 13:56:09 2018 +0200
@@ -117,6 +117,10 @@
                 if (errors.hasError()) {
                     break;
                 }
+                configurator.afterConfigurationSet(errors, context);
+                if (errors.hasError()) {
+                    break;
+                }
             }
         }
     }
--- a/stress-tester/src/main/java/com/passus/st/lookup/LookupsDomainConfigurator.java	Thu Apr 26 13:38:44 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/lookup/LookupsDomainConfigurator.java	Thu Apr 26 13:56:09 2018 +0200
@@ -58,7 +58,6 @@
         if (!errors.hasError()) {
             try {
                 List<Lookup> lookups = ConfigurationUtils.convertToList(rootNode, Lookup.class);
-                lookups.forEach(Lookup::start);
                 context.add(ConfigurationContextConsts.LOOKUPS, lookups);
             } catch (Exception e) {
                 throw new RuntimeException(e.getMessage(), e);
@@ -68,6 +67,12 @@
     }
 
     @Override
+    public void afterConfigurationSet(Errors errors, ConfigurationContext context) {
+        List<Lookup> lookups = (List<Lookup>) context.get(ConfigurationContextConsts.LOOKUPS, Collections.EMPTY_LIST);
+        lookups.forEach(Lookup::start);
+    }
+
+    @Override
     public void destroy(Configuration config, ConfigurationContext context) {
         destroy(context);
     }