Package org.eclipse.ease.lang.unittest
Class TestSuiteScriptEngine
java.lang.Object
org.eclipse.core.runtime.PlatformObject
org.eclipse.core.internal.jobs.InternalJob
org.eclipse.core.runtime.jobs.Job
org.eclipse.ease.AbstractScriptEngine
org.eclipse.ease.lang.unittest.TestSuiteScriptEngine
- All Implemented Interfaces:
Comparable,org.eclipse.core.runtime.IAdaptable,IDebugEngine,IScriptEngine
public class TestSuiteScriptEngine extends AbstractScriptEngine implements IDebugEngine
Script engine executing *.suite files and
ITestEntity elements.-
Field Summary
Fields Modifier and Type Field Description static StringENGINE_IDstatic StringTEST_FILE_VARIABLEName of variable to be injected into executing test engines.static StringTEST_SUITE_VARIABLEFields inherited from class org.eclipse.core.runtime.jobs.Job
ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITINGFields inherited from interface org.eclipse.ease.IScriptEngine
TRACE_SCRIPT_ENGINE -
Constructor Summary
Constructors Constructor Description TestSuiteScriptEngine() -
Method Summary
Modifier and Type Method Description IScriptEnginecreateScriptEngine(ITestSuite testSuite, Object resource)Create a script engine for a given testsuite and resource.ScriptStackTracegetExceptionStackTrace()Get the stack trace of the last thrown exception of the current thread.ScriptStackTracegetExceptionStackTrace(Object thread)Get the stack trace of the last thrown exception of the given thread.ITestContainergetTestRoot()Get the root container for all executed test entities.Collection<EaseDebugVariable>getVariables(Object scope)Get variables within a specific scope or child elements for a given object.voidregisterJar(URL url)Register a jar file and add it to the classpath.ObjectremoveVariable(String name)Remove a variable from the scope.voidsetupDebugger(org.eclipse.debug.core.ILaunch launch, boolean suspendOnStartup, boolean suspendOnScriptLoad, boolean showDynamicCode)voidterminate()Terminate this interpreter.voidterminateCurrent()Stops the currently executed piece of code.Methods inherited from class org.eclipse.ease.AbstractScriptEngine
addExecutionListener, addSecurityCheck, execute, getCurrentScriptEngine, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, getOutputStream, getStackTrace, getVariable, getVariables, hasVariable, inject, isFinished, joinEngine, joinEngine, removeExecutionListener, setCloseStreamsOnTerminate, setEngineDescription, setErrorStream, setExecutionRootFile, setInputStream, setLaunch, setOutputStream, setVariableMethods inherited from class org.eclipse.core.runtime.jobs.Job
addJobChangeListener, belongsTo, cancel, create, create, createSystem, createSystem, done, getJobGroup, getJobManager, getName, getPriority, getProperty, getResult, getRule, getState, getThread, isBlocking, isSystem, isUser, join, join, removeJobChangeListener, schedule, schedule, setJobGroup, setName, setPriority, setProgressGroup, setProperty, setRule, setSystem, setThread, setUser, shouldRun, shouldSchedule, sleep, toString, wakeUp, wakeUp, yieldRuleMethods inherited from class org.eclipse.core.internal.jobs.InternalJob
compareToMethods inherited from class org.eclipse.core.runtime.PlatformObject
getAdapterMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.ease.IDebugEngine
getStackTraceMethods inherited from interface org.eclipse.ease.IScriptEngine
addExecutionListener, addSecurityCheck, execute, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, getName, getOutputStream, getVariable, getVariables, hasVariable, inject, isFinished, joinEngine, joinEngine, removeExecutionListener, schedule, setCloseStreamsOnTerminate, setErrorStream, setInputStream, setOutputStream, setVariable
-
Field Details
-
ENGINE_ID
- See Also:
- Constant Field Values
-
TEST_FILE_VARIABLE
Name of variable to be injected into executing test engines.- See Also:
- Constant Field Values
-
TEST_SUITE_VARIABLE
- See Also:
- Constant Field Values
-
-
Constructor Details
-
TestSuiteScriptEngine
public TestSuiteScriptEngine()
-
-
Method Details
-
terminateCurrent
public void terminateCurrent()Description copied from interface:IScriptEngineStops the currently executed piece of code. Will continue to execute the next scheduled piece of code.- Specified by:
terminateCurrentin interfaceIScriptEngine
-
registerJar
Description copied from interface:IScriptEngineRegister a jar file and add it to the classpath. After registering, classes within the jar file shall be usable within the script.- Specified by:
registerJarin interfaceIScriptEngine- Parameters:
url- url to load jar file from
-
removeVariable
Description copied from interface:IDebugEngineRemove a variable from the scope.- Specified by:
removeVariablein interfaceIDebugEngine- Parameters:
name- variable to be removed.- Returns:
- variable content
-
setupDebugger
public void setupDebugger(org.eclipse.debug.core.ILaunch launch, boolean suspendOnStartup, boolean suspendOnScriptLoad, boolean showDynamicCode)- Specified by:
setupDebuggerin interfaceIDebugEngine
-
getTestRoot
Get the root container for all executed test entities. This container gets created once and remains constant for the whole lifecycle of this engine. Its child elements may change however depending on what entities get executed.- Returns:
- root container
-
getExceptionStackTrace
Description copied from interface:IDebugEngineGet the stack trace of the last thrown exception of the current thread. Will be populated when an exception is thrown by the script engine. Can be evaluated in a try/catch statement within the script. Only available during script runtime.- Specified by:
getExceptionStackTracein interfaceIDebugEngine- Returns:
- last exception stack trace or
null
-
getExceptionStackTrace
Description copied from interface:IDebugEngineGet the stack trace of the last thrown exception of the given thread. Will be populated when an exception is thrown by the script engine. Can be evaluated in a try/catch statement within the script. Only available during script runtime.- Specified by:
getExceptionStackTracein interfaceIDebugEngine- Parameters:
thread- thread to get last exception stacktrace from- Returns:
- last exception stack trace or
null
-
terminate
public void terminate()Description copied from interface:IScriptEngineTerminate this interpreter. Addresses a request to terminate current script execution. When the request will be handled is implementation specific.- Specified by:
terminatein interfaceIScriptEngine- Overrides:
terminatein classAbstractScriptEngine
-
createScriptEngine
Create a script engine for a given testsuite and resource. The testsuite might provide information on the default engine to use. The resource might need a different engine to execute.- Parameters:
testSuite- testsuite to be executed from ornullresource- resource to execute ornull- Returns:
- script engine or
null
-
getVariables
Description copied from interface:IDebugEngineGet variables within a specific scope or child elements for a given object.- Specified by:
getVariablesin interfaceIDebugEngine- Parameters:
scope- scope or parent object- Returns:
- variables assigned to scope
-