Package org.apache.jmeter.functions
Class Property2
java.lang.Object
org.apache.jmeter.functions.AbstractFunction
org.apache.jmeter.functions.Property2
- All Implemented Interfaces:
org.apache.jmeter.functions.Function
@AutoService(org.apache.jmeter.functions.Function.class)
public class Property2
extends org.apache.jmeter.functions.AbstractFunction
Function to get a JMeter property, or a default. Does not offer the option to
store the value, as it is just as easy to refetch it. This is a
specialisation of the __property() function to make it simpler to use for
ThreadGroup GUI etc. The name is also shorter.
Parameters: - property name - default value (optional; defaults to "1")
Usage:
Define the property in jmeter.properties, or on the command-line: java ...
-Jpropname=value
Retrieve the value in the appropriate GUI by using the string:
${__P(propname)} $(__P(propname,default)}
Returns: - the property value, but if not found - the default value, but if
not present - "1" (suitable for use in ThreadGroup GUI)
- Since:
- 2.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute
(org.apache.jmeter.samplers.SampleResult previousResult, org.apache.jmeter.samplers.Sampler currentSampler) void
setParameters
(Collection<org.apache.jmeter.engine.util.CompoundVariable> parameters) Methods inherited from class org.apache.jmeter.functions.AbstractFunction
addVariableValue, checkMinParameterCount, checkParameterCount, checkParameterCount, execute, getVariables
-
Constructor Details
-
Property2
public Property2()
-
-
Method Details
-
execute
public String execute(org.apache.jmeter.samplers.SampleResult previousResult, org.apache.jmeter.samplers.Sampler currentSampler) throws org.apache.jmeter.functions.InvalidVariableException - Specified by:
execute
in interfaceorg.apache.jmeter.functions.Function
- Specified by:
execute
in classorg.apache.jmeter.functions.AbstractFunction
- Throws:
org.apache.jmeter.functions.InvalidVariableException
-
setParameters
public void setParameters(Collection<org.apache.jmeter.engine.util.CompoundVariable> parameters) throws org.apache.jmeter.functions.InvalidVariableException - Specified by:
setParameters
in interfaceorg.apache.jmeter.functions.Function
- Specified by:
setParameters
in classorg.apache.jmeter.functions.AbstractFunction
- Throws:
org.apache.jmeter.functions.InvalidVariableException
-
getReferenceKey
- Specified by:
getReferenceKey
in interfaceorg.apache.jmeter.functions.Function
- Specified by:
getReferenceKey
in classorg.apache.jmeter.functions.AbstractFunction
-
getArgumentDesc
-