Processes nested ignore statements in control value and replaces that ignore placeholder with the actual value at this position.
This way we can ignore words in a plaintext value.
@param control
@param result
@param context
@return
180562
private String processVariableStatements(String control, String result, TestContext context) {
        if (control.equals(Citrus.IGNORE_PLACEHOLDER)) {
            return control;
        }

        Pattern whitespacePattern = Pattern.compile("[^a-zA-Z_0-9\\-\\.]");
        Pattern variablePattern = Pattern.compile("@variable\\(?'?([a-zA-Z_0-9\\-\\.]*)'?\\)?@");

        Matcher variableMatcher = variablePattern.matcher(control);
        while (variableMatcher.find()) {
            String actualValue = result.substring(variableMatcher.start());
            Matcher whitespaceMatcher = whitespacePattern.matcher(actualValue);
            if (whitespaceMatcher.find()) {
                actualValue = actualValue.substring(0, whitespaceMatcher.start());
            }

            control = variableMatcher.replaceFirst(actualValue);
            context.setVariable(variableMatcher.group(1), actualValue);
            variableMatcher = variablePattern.matcher(control);
        }

        return control;
    }
97900
protected void populateContext(JexlContext context, Result result) {
		context.set(VAR_CLASSNAME, result.getClassName());
		context.set(VAR_ATTRIBUTE_NAME, result.getAttributeName());
		context.set(VAR_CLASSNAME_ALIAS, result.getKeyAlias());

		Map<String, String> typeNameMap = TypeNameValue.extractMap(result.getTypeName());
		context.set(VAR_TYPENAME, typeNameMap);

		String effectiveClassname = result.getKeyAlias();
		if (effectiveClassname == null) {
			effectiveClassname = result.getClassName();
		}
		context.set(VAR_EFFECTIVE_CLASSNAME, effectiveClassname);

		context.set(VAR_RESULT, result);
	}
1270140
public Object execute(final Object value, final CsvContext context) {
		validateInputNotNull(value, context);
		
		final String result = value.toString().trim();
		return next.execute(result, context);
	}
725180
public void resetResult(Object result)
  {

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.entry(tc, "resetResult");

    if (result != null)
       ((TopicAclTraversalResults) result).reset();
    //   ((ArrayList) result).clear();

    if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
      SibTr.exit(tc, "resetResult");

  }
922353
@SuppressWarnings("unchecked")
    public Object execute(final Object value, final CsvContext context) {
        
        if(value == null) {
            return next.execute(value, context);
        }
        
        final String stringValue = value.toString();
        final int length = stringValue.length();
        if( length < min || length > max ) {
            throw createValidationException(context)
                .messageFormat("the length (%d) of value '%s' does not lie between the min (%d) and max (%d) values (inclusive)",
                        length, stringValue, min, max)
                .rejectedValue(stringValue)
                .messageVariables("min", getMin())
                .messageVariables("max", getMax())
                .messageVariables("length", length)
                .build();
                
        }
        
        return next.execute(stringValue, context);
    }
