changeset 919:25b3d4568893

predicate - lookup on the right side
author Devel 1
date Thu, 26 Apr 2018 11:29:43 +0200
parents 1d9f14d387f6
children 3a90f274cd0d
files stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilterMessagePredicateNodeDefinition.java stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTransformer.java stress-tester/src/main/java/com/passus/st/filter/Transformers.java
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilterMessagePredicateNodeDefinition.java	Thu Apr 26 09:10:02 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpFilterMessagePredicateNodeDefinition.java	Thu Apr 26 11:29:43 2018 +0200
@@ -13,6 +13,7 @@
 import static com.passus.config.validation.ValidationDefaultMessages.GENERAL_CONVERSION_ERROR;
 import com.passus.filter.config.PredicateNodeTransformer;
 import com.passus.lookup.filter.LookupKeyExistsLeftOperatorTransformer;
+import com.passus.lookup.filter.LookupValueExtractorTransformer;
 import com.passus.st.filter.Transformers;
 import java.util.Set;
 import java.util.function.Predicate;
@@ -37,9 +38,12 @@
         try {
             // TODO: refactor
             LookupKeyExistsLeftOperatorTransformer lookupKeyExistsTransformer = Transformers.lookupKeyExistsTransformer(context);
+            LookupValueExtractorTransformer lookupValueTransformer = Transformers.lookupValueTransformer(context);
             TRANSFORMER.addLeftOperatorTransformer(lookupKeyExistsTransformer);
+            TRANSFORMER.addValueExtractorTransformer(lookupValueTransformer);
             TRANSFORMER.transform(node);
             TRANSFORMER.removeLeftOperatorTransformer(lookupKeyExistsTransformer);
+            TRANSFORMER.removeValueExtractorTransformer(lookupValueTransformer);
         } catch (NodeConversionException ex) {
             errors.reject(node, ex.getMessage());
         } catch (ConversionException ex) {
@@ -55,9 +59,12 @@
             try {
                 // TODO: refactor
                 LookupKeyExistsLeftOperatorTransformer lookupKeyExistsTransformer = Transformers.lookupKeyExistsTransformer(context);
+                LookupValueExtractorTransformer lookupValueTransformer = Transformers.lookupValueTransformer(context);
                 TRANSFORMER.addLeftOperatorTransformer(lookupKeyExistsTransformer);
+                TRANSFORMER.addValueExtractorTransformer(lookupValueTransformer);
                 Predicate predicate = TRANSFORMER.transform(node);
                 TRANSFORMER.removeLeftOperatorTransformer(lookupKeyExistsTransformer);
+                TRANSFORMER.removeValueExtractorTransformer(lookupValueTransformer);
                 return new CValueNode(new HttpMessagePredicate(predicate));
             } catch (NodeConversionException ex) {
                 errors.reject(node, ex.getMessage());
--- a/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTransformer.java	Thu Apr 26 09:10:02 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/client/http/filter/HttpMessageModificationFilterTransformer.java	Thu Apr 26 11:29:43 2018 +0200
@@ -186,7 +186,7 @@
         }
 
         final ExpressionNodeTransformer expressionNodeTransformer = Transformers.expressionNodeTransformer(context);
-        final LookupValueExtractorTransformer lookupValueTransformer = Transformers.lookupNodeTransformer(context);
+        final LookupValueExtractorTransformer lookupValueTransformer = Transformers.lookupValueTransformer(context);
 
         for (CTupleNode tuple : tuples) {
             String opName = tuple.getName();
--- a/stress-tester/src/main/java/com/passus/st/filter/Transformers.java	Thu Apr 26 09:10:02 2018 +0200
+++ b/stress-tester/src/main/java/com/passus/st/filter/Transformers.java	Thu Apr 26 11:29:43 2018 +0200
@@ -43,7 +43,7 @@
         }
     }
 
-    public static LookupValueExtractorTransformer lookupNodeTransformer(ConfigurationContext context) {
+    public static LookupValueExtractorTransformer lookupValueTransformer(ConfigurationContext context) {
         List<Lookup> lookups = context.get(ConfigurationContextConsts.LOOKUPS, Collections.EMPTY_LIST);
         return new LookupValueExtractorTransformer(lookups, LOOKUP_HELPER);
     }