org.apache.jmeter.util
Class JSR223TestElement
java.lang.Object
org.apache.jmeter.testelement.AbstractTestElement
org.apache.jmeter.util.JSR223TestElement
- All Implemented Interfaces:
- Serializable, Cloneable, Searchable, TestElement
- Direct Known Subclasses:
- JSR223Assertion, JSR223Listener, JSR223PostProcessor, JSR223PreProcessor, JSR223Sampler, JSR223Timer
public abstract class JSR223TestElement
- extends AbstractTestElement
- implements Serializable, Cloneable
- See Also:
- Serialized Form
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, getSearchableTokens, getThreadContext, getThreadName, hashCode, isEnabled, isRunningVersion, isTemporary, logProperties, mergeIn, propertyIterator, recoverRunningVersion, removeProperty, setComment, setName, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setProperty, setRunningVersion, setTemporary, setThreadContext, setThreadName, traverse, traverseCollection, traverseMap, traverseProperty |
JSR223TestElement
public JSR223TestElement()
getInstance
public static javax.script.ScriptEngineManager getInstance()
- Returns:
- ScriptEngineManager singleton
readResolve
protected Object readResolve()
clone
public Object clone()
- Specified by:
clone
in interface TestElement
- Overrides:
clone
in class AbstractTestElement
getScriptEngine
protected javax.script.ScriptEngine getScriptEngine()
throws javax.script.ScriptException
- Throws:
javax.script.ScriptException
populateBindings
protected void populateBindings(javax.script.Bindings bindings)
- Populate variables to be passed to scripts
- Parameters:
bindings
- Bindings
processFileOrScript
protected Object processFileOrScript(javax.script.ScriptEngine scriptEngine,
javax.script.Bindings bindings)
throws IOException,
javax.script.ScriptException
- 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
- Parameters:
scriptEngine
- ScriptEnginebindings
- Bindings
might be null
- Returns:
- Object returned by script
- Throws:
IOException
javax.script.ScriptException
getScript
public String 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
public void setScript(String s)
- 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)
getParameters
public String getParameters()
setParameters
public void setParameters(String s)
getFilename
public String getFilename()
setFilename
public void setFilename(String s)
getScriptLanguage
public String getScriptLanguage()
setScriptLanguage
public void setScriptLanguage(String s)
Copyright © 1998-2012 Apache Software Foundation. All Rights Reserved.