63838
public void perform(GraphRewrite event, EvaluationContext context)
    {
        Variables variables = Variables.instance(event);
        Iterable<? extends WindupVertexFrame> frames = getSelectionManager().getFrames(event, context);

        boolean hasCommitOperation = OperationUtil.hasCommitOperation(operationPerform) || OperationUtil.hasCommitOperation(operationOtherwise);
        boolean hasIterationOperation = OperationUtil.hasIterationProgress(operationPerform)
                    || OperationUtil.hasIterationProgress(operationOtherwise);
        DefaultOperationBuilder commit = new NoOp();
        DefaultOperationBuilder iterationProgressOperation = new NoOp();

        if (!hasCommitOperation || !hasIterationOperation)
        {
            int frameCount = Iterables.size(frames);
            if (frameCount > 100)
            {
                if (!hasCommitOperation)
                    commit = Commit.every(1000);

                if (!hasIterationOperation)
                {
                    // Use 500 here as 100 might be noisy.
                    iterationProgressOperation = IterationProgress.monitoring("Rule Progress", 500);
                }
            }
        }
        Operation commitAndProgress = commit.and(iterationProgressOperation);

        event.getRewriteContext().put(DEFAULT_VARIABLE_LIST_STRING, frames); // set the current frames
        try
        {
            for (WindupVertexFrame frame : frames)
            try
            {
                variables.push();
                getPayloadManager().setCurrentPayload(variables, frame);
                boolean conditionResult = true;
                if (condition != null)
                {
                    final String payloadVariableName = getPayloadVariableName(event, context);
                    passInputVariableNameToConditionTree(condition, payloadVariableName);
                    conditionResult = condition.evaluate(event, context);
                    /*
                     * Add special clear layer for perform, because condition used one and could have added new variables. The condition result put into
                     * variables is ignored.
                     */
                    variables.push();
                    getPayloadManager().setCurrentPayload(variables, frame);
                }
                if (conditionResult)
                {
                    if (operationPerform != null)
                    {
                        operationPerform.perform(event, context);
                    }
                }
                else if (condition != null)
                {
                    if (operationOtherwise != null)
                    {
                        operationOtherwise.perform(event, context);
                    }
                }
                commitAndProgress.perform(event, context);

                getPayloadManager().removeCurrentPayload(variables);
                // remove the perform layer
                variables.pop();
                if (condition != null)
                {
                    // remove the condition layer
                    variables.pop();
                }
            }
            catch (WindupStopException ex)
            {
                throw new WindupStopException(Util.WINDUP_BRAND_NAME_ACRONYM+" stop requested in " + this.toString(), ex);
            }
            catch (Exception e)
            {
                throw new WindupException("Failed when iterating " + frame.toPrettyString() + ", due to: " + e.getMessage(), e);
            }
        }
        finally
        {
            event.getRewriteContext().put(DEFAULT_VARIABLE_LIST_STRING, null);
        }
    }
870026
public void setResult(T result) {
        lock.lock();
        try {
            if(Objects.equals(expected_result, result))
                super.setResult(result);
        }
        finally {
            lock.unlock();
        }
    }
