Apache JMeter

org.apache.jmeter.engine.util
Class ValueReplacer

java.lang.Object
  extended by org.apache.jmeter.engine.util.ValueReplacer

public class ValueReplacer
extends Object

Perfom replacement of ${variable} references.


Constructor Summary
ValueReplacer()
           
ValueReplacer(TestPlan tp)
           
 
Method Summary
 void addVariable(String name, String value)
           
 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)
           
 void undoReverseReplace(TestElement el)
          Replaces ${key} by value extracted from variables if any
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValueReplacer

public ValueReplacer()

ValueReplacer

public ValueReplacer(TestPlan tp)
Method Detail

setUserDefinedVariables

public void setUserDefinedVariables(Map<String,String> variables)

replaceValues

public void replaceValues(TestElement el)
                   throws InvalidVariableException
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 -
Throws:
InvalidVariableException

reverseReplace

public void reverseReplace(TestElement el)
                    throws InvalidVariableException
Transforms strings into variable references

Parameters:
el -
Throws:
InvalidVariableException

reverseReplace

public void reverseReplace(TestElement el,
                           boolean regexMatch)
                    throws InvalidVariableException
Transforms strings into variable references using regexp matching if regexMatch is true

Parameters:
el -
regexMatch -
Throws:
InvalidVariableException

undoReverseReplace

public void undoReverseReplace(TestElement el)
                        throws InvalidVariableException
Replaces ${key} by value extracted from variables if any

Parameters:
el -
Throws:
InvalidVariableException

addVariable

public void addVariable(String name,
                        String value)

addVariables

public void addVariables(Map<String,String> vars)
Add all the given variables to this replacer's variables map.

Parameters:
vars - A map of variable name-value pairs (String-to-String).

Apache JMeter

Copyright © 1998-2014 Apache Software Foundation. All Rights Reserved.