org.apache.jmeter.functions

Class Property2

Implemented Interfaces:
Function

public class Property2
extends 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)

Constructor Summary

Property2()

Method Summary

String
execute(SampleResult previousResult, Sampler currentSampler)
List
getArgumentDesc()
String
getReferenceKey()
void
setParameters(Collection parameters)

Methods inherited from class org.apache.jmeter.functions.AbstractFunction

checkMinParameterCount, checkParameterCount, checkParameterCount, execute, execute, getReferenceKey, getVariables, setParameters

Constructor Details

Property2

public Property2()

Method Details

execute

public String execute(SampleResult previousResult,
                      Sampler currentSampler)
            throws InvalidVariableException
Specified by:
execute in interface Function
Overrides:
execute in interface AbstractFunction

getArgumentDesc

public List getArgumentDesc()
Specified by:
getArgumentDesc in interface Function

getReferenceKey

public String getReferenceKey()
Specified by:
getReferenceKey in interface Function
Overrides:
getReferenceKey in interface AbstractFunction

setParameters

public void setParameters(Collection parameters)
            throws InvalidVariableException
Specified by:
setParameters in interface Function
Overrides:
setParameters in interface AbstractFunction

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