org.apache.jmeter.functions
Class AbstractFunction
java.lang.Object
org.apache.jmeter.functions.AbstractFunction
- All Implemented Interfaces:
- Function
- Direct Known Subclasses:
- BeanShell, CSVRead, EvalFunction, EvalVarFunction, IntSum, IterationCounter, JavaScript, JexlFunction, LogFunction, LogFunction2, MachineName, Property, Property2, Random, RegexFunction, SetProperty, SplitFunction, StringFromFile, TimeFunction, Variable, XPath
- public abstract class AbstractFunction
- extends Object
- implements Function
Provides common methods for all functions
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
AbstractFunction
public AbstractFunction()
execute
public abstract String execute(SampleResult previousResult,
Sampler currentSampler)
throws InvalidVariableException
- Description copied from interface:
Function
- Given the previous SampleResult and the current Sampler, return a string
to use as a replacement value for the function call. Assume
"setParameter" was previously called.
This method must be threadsafe - multiple threads will be using the same
object.
- Specified by:
execute
in interface Function
- Throws:
InvalidVariableException
- See Also:
Function.execute(SampleResult, Sampler)
execute
public String execute()
throws InvalidVariableException
- Throws:
InvalidVariableException
setParameters
public abstract void setParameters(Collection parameters)
throws InvalidVariableException
- Description copied from interface:
Function
- A collection of the parameters used to configure your function. Each
parameter is a CompoundFunction and can be resolved by calling the
execute() method of the CompoundFunction (which should be done at
execution.)
- Specified by:
setParameters
in interface Function
- Parameters:
parameters
-
- Throws:
InvalidVariableException
- See Also:
Note: This may not be called (e.g. if no parameters are provided)
getReferenceKey
public abstract String getReferenceKey()
- Description copied from interface:
Function
- Return the name of your function. Convention is to prepend "__" to the
name (ie "__regexFunction")
- Specified by:
getReferenceKey
in interface Function
- See Also:
Function.getReferenceKey()
getVariables
protected JMeterVariables getVariables()
checkParameterCount
protected void checkParameterCount(Collection parameters,
int min,
int max)
throws InvalidVariableException
- Throws:
InvalidVariableException
Copyright © 1998-2007 Apache Software Foundation. All Rights Reserved.