880960
public Result compile(String[] argv, Context context) {
        if (stdOut != null) {
            context.put(Log.outKey, stdOut);
        }

        if (stdErr != null) {
            context.put(Log.errKey, stdErr);
        }

        log = Log.instance(context);

        if (argv.length == 0) {
            OptionHelper h = new OptionHelper.GrumpyHelper(log) {
                @Override
                public String getOwnName() { return ownName; }
                @Override
                public void put(String name, String value) { }
            };
            try {
                Option.HELP.process(h, "-help");
            } catch (Option.InvalidValueException ignore) {
            }
            return Result.CMDERR;
        }

        // prefix argv with contents of environment variable and expand @-files
        try {
            argv = CommandLine.parse(ENV_OPT_NAME, argv);
        } catch (UnmatchedQuote ex) {
            error("err.unmatched.quote", ex.variableName);
            return Result.CMDERR;
        } catch (FileNotFoundException | NoSuchFileException e) {
            warning("err.file.not.found", e.getMessage());
            return Result.SYSERR;
        } catch (IOException ex) {
            log.printLines(PrefixKind.JAVAC, "msg.io");
            ex.printStackTrace(log.getWriter(WriterKind.NOTICE));
            return Result.SYSERR;
        }

        Arguments args = Arguments.instance(context);
        args.init(ownName, argv);

        if (log.nerrors > 0)
            return Result.CMDERR;

        Options options = Options.instance(context);

        // init Log
        boolean forceStdOut = options.isSet("stdout");
        if (forceStdOut) {
            log.flush();
            log.setWriters(new PrintWriter(System.out, true));
        }

        // init CacheFSInfo
        // allow System property in following line as a Mustang legacy
        boolean batchMode = (options.isUnset("nonBatchMode")
                    && System.getProperty("nonBatchMode") == null);
        if (batchMode)
            CacheFSInfo.preRegister(context);

        boolean ok = true;

        // init file manager
        fileManager = context.get(JavaFileManager.class);
        if (fileManager instanceof BaseFileManager) {
            ((BaseFileManager) fileManager).setContext(context); // reinit with options
            ok &= ((BaseFileManager) fileManager).handleOptions(args.getDeferredFileManagerOptions());
        }

        // handle this here so it works even if no other options given
        String showClass = options.get("showClass");
        if (showClass != null) {
            if (showClass.equals("showClass")) // no value given for option
                showClass = "com.sun.tools.javac.Main";
            showClass(showClass);
        }

        ok &= args.validate();
        if (!ok || log.nerrors > 0)
            return Result.CMDERR;

        if (args.isEmpty())
            return Result.OK;

        // init Dependencies
        if (options.isSet("debug.completionDeps")) {
            Dependencies.GraphDependencies.preRegister(context);
        }

        // init plugins
        Set<List<String>> pluginOpts = args.getPluginOpts();
        if (!pluginOpts.isEmpty() || context.get(PlatformDescription.class) != null) {
            BasicJavacTask t = (BasicJavacTask) BasicJavacTask.instance(context);
            t.initPlugins(pluginOpts);
        }

        // init multi-release jar handling
        if (fileManager.isSupportedOption(Option.MULTIRELEASE.primaryName) == 1) {
            Target target = Target.instance(context);
            List<String> list = List.of(target.multiReleaseValue());
            fileManager.handleOption(Option.MULTIRELEASE.primaryName, list.iterator());
        }

        // init JavaCompiler
        JavaCompiler comp = JavaCompiler.instance(context);

        // init doclint
        List<String> docLintOpts = args.getDocLintOpts();
        if (!docLintOpts.isEmpty()) {
            BasicJavacTask t = (BasicJavacTask) BasicJavacTask.instance(context);
            t.initDocLint(docLintOpts);
        }

        if (options.get(Option.XSTDOUT) != null) {
            // Stdout reassigned - ask compiler to close it when it is done
            comp.closeables = comp.closeables.prepend(log.getWriter(WriterKind.NOTICE));
        }

        try {
            comp.compile(args.getFileObjects(), args.getClassNames(), null, List.nil());

            if (log.expectDiagKeys != null) {
                if (log.expectDiagKeys.isEmpty()) {
                    log.printRawLines("all expected diagnostics found");
                    return Result.OK;
                } else {
                    log.printRawLines("expected diagnostic keys not found: " + log.expectDiagKeys);
                    return Result.ERROR;
                }
            }

            return (comp.errorCount() == 0) ? Result.OK : Result.ERROR;

        } catch (OutOfMemoryError | StackOverflowError ex) {
            resourceMessage(ex);
            return Result.SYSERR;
        } catch (FatalError ex) {
            feMessage(ex, options);
            return Result.SYSERR;
        } catch (AnnotationProcessingError ex) {
            apMessage(ex);
            return Result.SYSERR;
        } catch (PropagatedException ex) {
            // TODO: what about errors from plugins?   should not simply rethrow the error here
            throw ex.getCause();
        } catch (Throwable ex) {
            // Nasty.  If we've already reported an error, compensate
            // for buggy compiler error recovery by swallowing thrown
            // exceptions.
            if (comp == null || comp.errorCount() == 0 || options.isSet("dev"))
                bugMessage(ex);
            return Result.ABNORMAL;
        } finally {
            if (comp != null) {
                try {
                    comp.close();
                } catch (ClientCodeException ex) {
                    throw new RuntimeException(ex.getCause());
                }
            }
        }
    }
