public abstract class JSR223TestElement extends ScriptingTestElement implements Serializable, TestStateListener
DEFAULT_SCRIPT_LANGUAGE, scriptLanguage
COMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS
Constructor and Description |
---|
JSR223TestElement() |
Modifier and Type | Method and Description |
---|---|
boolean |
compile() |
String |
getCacheKey() |
static ScriptEngineManager |
getInstance() |
protected ScriptEngine |
getScriptEngine() |
String |
getScriptLanguage() |
protected void |
populateBindings(Bindings bindings)
Populate variables to be passed to scripts
|
protected Object |
processFileOrScript(ScriptEngine scriptEngine,
Bindings pBindings)
This method will run inline script or file script with special behaviour for file script:
- If ScriptEngine implements Compilable script will be compiled and cached
- If not if will be run
|
void |
setCacheKey(String cacheKey) |
void |
setScriptLanguage(String s) |
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(String host)
Called once for all threads after the end of a test.
|
void |
testStarted()
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.
|
getFilename, getParameters, getScript, isStopCondition, setFilename, setParameters, setScript
addPropertiesValues, addProperty, addProperty, addTestElement, canRemove, clear, clearTemporary, clearTestElementChildren, clone, emptyTemporary, equals, getComment, getName, getProperty, getPropertyAsBoolean, getPropertyAsBoolean, getPropertyAsDouble, getPropertyAsFloat, getPropertyAsInt, getPropertyAsInt, getPropertyAsLong, getPropertyAsLong, getPropertyAsString, getPropertyAsString, 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
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
removed
public static ScriptEngineManager getInstance()
protected ScriptEngine getScriptEngine() throws ScriptException
ScriptEngine
for language defaulting to groovy if language is not setScriptException
- when no ScriptEngine
could be foundprotected void populateBindings(Bindings bindings)
bindings
- Bindingsprotected Object processFileOrScript(ScriptEngine scriptEngine, Bindings pBindings) throws IOException, ScriptException
scriptEngine
- ScriptEnginepBindings
- Bindings
might be nullIOException
- when reading the script failsScriptException
- when compiling or evaluation of the script failspublic boolean compile() throws ScriptException, IOException
IOException
- if script is missingScriptException
- if compilation failspublic String getCacheKey()
public void setCacheKey(String cacheKey)
cacheKey
- the cacheKey to setpublic void testStarted()
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.
testStarted
in interface TestStateListener
TestStateListener.testStarted()
public void testStarted(String host)
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.
testStarted
in interface TestStateListener
host
- name of hostTestStateListener.testStarted(java.lang.String)
public void testEnded()
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.
testEnded
in interface TestStateListener
TestStateListener.testEnded()
public void testEnded(String host)
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.
testEnded
in interface TestStateListener
host
- name of hostTestStateListener.testEnded(java.lang.String)
public String getScriptLanguage()
public void setScriptLanguage(String s)
Copyright © 1998-2019 Apache Software Foundation. All Rights Reserved.