Class ValueReplacer
java.lang.Object
org.apache.jmeter.engine.util.ValueReplacer
Perfom replacement of ${variable} references.
-
Constructor Summary
ConstructorsConstructorDescriptionConstructor which couples the givenTestPlanto this by means of the user defined variables -
Method Summary
Modifier and TypeMethodDescriptionvoidaddVariable(String name, String value) Add a variable to this replacer's variables mapvoidaddVariables(Map<String, String> vars) Add all the given variables to this replacer's variables map.voidReplaces TestElement StringProperties containing functions with their Function properties equivalent, example: ${__time()}_${__threadNum()}_${__machineName()} will become a FunctionProperty of a CompoundVariable containing 3 functionsvoidTransforms strings into variable referencesvoidreverseReplace(TestElement el, boolean regexMatch) Transforms strings into variable references using regexp matching if regexMatch istruevoidsetUserDefinedVariables(Map<String, String> variables) Set thisValueReplacer's variable mapvoidReplaces ${key} by value extracted from variables if any
-
Constructor Details
-
ValueReplacer
public ValueReplacer() -
ValueReplacer
-
-
Method Details
-
setUserDefinedVariables
Set thisValueReplacer's variable map- Parameters:
variables- Map which stores the variables
-
replaceValues
Replaces TestElement StringProperties containing functions with their Function properties equivalent, example: ${__time()}_${__threadNum()}_${__machineName()} will become a FunctionProperty of a CompoundVariable containing 3 functions- Parameters:
el-TestElementin which the values should be replaced- Throws:
InvalidVariableException- when transforming of the variables goes awry and the used transformer throws anInvalidVariableException
-
reverseReplace
Transforms strings into variable references- Parameters:
el-TestElementin which the we will look for strings, that can be replaced by variable references- Throws:
InvalidVariableException- when transforming of the strings goes awry and the used transformer throws anInvalidVariableException
-
reverseReplace
Transforms strings into variable references using regexp matching if regexMatch istrue- Parameters:
el-TestElementin which the we will look for strings, that can be replaced by variable referencesregexMatch- whentruevariable substitution will be done in regexp matching mode- Throws:
InvalidVariableException- when transforming of the strings goes awry and the used transformer throws anInvalidVariableException
-
undoReverseReplace
Replaces ${key} by value extracted from variables if any- Parameters:
el-TestElementin which values should be replaced- Throws:
InvalidVariableException- when transforming of the variables goes awry and the used transformer throws anInvalidVariableException
-
addVariable
-
addVariables
-