193116
private void execute(Executable action, ContentResult contentResult) {
        try {
            ChooseWhenRule chooseWhenRule = null;
            if (action.getCaseNo() > 0) {
                ChooseRuleMap chooseRuleMap = getTransletRule().getChooseRuleMap();
                if (chooseRuleMap == null || chooseRuleMap.isEmpty()) {
                    throw new IllegalRuleException("No defined choose rules");
                }
                ChooseRule chooseRule = chooseRuleMap.getChooseRule(action.getCaseNo());
                if (chooseRule == null) {
                    throw new IllegalRuleException("No choose rule with case number: " +
                            ChooseRule.toCaseGroupNo(action.getCaseNo()));
                }
                chooseWhenRule = chooseRule.getChooseWhenRule(action.getCaseNo());
                if (chooseWhenRule == null) {
                    throw new IllegalRuleException("No choose rule with case number: " + action.getCaseNo());
                }
                if (processedChooses != null && processedChooses.contains(chooseRule.getCaseNo())) {
                    return;
                }
                if (processedChooses == null || !processedChooses.contains(chooseWhenRule.getCaseNo())) {
                    BooleanExpression expression = new BooleanExpression(this);
                    if (expression.evaluate(chooseWhenRule)) {
                        if (processedChooses == null) {
                            processedChooses = new HashSet<>();
                        }
                        processedChooses.add(chooseRule.getCaseNo());
                        processedChooses.add(chooseWhenRule.getCaseNo());
                    } else {
                        return;
                    }
                }
            }

            if (log.isDebugEnabled()) {
                log.debug("Action " + action);
            }

            Object resultValue = action.execute(this);
            if (!action.isHidden() && contentResult != null && resultValue != ActionResult.NO_RESULT) {
                if (resultValue instanceof ProcessResult) {
                    contentResult.addActionResult(action, (ProcessResult) resultValue);
                } else {
                    contentResult.addActionResult(action, resultValue);
                }
            }

            if (action.isLastInChooseWhen() && chooseWhenRule != null && chooseWhenRule.getResponse() != null) {
                reserveResponse(chooseWhenRule.getResponse());
            }
        } catch (ActionExecutionException e) {
            throw e;
        } catch (Exception e) {
            setRaisedException(e);
            throw new ActionExecutionException("Failed to execute action " + action, e);
        }
    }
92314
public void setResult(Result result) throws IllegalArgumentException
  {
    if(null == result)
      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"Result should not be null");        
    m_result = result;
  }
562815
public void setResult(Result result) throws IllegalArgumentException
  {

    if (null == result)
      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_NULL, null)); //"result should not be null");

    try
    {
//      ContentHandler handler =
//        m_transformer.createResultContentHandler(result);
//      m_transformer.setContentHandler(handler);
        SerializationHandler xoh = 
            m_transformer.createSerializationHandler(result);
        m_transformer.setSerializationHandler(xoh);
    }
    catch (javax.xml.transform.TransformerException te)
    {
      throw new IllegalArgumentException(XSLMessages.createMessage(XSLTErrorResources.ER_RESULT_COULD_NOT_BE_SET, null)); //"result could not be set");
    }

    m_result = result;
  }
212036
private void throwResult(final Result result) {
		this.executor.execute(new Runnable() {
			
			@Override
			public void run() {
				QConnectorAsyncImpl.this.listener.resultReceived("", result);
			}
		});
	}
459661
@SuppressWarnings("unchecked")
    public Object execute(final Object value, final CsvContext context) {
        
        if(value == null) {
            return next.execute(value, context);
        }
        
        final String stringValue = value.toString();
        final int length = stringValue.length();
        
        if( !requriedLengths.contains(length)) {
            final String joinedLength = requriedLengths.stream()
                    .map(String::valueOf).collect(Collectors.joining(", "));
            
            throw createValidationException(context)
                .messageFormat("the length (%d) of value '%s' not any of required lengths (%s)",
                        length, stringValue, joinedLength)
                .rejectedValue(stringValue)
                .messageVariables("length", length)
                .messageVariables("requiredLengths", getRequiredLengths())
                .build();
                
        }
        
        return next.execute(stringValue, context);
    }
