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:

    1. Reference of the TBTestSuite representing the set of tests that will be executed.
    2. Reference to the corresponding TBTestBed instance the test execution will be distributed.
    3. Optional collection of flags that can customize the execution of such TBTestSuite.
    4. Optional collection of ExecutorListener implementations that would want to listen and react to specific events during the execution of that specific TBTestSuite
  • Outputs:

    1. TBTAFResult object reporting the result of the execution.
  • Exceptions:

    1. In case of receiving null on any of their provided inputs, then an Invalid Argument Exception will be thrown.
    2. In case that the list contains a non-existing node then an Invalid Node Exception will be thrown.
    3. In case that the flag list contains non-supported flags then an Invalid Flag Exception will be thrown.
    4. In case the TBTestSuite is already executed.

GetStatus

  • Inputs:

    1. Reference to the TBTestSuite being executed.
  • Outputs:

    1. 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:

    1. If the provided TBTestSuite reference is null or not present on the execution queue then an Invalid Argument Exception will be thrown.

AbortExecution

  • Inputs:

    1. Reference to the TBTestSuite which execution wants to be aborted.
    2. 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:

    1. TBTAFResult object containing the current result of the TBTestSuite until the point of execution abort.
  • Exceptions:

    1. If a null or not executing TBTestSuite is provided then an Invalid Argument Exception will be thrown.

PauseExecution

  • Inputs:

    1. Reference to the TBTestSuite which execution wants to be paused.
    2. 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:

    1. TBTAFResult object containing the current result of the TBTestSuite until the point of execution pause.
  • Exceptions:

    1. If a null or not executing TBTestSuite is provided then an Invalid Argument Exception will be thrown.

ResumeExecution

  • Inputs:

    1. Reference to the TBTestSuite which execution wants to be paused.
    2. 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:

    1. None
  • Exceptions:

    1. 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:
    1. TBTAFExecutionStatusType enum which values could be: NON_STARTED, EXECUTING, PAUSED, ABORTED, COMPLETED, PAUSING, ABORTING.

getSuiteResult

  • Inputs: None.
  • Output:
    1. TBTAFResult object containing the current result of the TBTestSuite.

getCompletionPercentage

  • Inputs: None.
  • Output:
    1. Float value that indicates the execution completion percentage rounded to 2 decimals.

getTestCasesTotal

  • Inputs: None.
  • Output:
    1. Count of the amount of test cases in the current execution

getTestCasesExecuted

  • Inputs: None.
  • Output:
    1. Count of the amount of test cases already executed