Class BeanShellTestElement
- All Implemented Interfaces:
Serializable
,Cloneable
,Searchable
,org.apache.jmeter.testelement.TestElement
,TestStateListener
,ThreadListener
- Direct Known Subclasses:
BeanShellAssertion
,BeanShellListener
,BeanShellPostProcessor
,BeanShellPreProcessor
,BeanShellSampler
,BeanShellTimer
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.jmeter.testelement.TestElement
org.apache.jmeter.testelement.TestElement.Companion
-
Field Summary
Fields inherited from interface org.apache.jmeter.testelement.TestElement
COMMENTS, Companion, ENABLED, GUI_CLASS, NAME, TEST_CLASS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
protected BeanShellInterpreter
Get the interpreter and set up standard script variables.protected abstract String
Return the script (TestBean version).boolean
protected Object
Process the file or script from the test element.protected Object
processFileOrScript
(BeanShellInterpreter bsh, SampleResult sampleResult) Process the file or script from the test element.protected Object
void
void
void
setResetInterpreter
(boolean b) void
Set the script (TestBean version).void
Called once for all threads after the end of a test.void
Called once for all threads after the end of a test.void
Called just before the start of the test from the main engine thread.void
testStarted
(String host) Called just before the start of the test from the main engine thread.void
Called for each thread after all samples have been processed.void
Called for each thread before starting sampling.Methods inherited from class org.apache.jmeter.testelement.AbstractTestElement
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, getPropertyOrNull, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setEnabled, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.jmeter.testelement.TestElement
get, get, get, get, get, get, get, get, get, getOrCreate, getOrCreate, getOrNull, getOrNull, getOrNull, getPropertyOrNull, getProps, getSchema, getString, removed, removeProperty, set, set, set, set, set, set, set, set, set
-
Constructor Details
-
BeanShellTestElement
protected BeanShellTestElement()
-
-
Method Details
-
getInitFileProperty
-
getBeanShellInterpreter
Get the interpreter and set up standard script variables.Sets the following script variables:
- ctx
- Label
- prev
- props
- vars
- Returns:
- the interpreter
-
readResolve
-
clone
- Specified by:
clone
in interfaceorg.apache.jmeter.testelement.TestElement
- Overrides:
clone
in classAbstractTestElement
-
processFileOrScript
Process the file or script from the test element.Sets the following script variables:
- FileName
- Parameters
- bsh.args
- Parameters:
bsh
- the interpreter, notnull
- Returns:
- the result of the script, may be
null
- Throws:
JMeterException
- when working with the bsh fails
-
processFileOrScript
protected Object processFileOrScript(BeanShellInterpreter bsh, SampleResult sampleResult) throws JMeterException Process the file or script from the test element.Sets the following script variables:
- FileName
- Parameters
- bsh.args
- Parameters:
bsh
- the interpreter, notnull
sampleResult
- sampler result to setsetSamplerData
ornull
- Returns:
- the result of the script, may be
null
- Throws:
JMeterException
- when working with the bsh fails
-
getScript
Return the script (TestBean version). Must be overridden for subclasses that don't implement TestBean otherwise the clone() method won't work.- Returns:
- the script to execute
-
setScript
Set the script (TestBean version). Must be overridden for subclasses that don't implement TestBean otherwise the clone() method won't work.- Parameters:
s
- the script to execute (may be blank)
-
threadStarted
public void threadStarted()Description copied from interface:ThreadListener
Called for each thread before starting sampling. WARNING: this is called before any Config test elements are processed, so any properties they define will not have been merged in yet. See org.apache.jmeter.threads.JMeterThread#threadStarted()- Specified by:
threadStarted
in interfaceThreadListener
-
threadFinished
public void threadFinished()Description copied from interface:ThreadListener
Called for each thread after all samples have been processed. See org.apache.jmeter.threads.JMeterThread#threadFinished(org.apache.jmeter.engine.event.LoopIterationListener)- Specified by:
threadFinished
in interfaceThreadListener
-
testEnded
public void testEnded()Description copied from interface:TestStateListener
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testEnded
in interfaceTestStateListener
- See Also:
-
testEnded
Description copied from interface:TestStateListener
Called once for all threads after the end of a test. This will use the same element instances as at the start of the test.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testEnded
in interfaceTestStateListener
- Parameters:
host
- name of host- See Also:
-
testStarted
public void testStarted()Description copied from interface:TestStateListener
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testStarted
in interfaceTestStateListener
- See Also:
-
testStarted
Description copied from interface:TestStateListener
Called just before the start of the test from the main engine thread. This is before the test elements are cloned. Note that not all the test variables will have been set up at this point.
N.B. testStarted() and testEnded() are called from different threads.
- Specified by:
testStarted
in interfaceTestStateListener
- Parameters:
host
- name of host- See Also:
-
getParameters
-
setParameters
-
getFilename
-
setFilename
-
isResetInterpreter
public boolean isResetInterpreter() -
setResetInterpreter
public void setResetInterpreter(boolean b)
-