Class LogMessage

java.lang.Object
de.qytera.qtaf.core.log.model.message.LogMessage
Direct Known Subclasses:
AssertionLogMessage, StepInformationLogMessage

public class LogMessage extends Object
Log message class holds information about log messages.
  • Field Details

    • status

      protected LogMessage.Status status
      Step status.
    • uuid

      protected final UUID uuid
      Unique id.
    • assertions

      protected List<AssertionLogMessage> assertions
      List of assertions that were checked in this step.
    • start

      protected Date start
      Time when step was started.
    • end

      protected Date end
      Time when step was finished.
    • error

      protected ThrowableWrapper error
      Step error. If an error occures during the step method execution it is stored in this attribute.
    • level

      protected LogLevel level
      Log level.
    • message

      protected String message
      Log message.
    • featureId

      protected String featureId
      Feature ID.
    • abstractScenarioId

      protected String abstractScenarioId
      Abstract Scenario ID.
    • scenarioId

      protected String scenarioId
      Scenario ID.
  • Constructor Details

    • LogMessage

      public LogMessage(LogLevel level, String message)
      Constructor.
      Parameters:
      level - log level
      message - log message
  • Method Details

    • getUuid

      public UUID getUuid()
      Get uuid.
      Returns:
      uuid
    • hasFailed

      public boolean hasFailed()
      Checks if step has failed.
      Returns:
      true if step has failed, false otherwise
    • hasPassed

      public boolean hasPassed()
      Checks if step has passed.
      Returns:
      true if step has passed, false otherwise
    • isPending

      public boolean isPending()
      Checks if step is pending.
      Returns:
      true if step is pending, false otherwise
    • isSkipped

      public boolean isSkipped()
      Checks if step is skipped.
      Returns:
      true if step is skipped, false otherwise
    • getError

      public ThrowableWrapper getError()
      Get step error.
      Returns:
      step error
    • hasError

      public boolean hasError()
      Check if an error occurred.
      Returns:
      true if an error occurred during method execution, false otherwise
    • setError

      public LogMessage setError(Throwable error)
      Set step error.
      Parameters:
      error - step error
      Returns:
      this
    • setError

      public LogMessage setError(ThrowableWrapper error)
      Set step error.
      Parameters:
      error - step error
      Returns:
      this
    • getStart

      public Date getStart()
      Get start.
      Returns:
      start
    • setStart

      public LogMessage setStart(Date start)
      Set start.
      Parameters:
      start - Start
      Returns:
      this
    • getEnd

      public Date getEnd()
      Get end.
      Returns:
      end
    • setEnd

      public LogMessage setEnd(Date end)
      Set end.
      Parameters:
      end - End
      Returns:
      this
    • getDuration

      public long getDuration()
      Get duration.
      Returns:
      duration
    • getAssertions

      public List<AssertionLogMessage> getAssertions()
      Get assertions.
      Returns:
      list of assertions
    • setAssertions

      public LogMessage setAssertions(List<AssertionLogMessage> assertions)
      Set list of assertions.
      Parameters:
      assertions - list of assertions
      Returns:
      this
    • addAssertion

      public LogMessage addAssertion(AssertionLogMessage assertion)
      Add an assertion to the list.
      Parameters:
      assertion - Assertion
      Returns:
      this
    • computeStatus

      public void computeStatus()
      Computes the status of the test step.
    • getLevel

      public LogLevel getLevel()
      Gte log level.
      Returns:
      log level
    • setLevel

      public LogMessage setLevel(LogLevel level)
      Set log level.
      Parameters:
      level - log level
      Returns:
      this
    • setStatus

      public LogMessage setStatus(LogMessage.Status status)
      Set status.
      Parameters:
      status - Status
      Returns:
      this
    • getMessage

      public String getMessage()
      Get log message.
      Returns:
      log message
    • setMessage

      public LogMessage setMessage(String message)
      Set log message.
      Parameters:
      message - log message
      Returns:
      this
    • getFeatureId

      public String getFeatureId()
      Get featureId.
      Returns:
      featureId
    • setFeatureId

      public LogMessage setFeatureId(String featureId)
      Set featureId.
      Parameters:
      featureId - FeatureId
      Returns:
      this
    • getAbstractScenarioId

      public String getAbstractScenarioId()
      Get abstractScenarioId.
      Returns:
      abstractScenarioId
    • setAbstractScenarioId

      public LogMessage setAbstractScenarioId(String abstractScenarioId)
      Set abstractScenarioId.
      Parameters:
      abstractScenarioId - AbstractScenarioId
      Returns:
      this
    • getScenarioId

      public String getScenarioId()
      Get scenarioId.
      Returns:
      scenarioId
    • setScenarioId

      public LogMessage setScenarioId(String scenarioId)
      Set scenarioId.
      Parameters:
      scenarioId - ScenarioId
      Returns:
      this
    • getStatus

      public LogMessage.Status getStatus()
      Step status.