Class TestFeatureLogCollection

java.lang.Object
de.qytera.qtaf.core.log.model.collection.TestFeatureLogCollection

public class TestFeatureLogCollection extends Object
Collection that holds all log messages from a specific test case class.
  • Method Details

    • createFeatureLogCollectionIfNotExists

      public static TestFeatureLogCollection createFeatureLogCollectionIfNotExists(String featureId, String featureName)
      Factory method.

      This method has to be synchronized so that only one thread at a time can execute this method.

      Parameters:
      featureId - Collection ID
      featureName - Collection Name
      Returns:
      the log collection
    • createFeatureLogCollectionIfNotExists

      public static TestFeatureLogCollection createFeatureLogCollectionIfNotExists(String featureId, TestFeature testFeatureAnnotation)
      Factory method.

      This method has to be synchronized so that only one thread at a time can execute this method.

      Parameters:
      featureId - Collection ID
      testFeatureAnnotation - Test feature annotation
      Returns:
      the log collection
    • equals

      public boolean equals(Object o)
      Override equals to compare two TestFeatureLogCollection objects.
      Overrides:
      equals in class Object
      Parameters:
      o - Object to compare with this instance
      Returns:
      true if both are equal, false otherwise
    • hashCode

      public int hashCode()
      Calculate hash code for this instance. The contains() methods of the collections use the hash code to check if object is already stored.
      Overrides:
      hashCode in class Object
      Returns:
      hash code
    • getFeatureId

      public String getFeatureId()
      Get collection ID.
      Returns:
      Collection ID
    • getFeatureName

      public String getFeatureName()
      Get collection Name.
      Returns:
      Collection Name
    • getFeatureDescription

      public String getFeatureDescription()
      Get collection Description.
      Returns:
      Collection Description
    • getScenarioLogCollection

      public List<TestScenarioLogCollection> getScenarioLogCollection()
      Get test step collections.
      Returns:
      log collections
    • getScenariosGroupedByAbstractScenarioId

      public Map<String,List<TestScenarioLogCollection>> getScenariosGroupedByAbstractScenarioId()
      Group scenario logs by abstract scenario ID.
      Returns:
      Map of grouped scenario logs
    • createScenarioIfNotExists

      public TestScenarioLogCollection createScenarioIfNotExists(String featureId, String abstractScenarioId, String instanceId, String scenarioName)
      Add new Scenario Log Collection.
      Parameters:
      featureId - Unique test hash code
      abstractScenarioId - the scenario ID
      instanceId - Method ID / Scenario name
      scenarioName - Test ID / Feature name
      Returns:
      this
    • addScenarioLogCollection

      public TestScenarioLogCollection addScenarioLogCollection(TestScenarioLogCollection collection)
      Add a scenario log collection if it not already exists.
      Parameters:
      collection - scenario log collection
      Returns:
      scenario log collection
    • getTestFeatureAnnotation

      public TestFeature getTestFeatureAnnotation()
      Get testCaseAnnotation.
      Returns:
      testCaseAnnotation
    • setTestFeatureAnnotation

      public TestFeatureLogCollection setTestFeatureAnnotation(TestFeature testFeatureAnnotation)
      Set testCaseAnnotation.
      Parameters:
      testFeatureAnnotation - TestCaseAnnotation
      Returns:
      this
    • countScenarioLogs

      public int countScenarioLogs()
      Count the number of scenario log collections.
      Returns:
      number of scenario log collections
    • clearCollection

      public void clearCollection()
      Remove all elements from the collection.
    • exists

      public static boolean exists(String featureId)
      Check if feature log with given ID already exists.
      Parameters:
      featureId - Feature ID
      Returns:
      true if exists, false otherwise
    • getIndexSize

      public static int getIndexSize()
      Count the number of scenario log collections.
      Returns:
      number of scenario log collections
    • clearIndex

      public static void clearIndex()
      Remove all scenario log collections.