Class XrayTestEntityBuilder<T>

java.lang.Object
de.qytera.qtaf.xray.builder.test.XrayTestEntityBuilder<T>
Type Parameters:
T - a type describing scenario data to transform into a test entity, e.g. List<TestScenarioLogCollection>
Direct Known Subclasses:
MultipleIterationsXrayTestEntityBuilder, SingleIterationXrayTestEntityBuilder

public abstract class XrayTestEntityBuilder<T> extends Object
A class for building XrayTestEntity objects. The way these objects are built heavily depends on the test suite configuration.
See Also:
  • Field Details

    • collection

      @NonNull protected @NonNull TestSuiteLogCollection collection
      The entire test suite logs. Used for generating HTML reports.
    • reportCreator

      protected final ScenarioReportCreator reportCreator
      HTML report creator for scenarios.
    • issueSummaries

      @NonNull protected @NonNull Map<String,String> issueSummaries
      A mapping of test issue keys to their summaries.
  • Constructor Details

  • Method Details

    • buildTestEntity

      public XrayTestEntity buildTestEntity(XrayTest xrayTest, T scenarioData)
      Builds a test entity for an executed test.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to transform into an XrayTestEntity
      Returns:
      the test entity
    • getStatus

      protected abstract TestScenarioLogCollection.Status getStatus(XrayTest xrayTest, T scenarioData)
      Extracts the test's status from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the status from
      Returns:
      the test's status
      See Also:
    • getTestInfo

      protected abstract XrayTestInfoEntity getTestInfo(XrayTest xrayTest, T scenarioData)
      Builds a test information entity for a test. Returns null if the configuration has not been configured to build test information entities.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to transform into an XrayTestInfoEntity
      Returns:
      the test information entity
    • getStartDate

      protected abstract Date getStartDate(XrayTest xrayTest, T scenarioData)
      Extracts the test start date from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the start date from
      Returns:
      the test's start date
      See Also:
    • getEndDate

      protected abstract Date getEndDate(XrayTest xrayTest, T scenarioData)
      Extracts the test end date from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the end date from
      Returns:
      the test's end date
      See Also:
    • getComment

      protected abstract String getComment(XrayTest xrayTest, T scenarioData)
      Extracts the test comment from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the comment from
      Returns:
      the test's comment
      See Also:
    • getExecutedBy

      protected abstract String getExecutedBy(XrayTest xrayTest, T scenarioData)
      Extracts the user id who executed the test from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the user id from
      Returns:
      the user id of the user who executed the test
      See Also:
    • getAssignee

      protected abstract String getAssignee(XrayTest xrayTest, T scenarioData)
      Extracts the user id who the test should be assigned to from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the assignee from
      Returns:
      the test's assignee
      See Also:
    • getSteps

      protected abstract List<XrayManualTestStepResultEntity> getSteps(XrayTest xrayTest, T scenarioData)
      Extracts the test's list of test step results from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the steps from
      Returns:
      the test's steps
      See Also:
    • getExamples

      protected abstract List<String> getExamples(XrayTest xrayTest, T scenarioData)
      Extracts the test's list of examples from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the examples from
      Returns:
      the test's examples
      See Also:
    • getIterations

      protected abstract List<XrayIterationResultEntity> getIterations(XrayTest xrayTest, T scenarioData)
      Extracts the test's list of iterations from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the iterations from
      Returns:
      the test's iterations
      See Also:
    • getDefects

      protected abstract List<String> getDefects(XrayTest xrayTest, T scenarioData)
      Extracts the test's list of defects from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the defects from
      Returns:
      the test's defects
      See Also:
    • getEvidence

      protected abstract List<XrayEvidenceItemEntity> getEvidence(XrayTest xrayTest, T scenarioData)
      Extracts the test's list of (defect) evidence from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the evidence from
      Returns:
      the test's evidence
      See Also:
    • getCustomFields

      protected abstract List<XrayCustomFieldEntity> getCustomFields(XrayTest xrayTest, T scenarioData)
      Extracts the test's list of custom field (values) from provided scenario data.
      Parameters:
      xrayTest - the XrayTest annotation of the test
      scenarioData - the scenario data to extract the custom fields from
      Returns:
      the test's custom field (values)
      See Also:
    • buildTestStepEntity

      protected static XrayTestStepEntity buildTestStepEntity(StepInformationLogMessage stepLog)
      Converts a StepInformationLogMessage into an XrayTestStepEntity.

      Note: these are different from XrayManualTestStepResultEntity.

      Parameters:
      stepLog - the step information to convert
      Returns:
      the converted Xray test step
    • buildMergedTestStepEntity

      protected static XrayTestStepEntity buildMergedTestStepEntity(List<StepInformationLogMessage> steps)
      Converts a list of StepInformationLogMessage into a single XrayTestStepEntity.

      Note: these are different from XrayManualTestStepResultEntity.

      Parameters:
      steps - the steps' information to convert
      Returns:
      the converted Xray test step
    • buildManualTestStepResultEntity

      protected static XrayManualTestStepResultEntity buildManualTestStepResultEntity(StepInformationLogMessage step)
      Converts a StepInformationLogMessage into an XrayManualTestStepResultEntity.

      Note: these are different from XrayTestStepEntity.

      Parameters:
      step - the step information to convert
      Returns:
      the converted Xray test step result
    • buildActualResult

      protected static String buildActualResult(StepInformationLogMessage step)
      Generate the value of the "actualResult" attribute of a test step execution.
      Parameters:
      step - Step log message object
      Returns:
      actualResult value
    • buildMergedManualTestStepResultEntity

      protected static XrayManualTestStepResultEntity buildMergedManualTestStepResultEntity(List<StepInformationLogMessage> steps)
      Converts a list of StepInformationLogMessage into a single XrayManualTestStepResultEntity.

      Note: these are different from XrayTestStepEntity.

      Parameters:
      steps - the steps' information to convert
      Returns:
      the converted Xray test step result