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:
  java.lang.Comparable, IAdaptable, IDebugEngine, IScriptEngine

    public class TestSuiteScriptEngine
    extends AbstractScriptEngine
    implements IDebugEngine

Script engine executing *.suite files and `ITestEntity` elements.

### Field Summary

Fields
`static java.lang.String` `ENGINE_ID`
`static java.lang.String` `TEST_FILE_VARIABLE` Name of variable to be injected into executing test engines.
`static java.lang.String` `TEST_SUITE_VARIABLE`

### Fields inherited from class org.eclipse.core.runtime.jobs.Job

`ASYNC_FINISH, BUILD, DECORATE, INTERACTIVE, LONG, NONE, RUNNING, SHORT, SLEEPING, WAITING`

### Fields inherited from interface org.eclipse.ease.IScriptEngine

`TRACE_SCRIPT_ENGINE`

### Constructor Summary

Constructors
Constructor and Description
`TestSuiteScriptEngine()`

### Method Summary

All Methods Instance Methods Concrete Methods
`IScriptEngine` `createScriptEngine(ITestSuite testSuite, java.lang.Object resource)` Create a script engine for a given testsuite and resource.
`ScriptStackTrace` `getExceptionStackTrace()` Get the stack trace of the last thrown exception of the current thread.
`ScriptStackTrace` `getExceptionStackTrace(java.lang.Object thread)` Get the stack trace of the last thrown exception of the given thread.
`ITestContainer` `getTestRoot()` Get the root container for all executed test entities.
`java.util.Collection<EaseDebugVariable>` `getVariables(java.lang.Object scope)` Get variables within a specific scope or child elements for a given object
`void` `registerJar(java.net.URL url)` Register a jar file and add it to the classpath.
`java.lang.Object` `removeVariable(java.lang.String name)` Remove a variable from the scope.
`void` `setupDebugger(ILaunch launch, boolean suspendOnStartup, boolean suspendOnScriptLoad, boolean showDynamicCode)`
`void` `terminate()` Terminate this interpreter.
`void` `terminateCurrent()` Stops the currently executed piece of code.

### Methods inherited from class org.eclipse.ease.AbstractScriptEngine

`addExecutionListener, addSecurityCheck, executeAsync, executeSync, extractArguments, getCurrentScriptEngine, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, getOutputStream, getStackTrace, getVariable, getVariables, hasVariable, inject, injectUI, isFinished, join, removeExecutionListener, removeSecurityCheck, setCloseStreamsOnTerminate, setEngineDescription, setErrorStream, setExecutionRootFile, setInputStream, setLaunch, setOutputStream, setVariable`

### Methods inherited from class org.eclipse.core.runtime.jobs.Job

`addJobChangeListener, belongsTo, cancel, create, create, createSystem, 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, yieldRule`

### Methods inherited from class org.eclipse.core.internal.jobs.InternalJob

`compareTo`

### Methods inherited from class org.eclipse.core.runtime.PlatformObject

`getAdapter`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

### Methods inherited from interface org.eclipse.ease.IDebugEngine

`getStackTrace`

### Methods inherited from interface org.eclipse.ease.IScriptEngine

`addExecutionListener, addSecurityCheck, executeAsync, executeSync, getDescription, getErrorStream, getExecutedFile, getInputStream, getLaunch, getMonitor, getName, getOutputStream, getVariable, getVariables, hasVariable, inject, injectUI, isFinished, join, removeExecutionListener, removeSecurityCheck, schedule, setCloseStreamsOnTerminate, setErrorStream, setInputStream, setOutputStream, setVariable`

### Methods inherited from interface org.eclipse.core.runtime.IAdaptable

`getAdapter`

### Field Detail

#### ENGINE_ID

    public static final java.lang.String ENGINE_ID

See Also:
  Constant Field Values

#### TEST_FILE_VARIABLE

    public static final java.lang.String TEST_FILE_VARIABLE

Name of variable to be injected into executing test engines.

See Also:
  Constant Field Values

#### TEST_SUITE_VARIABLE

    public static final java.lang.String TEST_SUITE_VARIABLE

See Also:
  Constant Field Values

### Constructor Detail

#### TestSuiteScriptEngine

    public TestSuiteScriptEngine()

### Method Detail

#### terminateCurrent

    public void terminateCurrent()

Description copied from interface: `IScriptEngine`
Stops the currently executed piece of code. Will continue to execute the next scheduled piece of code.

Specified by:
  `terminateCurrent` in interface `IScriptEngine`

#### registerJar

    public void registerJar(java.net.URL url)

Description copied from interface: `IScriptEngine`
Register a jar file and add it to the classpath. After registering, classes within the jar file shall be usable within the script.

Specified by:
  `registerJar` in interface `IScriptEngine`
Parameters:
  `url` - url to load jar file from

#### removeVariable

    public java.lang.Object removeVariable(java.lang.String name)

Description copied from interface: `IDebugEngine`
Remove a variable from the scope.

Specified by:
  `removeVariable` in interface `IDebugEngine`
Parameters:
  `name` - variable to be removed.
Returns:

#### setupDebugger

    public void setupDebugger(ILaunch launch,
                              boolean suspendOnStartup,
                              boolean suspendOnScriptLoad,
                              boolean showDynamicCode)

Specified by:
  `setupDebugger` in interface `IDebugEngine`

#### getTestRoot

    public ITestContainer 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

    public ScriptStackTrace getExceptionStackTrace()

Description copied from interface: `IDebugEngine`
Get 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:
  `getExceptionStackTrace` in interface `IDebugEngine`
Returns:
  last exception stack trace or `null`

#### getExceptionStackTrace

    public ScriptStackTrace getExceptionStackTrace(java.lang.Object thread)

Description copied from interface: `IDebugEngine`
Get 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:
  `getExceptionStackTrace` in interface `IDebugEngine`
Parameters:
  `thread` - thread to get last exception stacktrace from
Returns:
  last exception stack trace or `null`

#### terminate

    public void terminate()

Description copied from interface: `IScriptEngine`
Terminate this interpreter. Addresses a request to terminate current script execution. When the request will be handled is implementation specific.

Specified by:
  `terminate` in interface `IScriptEngine`
Overrides:
  `terminate` in class `AbstractScriptEngine`

#### createScriptEngine

    public IScriptEngine createScriptEngine(ITestSuite testSuite,
                                            java.lang.Object resource)

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 or `null`
  `resource` - resource to execute or `null`
Returns:
  script engine or `null`

#### getVariables

    public java.util.Collection<EaseDebugVariable> getVariables(java.lang.Object scope)

Description copied from interface: `IDebugEngine`
Get variables within a specific scope or child elements for a given object

Specified by:
  `getVariables` in interface `IDebugEngine`
Parameters:
  `scope` - scope or parent object
Returns:
  variables assigned to scope