public class ValueReplacer extends Object
| Constructor | Description |
|---|---|
ValueReplacer() |
|
ValueReplacer(TestPlan tp) |
Constructor which couples the given
TestPlan to this by means of the user defined variables |
| Modifier and Type | Method | Description |
|---|---|---|
void |
addVariable(String name,
String value) |
Add a variable to this replacer's variables map
|
void |
addVariables(Map<String,String> vars) |
Add all the given variables to this replacer's variables map.
|
void |
replaceValues(TestElement el) |
Replaces TestElement StringProperties containing functions with their Function properties equivalent, example:
${__time()}_${__threadNum()}_${__machineName()} will become a FunctionProperty of
a CompoundVariable containing 3 functions
|
void |
reverseReplace(TestElement el) |
Transforms strings into variable references
|
void |
reverseReplace(TestElement el,
boolean regexMatch) |
Transforms strings into variable references using regexp matching if regexMatch is
true |
void |
setUserDefinedVariables(Map<String,String> variables) |
Set this
ValueReplacer's variable map |
void |
undoReverseReplace(TestElement el) |
Replaces ${key} by value extracted from variables if any
|
public void setUserDefinedVariables(Map<String,String> variables)
ValueReplacer's variable mapvariables - Map which stores the variablespublic void replaceValues(TestElement el) throws InvalidVariableException
el - TestElement in which the values should be replacedInvalidVariableException - when transforming of the variables goes awry and
the used transformer throws an InvalidVariableExceptionpublic void reverseReplace(TestElement el) throws InvalidVariableException
el - TestElement in which the we will look for strings, that can be replaced by variable referencesInvalidVariableException - when transforming of the strings goes awry and
the used transformer throws an InvalidVariableExceptionpublic void reverseReplace(TestElement el, boolean regexMatch) throws InvalidVariableException
trueel - TestElement in which the we will look for strings, that can be replaced by variable referencesregexMatch - when true variable substitution will be done in regexp matching modeInvalidVariableException - when transforming of the strings goes awry and
the used transformer throws an InvalidVariableExceptionpublic void undoReverseReplace(TestElement el) throws InvalidVariableException
el - TestElement in which values should be replacedInvalidVariableException - when transforming of the variables goes awry and
the used transformer throws an InvalidVariableExceptionpublic void addVariable(String name, String value)
name - Name of the variablevalue - Value of the variableCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.