Executor - S41nz/TBTAF GitHub Wiki
TBTAF Executor
Overview
This module receives the set of tests to execute and then launches their corresponding execution and collects the corresponding results to construct a given test report.
API Specification
ExecuteTests
-
Inputs:
- Reference of the TBTestSuite representing the set of tests that will be executed.
- Reference to the corresponding TBTestBed instance the test execution will be distributed.
- Optional collection of flags that can customize the execution of such TBTestSuite.
- Optional collection of ExecutorListener implementations that would want to listen and react to specific events during the execution of that specific TBTestSuite
-
Outputs:
- TBTAFResult object reporting the result of the execution.
-
Exceptions:
- In case of receiving null on any of their provided inputs, then an Invalid Argument Exception will be thrown.
- In case that the list contains a non-existing node then an Invalid Node Exception will be thrown.
- In case that the flag list contains non-supported flags then an Invalid Flag Exception will be thrown.
- In case the TBTestSuite is already executed.
GetStatus
-
Inputs:
- Reference to the TBTestSuite being executed.
-
Outputs:
- TBTAFExecutionStatus object that indicate the state of the execution and current progress made at the moment of call of the existing job assigned to the submitted TBTestSuite reference. This method prints the current status and also returns a TBTAFExecutionStatus object which can be used to get different result values independently. Find below the specification of TBTAFExecutionStatus class.
-
Exceptions:
- If the provided TBTestSuite reference is null or not present on the execution queue then an Invalid Argument Exception will be thrown.
AbortExecution
-
Inputs:
- Reference to the TBTestSuite which execution wants to be aborted.
- Optional Background flag that will instruct the execution to make a non-thread blocking call to start aborting all the tests that are currently being executed.
-
Outputs:
- TBTAFResult object containing the current result of the TBTestSuite until the point of execution abort.
-
Exceptions:
- If a null or not executing TBTestSuite is provided then an Invalid Argument Exception will be thrown.
PauseExecution
-
Inputs:
- Reference to the TBTestSuite which execution wants to be paused.
- Optional Background flag that will instruct the execution to make a non-thread blocking call to start pausing all the tests that are currently being executed.
-
Outputs:
- TBTAFResult object containing the current result of the TBTestSuite until the point of execution pause.
-
Exceptions:
- If a null or not executing TBTestSuite is provided then an Invalid Argument Exception will be thrown.
ResumeExecution
-
Inputs:
- Reference to the TBTestSuite which execution wants to be paused.
- Optional Background flag that will instruct the execution to make a non-thread blocking call to start resuming the execution of all the tests that are were executing.
-
Outputs:
- None
-
Exceptions:
- If a null or not executing TBTestSuite is provided then an Invalid Argument Exception will be thrown.
TBTAFExecutionStatus class
Overview
This class is used as a wrapper to contain the different result values that could be relevant to program other modules that depend on the execution results.
API Specification
getExecutionStatusType
- Inputs: None.
- Output:
- TBTAFExecutionStatusType enum which values could be: NON_STARTED, EXECUTING, PAUSED, ABORTED, COMPLETED, PAUSING, ABORTING.
getSuiteResult
- Inputs: None.
- Output:
- TBTAFResult object containing the current result of the TBTestSuite.
getCompletionPercentage
- Inputs: None.
- Output:
- Float value that indicates the execution completion percentage rounded to 2 decimals.
getTestCasesTotal
- Inputs: None.
- Output:
- Count of the amount of test cases in the current execution
getTestCasesExecuted
- Inputs: None.
- Output:
- Count of the amount of test cases already executed