Foundation Classes - S41nz/TBTAF GitHub Wiki

Overview

This section provides a description of the foundation classes used across the different modules within the TBTAF. Such classes provides both code and design reuse for:

  • Test code generation
  • Test code execution
  • Code metadata creation and management.
  • Test verdict management

Specification

TBTestCase

Overview

Interface which every test case should implement in order to be executed by TBTAF.

Methods Specification

  • setup()
  • execute()
  • verdict()
  • cleanup()
  • getResult():TBTAFResult
  • getTestLog():TBTAFTrace
  • getMetadata():TBMetaData
  • setMetadata(TBMetaData)
  • Timeout attribute

TBTestSuite

Overview

Classic concept of test suite. Basically a rigid collection of tests that are manually grouped under a given criteria and will get executed once that the test suite gets submitted to the Executor module

Methods Specification

  • getSuiteResult():TBTAFResult
  • addTestCase(TBTestCase)
  • addTestCaseList(newTestCaseList [])
  • clearTestCaseList()
  • getTestCases():TBTestCase[]
  • getSuiteTrace():TBTAFTrace[]
  • getTestSuiteType(): (NORMAL,SMART)

TBSmartTestSuite

Overview

Subclass similar to the test suite but the difference is that this will act as a pool on which only the tests with specific tags or the absence of specific tags will get executed. This suites will be usually mapped to test code locations or repos.

Methods Specification

  • getSuiteResult(Tags [],FilterOption)
  • addTestCase(TBTestCase)
  • getTestCases(Tags [],FilterOption):TBTestCase[]
  • getSuiteTrace():TBTAFTrace[]

TBTestNode

Overview

Class that contains the information of a given node that could serve to execute a given set of TBTestCases

Methods Specification

  • getNodeURL()
  • getNodeStatus():NodeStatusType(NOT_INITIALIZED,ONLINE,OFFLINE,BUSY)
  • setNodeStatus(NodeStatusType)

TBTestBed

Overview

Class that encapsulates the information required to create and manage the infrastructure required for test content execution

Methods Specification

  • addExecutionNode(Node URL)
  • removeExecutionNode(Node URL)
  • getTestBedNodes():TBTestNode[]
  • getTestBedNode(Node URL):TBTestNode

TBTAFEvent

Overview

Basic element of the trace of any given test.

Methods Specification

  • getTimestamp():Timestamp
  • getEventType():EventType (INFO,WARNING,FATAL)
  • getEventSource(): String
  • getEventMessage(): String

TBTAFResult

Overview

Entity that contains the result of either an individual test or a test suite for a given execution

Methods Specification

  • getVerdict(): VerdictType (PASS,FAIL,INCONCLUSIVE)
  • getStartTimestamp(): Timestamp
  • setStartTimestamp(Timestamp)
  • getEndTimestamp(): Timestamp
  • setEndTimestamp(Timestamp)
  • getResultSource(): String

TBTAFTrace

Overview

Entity which is a collection of TBTAFEvent entities that are arranged in ascending time order.

Methods Specification

  • getErrors(): TBTAFEvent[]
  • getWarnings(): TBTAFEvent[]
  • getInfo(): TBTAFEvent[]
  • getTraceData(): TBTAFEvent[]
  • getTraceSource(): String
  • addEvent(TBTAFEvent)

TBMetaData

Overview

Entity that encapsulates the discovered TBTAF metadata specification on a given source code file. Such source code can be either production or test code.

Methods Specification

  • getMetaDataType(): TBMetaDataType (TEST,PRODUCT)
  • setAssetID(String)
  • getAssetID(): String
  • setTags(String [])
  • getTags(): String[]
  • setPriority(int)
  • getPriority(): int
  • setAssetDescription(String)
  • getAssetDescription(): String