changeset 914:afa17add2f3f

sunc with passus-lookup r272
author Devel 1
date Tue, 24 Apr 2018 22:44:33 +0200
parents d1158607d5f0
children f4d5bc0876bd
files stress-tester/src/main/java/com/passus/st/config/JobConfigurator.java stress-tester/src/main/java/com/passus/st/filter/Transformers.java
diffstat 2 files changed, 7 insertions(+), 47 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/config/JobConfigurator.java	Mon Apr 23 21:58:06 2018 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,45 +0,0 @@
-package com.passus.st.config;
-
-import com.passus.commons.Assert;
-import com.passus.config.Configuration;
-import com.passus.config.ConfigurationContext;
-import com.passus.config.validation.Errors;
-
-public abstract class JobConfigurator {
-
-    protected Configuration config;
-
-    public Errors init(Configuration config) {
-        Assert.notNull(config, "config");
-        this.config = config;
-        return null;
-    }
-
-    private void ensureConfigLoaded() {
-        if (config == null) {
-            throw new IllegalStateException("Configuration not loaded.");
-        }
-    }
-
-    public final Errors validate(ConfigurationContext context) {
-        ensureConfigLoaded();
-        return doValidate(context);
-    }
-
-    public abstract Errors doValidate(ConfigurationContext context);
-
-    public final Errors configure(ConfigurationContext context) {
-        ensureConfigLoaded();
-        return doConfigure(context);
-    }
-
-    public abstract Errors doConfigure(ConfigurationContext context);
-
-    public final void destroy(ConfigurationContext context) {
-        ensureConfigLoaded();
-        doDestroy(context);
-    }
-
-    public abstract void doDestroy(ConfigurationContext context);
-
-}
--- a/stress-tester/src/main/java/com/passus/st/filter/Transformers.java	Mon Apr 23 21:58:06 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/filter/Transformers.java	Tue Apr 24 22:44:33 2018 +0200
@@ -7,6 +7,7 @@
 import com.passus.filter.config.PredicateNodeTransformer;
 import com.passus.filter.config.ValueExtractorResolver;
 import com.passus.lookup.Lookup;
+import com.passus.lookup.filter.LookupHelper;
 import com.passus.lookup.filter.LookupValueExtractorTransformer;
 import com.passus.st.utils.ConfigurationContextConsts;
 import com.passus.st.vars.VarsExtractorResolver;
@@ -24,7 +25,11 @@
 
     public static final PredicateNodeTransformer PREDICATE = new PredicateNodeTransformer(VALUE_EXTRACTOR_RESOLVER);
 
-    public static final ExpressionNodeTransformer EXPRESSION = new ExpressionNodeTransformer(new ValueExtractorParser(VALUE_EXTRACTOR_RESOLVER));
+    public static final ValueExtractorParser VALUE_EXTRACTOR_PARSER = new ValueExtractorParser(VALUE_EXTRACTOR_RESOLVER);
+
+    public static final ExpressionNodeTransformer EXPRESSION = new ExpressionNodeTransformer(VALUE_EXTRACTOR_PARSER);
+
+    public static final LookupHelper LOOKUP_HELPER = new LookupHelper(VALUE_EXTRACTOR_PARSER);
 
     public static ExpressionNodeTransformer expressionNodeTransformer(ConfigurationContext context) {
         Map<String, ValueExtractor> vars = (Map<String, ValueExtractor>) context.get(ConfigurationContextConsts.APP_VARS);
@@ -39,7 +44,7 @@
 
     public static LookupValueExtractorTransformer lookupNodeTransformer(ConfigurationContext context) {
         List<Lookup> lookups = context.get(ConfigurationContextConsts.LOOKUPS, Collections.EMPTY_LIST);
-        return new LookupValueExtractorTransformer(lookups);
+        return new LookupValueExtractorTransformer(lookups, LOOKUP_HELPER);
     }
 
 }