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

    • 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
    • createFeatureLogCollectionIfNotExists

      public static TestFeatureLogCollection createFeatureLogCollectionIfNotExists(int 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
    • createFeatureLogCollectionIfNotExists

      public static TestFeatureLogCollection createFeatureLogCollectionIfNotExists(int 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
    • getFeatureId

      public int 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 ArrayList<TestScenarioLogCollection> getScenarioLogCollection()
      Get test step collections
      Returns:
      log collections
    • createScenarioIfNotExists

      public TestScenarioLogCollection createScenarioIfNotExists(String featureId, String scenarioId, String scenarioName)
      Add new TestMethodLogCollection
      Parameters:
      featureId - Unique test hash code
      scenarioId - Method ID / Scenario name
      scenarioName - Test ID / Feature name
      Returns:
      this
    • createScenarioIfNotExists

      public TestScenarioLogCollection createScenarioIfNotExists(int featureId, String scenarioId, String scenarioName)
      Add new TestMethodLogCollection
      Parameters:
      featureId - Unique test hash code
      scenarioId - 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
    • getTestCaseAnnotation

      public TestFeature getTestCaseAnnotation()
      Get testCaseAnnotation
      Returns:
      testCaseAnnotation
    • setTestCaseAnnotation

      public TestFeatureLogCollection setTestCaseAnnotation(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(int 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