public class MockExecutionContext extends AbstractExecutionContext
ExecutionContext
which should be
used for testing. By default it uses MockNamespace
as a
Namespace
implementation, but you can provide your own
Namespace
which will be used.Constructor and Description |
---|
MockExecutionContext()
Creates new instance with a
MockNamespace as a Namespace
implementation, no parent context, 0L as the context id and no
ContextModelElement . |
MockExecutionContext(Namespace namespace)
Creates new instance with no parent context, 0L as the context id and no
ContextModelElement . |
MockExecutionContext(Namespace namespace,
ExecutionContext parentContext,
long contextId,
com.whitestein.lsps.model.ContextModelElement element)
Creates new instance.
|
Modifier and Type | Method and Description |
---|---|
void |
addExecutionTrace(ExecutionTrace et)
Adds ExecutionTrace to the context.
|
void |
addExecutionTraceElement(ExecutionTraceElement e)
Adds ExecutionTraceElement to the context.
|
void |
addSignal(Object signal)
Adds a signal to the signal queue.
|
void |
flushAll()
Flush of all sessions (core, org, human,...
|
CompiledContext |
getCompiled()
Returns compiled context.
|
CompiledContext |
getCompiled(String moduleName)
Returns compiled context of the module
|
ComponentService |
getComponentService()
Returns component service
|
long |
getContextId()
Returns the context id.
|
RuntimeToPersistentConverter |
getConverter()
Returns converter.
|
String |
getEvaluationLevel()
Returns evaluation level.
|
ExecutionTrace |
getExecutionTrace() |
Handle |
getHandle(ValueHolder valueHolder)
Returns a serializable handle for the given value-holder.
|
com.whitestein.lsps.model.ContextModelElement |
getModelElement()
Returns the corresponding context model element.
|
ModelInstance |
getModelInstance()
Returns the model instance.
|
ModelProvider |
getModelProvider()
Returns model provider.
|
Namespace |
getNamespace()
Returns namespace associated with this context.
|
protected NamespaceModel |
getNamespaceModel()
Returns namespace model for this context.
|
ExecutionContext |
getParentContext()
Returns the parent execution context or null if it does not exist.
|
String |
getPath()
Returns the full path to this context as a string.
|
QID |
getPathQID()
Returns the full path to this context as a QID.
|
ProcessInstance |
getProcessInstance()
Returns the process instance.
|
com.whitestein.lsps.model.ProcessModel |
getProcessModel()
Returns the process model.
|
String |
getProcessPath()
Returns the full path to model element that is bound to this context.
|
QID |
getProcessPathQID()
Returns the full path to model element that is bound to this context.
|
ValueHolder |
getValueHolder(Handle handle)
Returns a value-holder for the given handle.
|
void |
setCompiled(CompiledContext compiledContext)
Sets compiled context.
|
void |
setModelInstance(ModelInstance modelInstance)
Sets the model instance.
|
void |
setProcessInstance(ProcessInstance processInstance)
Sets the process instance.
|
void |
setProcessModel(com.whitestein.lsps.model.ProcessModel processModel)
Sets the process model
|
getStackTrace, getStackTraceInfo, getVariableValue, getVariableValue, resolveVariableNamespace, resolveVariableNamespace, setVariableValue, setVariableValue, toString
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getInLevel
public MockExecutionContext()
MockNamespace
as a Namespace
implementation, no parent context, 0L as the context id and no
ContextModelElement
.public MockExecutionContext(Namespace namespace)
ContextModelElement
.namespace
- NullPointerException
- if namespace
is nullpublic MockExecutionContext(Namespace namespace, ExecutionContext parentContext, long contextId, com.whitestein.lsps.model.ContextModelElement element)
namespace
- parentContext
- contextId
- element
- NullPointerException
- if namespace
is nullpublic Namespace getNamespace()
ExecutionContext
protected NamespaceModel getNamespaceModel()
AbstractExecutionContext
getNamespaceModel
in class AbstractExecutionContext
public void addSignal(Object signal)
ExecutionContext
public com.whitestein.lsps.model.ContextModelElement getModelElement()
ExecutionContext
public long getContextId()
ExecutionContext
public ExecutionContext getParentContext()
ExecutionContext
public Handle getHandle(ValueHolder valueHolder)
HandleResolver
HandleResolver.getValueHolder(Handle)
.valueHolder
- the value-holderpublic ValueHolder getValueHolder(Handle handle)
HandleResolver
handle
- the handlepublic String getPath()
ExecutionContext
public QID getPathQID()
ExecutionContext
public String getProcessPath()
ExecutionContext
public QID getProcessPathQID()
ExecutionContext
public ModelInstance getModelInstance()
ExecutionContext
public void setModelInstance(ModelInstance modelInstance)
modelInstance
- the model instancepublic ProcessInstance getProcessInstance()
ExecutionContext
public void setProcessInstance(ProcessInstance processInstance)
processInstance
- the process instancepublic com.whitestein.lsps.model.ProcessModel getProcessModel()
ExecutionContext
public void setProcessModel(com.whitestein.lsps.model.ProcessModel processModel)
processModel
- the process modelpublic void flushAll()
ExecutionContext
public String getEvaluationLevel()
ExecutionContext
public void addExecutionTraceElement(ExecutionTraceElement e)
TraceableExecution
ExecutionTrace
and
ExecutionTraceElement
.e
- ExecutionTraceElement to be added.public void addExecutionTrace(ExecutionTrace et)
TraceableExecution
ExecutionTrace
and
ExecutionTraceElement
.et
- ExecutionTrace to be added.public ExecutionTrace getExecutionTrace()
ExecutionTrace
and
ExecutionTraceElement
.public CompiledContext getCompiled()
ExecutionContext
public void setCompiled(CompiledContext compiledContext)
ExecutionContext
public CompiledContext getCompiled(String moduleName)
ExecutionContext
public ModelProvider getModelProvider()
ExecutionContext
public ComponentService getComponentService()
ExecutionContext
public RuntimeToPersistentConverter getConverter()
ExecutionContext
Copyright © 2007-2020 Whitestein Technologies. All Rights Reserved.