FunctionBeanShell, CharFunction, CSVRead, EscapeHtml, EscapeOroRegexpChars, EvalFunction, EvalVarFunction, FileToString, IntSum, IterationCounter, JavaScript, Jexl2Function, JexlFunction, LogFunction, LogFunction2, LongSum, MachineIP, MachineName, Property, Property2, Random, RandomString, RegexFunction, SamplerName, SetProperty, SplitFunction, StringFromFile, TestPlanName, ThreadNumber, TimeFunction, UnEscape, UnEscapeHtml, UrlDecode, UrlEncode, Uuid, Variable, XPathpublic abstract class AbstractFunction extends Object implements Function
| Constructor | Description |
|---|---|
AbstractFunction() |
| Modifier and Type | Method | Description |
|---|---|---|
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. execute() should be synchronized if function is operating with non-thread-safe
objects (e.g. operates with files).
|
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)
|
getArgumentDescpublic 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 incorrectCopyright © 1998-2018 Apache Software Foundation. All Rights Reserved.