public class ScriptRule extends Object implements org.junit.rules.TestRule
TestRule to load and execute a script. To
execute a ScriptEngine ClassRule
is used to obtain a ScriptEngine.| Modifier and Type | Field and Description |
|---|---|
protected Map<String,Object> |
variables
The variables of the script accessed during script execution.
|
| Constructor and Description |
|---|
ScriptRule() |
| Modifier and Type | Method and Description |
|---|---|
org.junit.runners.model.Statement |
apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description) |
ScriptRule |
execute()
Execute the script
|
ScriptRule |
execute(Map<String,Object> scriptVariables)
Execute the script and add the given variables to the script variables.
|
<T> T |
getVariable(String name)
Returns the value of a named script variable
|
ScriptRule |
setVariable(String name,
Object value)
Set the variable with the given name
|
protected void |
tearDownVariables() |
public org.junit.runners.model.Statement apply(org.junit.runners.model.Statement base,
org.junit.runner.Description description)
apply in interface org.junit.rules.TestRuleprotected void tearDownVariables()
public ScriptRule execute(Map<String,Object> scriptVariables)
scriptVariables - the variables to set additionallySpinScriptException - if an error occurs during the script executionpublic ScriptRule execute()
SpinScriptException - if an error occurs during the script executionpublic <T> T getVariable(String name)
name - the name of the variablepublic ScriptRule setVariable(String name, Object value)
name - the name of the variablevalue - value of the variableCopyright © 2014–2020 Camunda Services GmbH. All rights reserved.