public abstract class AbstractFunction extends Object implements Function
| Constructor and Description |
|---|
AbstractFunction() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addVariableValue(String value,
CompoundVariable[] values,
int index)
Utility method to store value in a variable
|
protected void |
checkMinParameterCount(Collection<CompoundVariable> parameters,
int minimum)
Utility method to check parameter counts.
|
protected void |
checkParameterCount(Collection<CompoundVariable> parameters,
int count)
Utility method to check parameter counts.
|
protected void |
checkParameterCount(Collection<CompoundVariable> parameters,
int min,
int max)
Utility method to check parameter counts.
|
String |
execute() |
abstract String |
execute(SampleResult previousResult,
Sampler currentSampler)
N.B.
|
abstract String |
getReferenceKey()
Return the name of your function.
|
protected JMeterVariables |
getVariables()
Gives access to the JMeter variables for the current thread.
|
abstract void |
setParameters(Collection<CompoundVariable> parameters)
Note: This is always called even if no parameters are provided
(versions of JMeter after 2.3.1)
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetArgumentDescpublic abstract String execute(SampleResult previousResult, Sampler currentSampler) throws InvalidVariableException
N.B. execute() should be synchronized if function is operating with non-thread-safe objects (e.g. operates with files).
JMeter ensures setParameters() happens-before execute(): setParameters is executed in main thread, and worker threads are started after that.execute in interface FunctionpreviousResult - The previous SampleResultcurrentSampler - The current SamplerInvalidVariableException - - when the variables for the function call can't be evaluatedFunction.execute(SampleResult, Sampler)public String execute() throws InvalidVariableException
InvalidVariableExceptionpublic abstract void setParameters(Collection<CompoundVariable> parameters) throws InvalidVariableException
setParameters in interface Functionparameters - The parameters for the function callInvalidVariableException - - when the variables for the function call can't be evaluatedFunction.setParameters(Collection)public abstract String getReferenceKey()
FunctiongetReferenceKey in interface FunctionFunction.getReferenceKey()protected JMeterVariables getVariables()
protected void checkParameterCount(Collection<CompoundVariable> parameters, int min, int max) throws InvalidVariableException
parameters - collection of parametersmin - minimum number of parameters allowedmax - maximum number of parameters allowedInvalidVariableException - if the number of parameters is incorrectprotected void checkParameterCount(Collection<CompoundVariable> parameters, int count) throws InvalidVariableException
parameters - collection of parameterscount - number of parameters expectedInvalidVariableException - if the number of parameters is incorrectprotected void checkMinParameterCount(Collection<CompoundVariable> parameters, int minimum) throws InvalidVariableException
parameters - collection of parametersminimum - number of parameters expectedInvalidVariableException - if the number of parameters is incorrectprotected final void addVariableValue(String value, CompoundVariable[] values, int index)
value - value of variable to updatevalues - array of CompoundVariable from which variable name
will be extractedindex - index of variable in values arrayCopyright © 1998-2019 Apache Software Foundation. All Rights Reserved.