Package step.core.artefacts.handlers
Class ArtefactHandler<ARTEFACT extends AbstractArtefact,REPORT_NODE extends ReportNode>
java.lang.Object
step.core.artefacts.handlers.ArtefactHandler<ARTEFACT,REPORT_NODE>
- Direct Known Subclasses:
AbstractSessionArtefactHandler
,AssertHandler
,CallFunctionHandler
,CallPlanHandler
,CaseHandler
,CheckArtefactHandler
,CheckHandler
,DataSetHandler
,EchoHandler
,ExportHandler
,FailureHandler
,FunctionGroupHandler
,IfBlockHandler
,PlaceholderHandler
,RetryIfFailsHandler
,ReturnHandler
,ScriptHandler
,SequenceHandler
,SetHandler
,SleepHandler
,StreamingArtefactHandler
,SwitchHandler
,SynchronizedHandler
,TestScenarioHandler
,TestSetHandler
,ThreadGroupHandler
,WhileHandler
public abstract class ArtefactHandler<ARTEFACT extends AbstractArtefact,REPORT_NODE extends ReportNode>
extends Object
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected abstract REPORT_NODE
createReportNode_
(ReportNode parentReportNode, ARTEFACT artefact) Creates theReportNode
corresponding to the provided artefactvoid
createReportSkeleton
(ReportNode parentReportNode, ARTEFACT artefact, Map<String, Object> newVariables) protected abstract void
createReportSkeleton_
(REPORT_NODE parentNode, ARTEFACT testArtefact) protected <T extends AbstractArtefact>
TcreateWorkArtefact
(Class<T> artefactClass, AbstractArtefact parentArtefact, String name) protected <T extends AbstractArtefact>
TcreateWorkArtefact
(Class<T> artefactClass, AbstractArtefact parentArtefact, String name, boolean copyChildren) protected <T extends AbstractArtefact>
TcreateWorkArtefact
(Class<T> artefactClass, AbstractArtefact parentArtefact, String name, boolean copyChildren, boolean persistNode) protected void
delegateCreateReportSkeleton
(AbstractArtefact artefact, ReportNode parentNode) protected void
delegateCreateReportSkeleton
(AbstractArtefact artefact, ReportNode parentNode, Map<String, Object> newVariables) protected ReportNode
delegateExecute
(AbstractArtefact artefact, ReportNode parentNode) protected ReportNode
delegateExecute
(AbstractArtefact artefact, ReportNode parentNode, Map<String, Object> newVariables) static List<AbstractArtefact>
excludePropertyChildren
(List<AbstractArtefact> children) protected abstract void
execute_
(REPORT_NODE reportNode, ARTEFACT artefact) Execute the provided artefact and report the execution to the provided report nodeprotected void
fail
(ReportNode node, String error) protected void
failWithException
(ReportNode result, String errorMsg, Throwable e, boolean generateAttachment) protected void
failWithException
(ReportNode result, Throwable e) protected void
failWithException
(ReportNode result, Throwable e, boolean generateAttachment) static List<AbstractArtefact>
filterPropertyChildren
(List<AbstractArtefact> children) getChildren
(AbstractArtefact artefact) static List<AbstractArtefact>
getChildren
(AbstractArtefact artefact, ExecutionContext context) void
init
(ExecutionContext context) void
initProperties
(ReportNode parentReportNode, ARTEFACT artefact) Before callingexecute_(ReportNode, AbstractArtefact)
for an artefact node N this method is called for each child of N which returns true onAbstractArtefact.isPropertyArefact()
.protected boolean
protected void
pruneReportBranch
(ReportNode reportNode) Prune the branch of the report tree starting from the provided reportNode.protected void
protected void
removeErrorContributionsInReportBranch
(ReportNode reportNode) Mark all errors of the branch starting from the provided reportNode as non-contributing.
-
Field Details
-
logger
protected static org.slf4j.Logger logger -
FILE_VARIABLE_PREFIX
- See Also:
-
FORCE_PERSIST_BEFORE
- See Also:
-
TEC_EXECUTION_REPORTNODES_PERSISTAFTER
- See Also:
-
TEC_EXECUTION_REPORTNODES_PERSISTBEFORE
- See Also:
-
TEC_EXECUTION_REPORTNODES_PERSISTONLYNONPASSED
- See Also:
-
context
-
-
Constructor Details
-
ArtefactHandler
public ArtefactHandler()
-
-
Method Details
-
init
-
createReportSkeleton
public void createReportSkeleton(ReportNode parentReportNode, ARTEFACT artefact, Map<String, Object> newVariables) -
createReportSkeleton_
-
execute
public ReportNode execute(REPORT_NODE parentReportNode, ARTEFACT artefact, Map<String, Object> newVariables) -
initProperties
Before callingexecute_(ReportNode, AbstractArtefact)
for an artefact node N this method is called for each child of N which returns true onAbstractArtefact.isPropertyArefact()
. This allow initialization of variables or properties before execution- Parameters:
parentReportNode
- the parentReportNode
artefact
- theAbstractArtefact
-
execute_
Execute the provided artefact and report the execution to the provided report node- Parameters:
reportNode
- theReportNode
corresponding to the artefactartefact
- theAbstractArtefact
to be executed- Throws:
Exception
-
delegateCreateReportSkeleton
-
delegateCreateReportSkeleton
protected void delegateCreateReportSkeleton(AbstractArtefact artefact, ReportNode parentNode, Map<String, Object> newVariables) -
delegateExecute
-
delegateExecute
protected ReportNode delegateExecute(AbstractArtefact artefact, ReportNode parentNode, Map<String, Object> newVariables) -
getBindings
-
removeErrorContributionsInReportBranch
Mark all errors of the branch starting from the provided reportNode as non-contributing. SeeReportNode.getContributingError()
for more details about error contribution- Parameters:
reportNode
- the root node of the branch
-
pruneReportBranch
Prune the branch of the report tree starting from the provided reportNode. This will remove the provided report node and all its children- Parameters:
reportNode
- the report node to be pruned
-
createReportNode_
Creates theReportNode
corresponding to the provided artefact- Parameters:
parentReportNode
- the parentReportNode
artefact
- the artefact to create the node for- Returns:
-
getChildren
-
getChildren
public static List<AbstractArtefact> getChildren(AbstractArtefact artefact, ExecutionContext context) -
filterPropertyChildren
-
excludePropertyChildren
-
createWorkArtefact
protected <T extends AbstractArtefact> T createWorkArtefact(Class<T> artefactClass, AbstractArtefact parentArtefact, String name) -
createWorkArtefact
protected <T extends AbstractArtefact> T createWorkArtefact(Class<T> artefactClass, AbstractArtefact parentArtefact, String name, boolean copyChildren, boolean persistNode) -
createWorkArtefact
protected <T extends AbstractArtefact> T createWorkArtefact(Class<T> artefactClass, AbstractArtefact parentArtefact, String name, boolean copyChildren) -
fail
-
failWithException
-
failWithException
-
failWithException
protected void failWithException(ReportNode result, String errorMsg, Throwable e, boolean generateAttachment) -
releaseTokens
protected void releaseTokens() -
isInSession
protected boolean isInSession()
-