1090553
Object processVariableLists(Object rawValue, ExtendedAttributeDefinition attributeDef,
                                EvaluationContext context, boolean ignoreWarnings) throws ConfigEvaluatorException {
        if (attributeDef != null && !attributeDef.resolveVariables())
            return rawValue;

        if (rawValue instanceof List) {
            List<Object> returnList = new ArrayList<Object>();
            List<Object> values = (List<Object>) rawValue;
            for (Object o : values) {
                Object processed = processVariableLists(o, attributeDef, context, ignoreWarnings);
                if (processed instanceof List)
                    returnList.addAll((List<Object>) processed);
                else
                    returnList.add(processed);
            }
            return returnList;
        } else if (rawValue instanceof String) {
            // Look for functions of the form ${list(variableName)} first
            Matcher matcher = XMLConfigConstants.VAR_LIST_PATTERN.matcher((String) rawValue);
            if (matcher.find()) {
                String var = matcher.group(1);
                String rep = getProperty(var, context, ignoreWarnings, true);
                return rep == null ? rawValue : MetaTypeHelper.parseValue(rep);
            } else {
                return rawValue;
            }
        } else {
            return rawValue;
        }

    }
75840
protected void validateMessageContent(Message receivedMessage, Message controlMessage, XmlMessageValidationContext validationContext,
            TestContext context) {
        if (controlMessage == null || controlMessage.getPayload() == null) {
            log.debug("Skip message payload validation as no control message was defined");
            return;
        }

        if (!(controlMessage.getPayload() instanceof String)) {
            throw new IllegalArgumentException(
                    "DomXmlMessageValidator does only support message payload of type String, " +
                    "but was " + controlMessage.getPayload().getClass());
        }

        String controlMessagePayload = controlMessage.getPayload(String.class);

        if (receivedMessage.getPayload() == null || !StringUtils.hasText(receivedMessage.getPayload(String.class))) {
            Assert.isTrue(!StringUtils.hasText(controlMessagePayload),
                    "Unable to validate message payload - received message payload was empty, control message payload is not");
            return;
        } else if (!StringUtils.hasText(controlMessagePayload)) {
            return;
        }

        log.debug("Start XML tree validation ...");

        Document received = XMLUtils.parseMessagePayload(receivedMessage.getPayload(String.class));
        Document source = XMLUtils.parseMessagePayload(controlMessagePayload);

        XMLUtils.stripWhitespaceNodes(received);
        XMLUtils.stripWhitespaceNodes(source);

        if (log.isDebugEnabled()) {
            log.debug("Received message:\n" + XMLUtils.serialize(received));
            log.debug("Control message:\n" + XMLUtils.serialize(source));
        }

        validateXmlTree(received, source, validationContext, namespaceContextBuilder.buildContext(
                receivedMessage, validationContext.getNamespaces()), context);
    }
865257
public static void resolveValidationMatcher(String fieldName, String fieldValue, 
            String validationMatcherExpression, TestContext context) {
        String expression = VariableUtils.cutOffVariablesPrefix(cutOffValidationMatchersPrefix(validationMatcherExpression));

        if (expression.equals("ignore")) {
            expression += "()";
        }

        int bodyStart = expression.indexOf('(');
        if (bodyStart < 0) {
            throw new CitrusRuntimeException("Illegal syntax for validation matcher expression - missing validation value in '()' function body");
        }
        
        String prefix = "";
        if (expression.indexOf(':') > 0 && expression.indexOf(':') < bodyStart) {
            prefix = expression.substring(0, expression.indexOf(':') + 1);
        }

        String matcherValue = expression.substring(bodyStart + 1, expression.length() - 1);
        String matcherName = expression.substring(prefix.length(), bodyStart);

        ValidationMatcherLibrary library = context.getValidationMatcherRegistry().getLibraryForPrefix(prefix);
        ValidationMatcher validationMatcher = library.getValidationMatcher(matcherName);

        ControlExpressionParser controlExpressionParser = lookupControlExpressionParser(validationMatcher);
        List<String> params = controlExpressionParser.extractControlValues(matcherValue, null);
        List<String> replacedParams = replaceVariablesAndFunctionsInParameters(params, context);
        validationMatcher.validate(fieldName, fieldValue, replacedParams, context);
    }
1115620
function (cmd,context,silent)
		{
			var ctx = (context!=undefined?context:this);
			try
			{
				return (function () {
					var result = eval(cmd);
					if (!silent)
						self.e.log&&self.e.log(util.inspect(result),'result');
					return result;
				}.bind(ctx))();
			} catch (e)
			{
				this.e.exception&&this.e.exception(e);
			}
			return;
		}