public abstract class JSR223TestElement extends ScriptingTestElement implements java.io.Serializable, TestStateListener
DEFAULT_SCRIPT_LANGUAGE, scriptLanguageCOMMENTS, ENABLED, GUI_CLASS, NAME, TEST_CLASS| Constructor and Description |
|---|
JSR223TestElement() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getCacheKey() |
static javax.script.ScriptEngineManager |
getInstance() |
protected javax.script.ScriptEngine |
getScriptEngine() |
java.lang.String |
getScriptLanguage() |
protected void |
populateBindings(javax.script.Bindings bindings)
Populate variables to be passed to scripts
|
protected java.lang.Object |
processFileOrScript(javax.script.ScriptEngine scriptEngine,
javax.script.Bindings bindings)
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(java.lang.String cacheKey) |
void |
setScriptLanguage(java.lang.String s) |
void |
testEnded()
Called once for all threads after the end of a test.
|
void |
testEnded(java.lang.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(java.lang.String host)
Called just before the start of the test from the main engine thread.
|
getFilename, getParameters, getScript, isStopCondition, setFilename, setParameters, setScriptaddPropertiesValues, 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, traversePropertyfinalize, getClass, notify, notifyAll, toString, wait, wait, waitremovedpublic static javax.script.ScriptEngineManager getInstance()
protected javax.script.ScriptEngine getScriptEngine()
throws javax.script.ScriptException
ScriptEngine for language defaulting to groovy if language is not setjavax.script.ScriptException - when no ScriptEngine could be foundprotected void populateBindings(javax.script.Bindings bindings)
bindings - Bindingsprotected java.lang.Object processFileOrScript(javax.script.ScriptEngine scriptEngine,
javax.script.Bindings bindings)
throws java.io.IOException,
javax.script.ScriptException
scriptEngine - ScriptEnginebindings - Bindings might be nulljava.io.IOException - when reading the script failsjavax.script.ScriptException - when compiling or evaluation of the script failspublic java.lang.String getCacheKey()
public void setCacheKey(java.lang.String cacheKey)
cacheKey - the cacheKey to setpublic void testStarted()
TestStateListenerCalled 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 TestStateListenerTestStateListener.testStarted()public void testStarted(java.lang.String host)
TestStateListenerCalled 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 TestStateListenerhost - name of hostTestStateListener.testStarted(java.lang.String)public void testEnded()
TestStateListenerCalled 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 TestStateListenerTestStateListener.testEnded()public void testEnded(java.lang.String host)
TestStateListenerCalled 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 TestStateListenerhost - name of hostTestStateListener.testEnded(java.lang.String)public java.lang.String getScriptLanguage()
public void setScriptLanguage(java.lang.String s)
Copyright © 1998-2018 Apache Software Foundation. All Rights Reserved.