Class TestScenarioLogCollection
java.lang.Object
de.qytera.qtaf.core.log.model.collection.TestScenarioLogCollection
This class works as a collection for log messages that are produced during a test execution.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumTest execution statusstatic classData class for step parameter information -
Method Summary
Modifier and TypeMethodDescriptionaddLogMessage(LogLevel level, String message) Add log messageaddLogMessage(LogMessage logMessage) Add log message object This methods needs to run synchronized because of the check for existence.addParameters(Parameter[] parameters, Object[] values) Add test parameters to logaddScreenshotPath(String filepath) Add screenshot path to test scenario logAdd tag to test scenario logstatic StringBuild IDstatic voidRemove all scenario log collectionsstatic TestScenarioLogCollectioncreateTestScenarioLogCollection(int featureId, String scenarioId, String scenarioName) Factory method.Add debug messagebooleanOverride equals to compare two TestScenarioLogCollection objectsAdd error messagestatic booleanexists(TestScenarioLogCollection scenarioLogCollection) Check if index already has this ScenarioLogCollectionstatic TestScenarioLogCollectionfromQtafTestEventPayload(IQtafTestEventPayload iQtafTestEventPayload) Factory method that creates new log collection from test event payload This method has to be synchronized so that it works correctly when using multiple threads.Get descriptionlongGet durationgetEnd()Get endintGet uniqueIdString[]Get groupDependenciesString[]Get groupsstatic intCount the number of scenario log collections saved in the indexGet logMessagesString[]Get methodDependenciesGet test IDGet testIdGet screenshotAfterGet screenshotBeforeGet screenshotPathsgetStart()Get startGet statusgetTags()Get tagslongGet threadIdGet threadNameinthashCode()Calculate hash code for this instance.Add info messagesetDescription(String description) Set test descriptionsetDuration(long duration) Set durationSet endsetGroupDependencies(String[] groupDependencies) Set test group dependenciesSet groupssetMethodDependencies(String[] methodDependencies) Set test method dependenciessetScreenshotAfter(String screenshotAfter) Set screenshotAftersetScreenshotBefore(String screenshotBefore) Set screenshotBeforeSet startSet test statussetThreadId(long threadId) Set threadIdsetThreadName(String threadName) Set threadNameAdd warn message
-
Method Details
-
createTestScenarioLogCollection
public static TestScenarioLogCollection createTestScenarioLogCollection(int featureId, String scenarioId, String scenarioName) Factory method. Creates new test log collection. If a collection with the given ID exists then return the existing collection. This method has to be synchronized so that it works correctly when using multiple threads.- Parameters:
featureId- Unique collection IDscenarioId- Method Id (packageName + className + methodName)scenarioName- Test ID- Returns:
- test log collection
-
fromQtafTestEventPayload
public static TestScenarioLogCollection fromQtafTestEventPayload(IQtafTestEventPayload iQtafTestEventPayload) Factory method that creates new log collection from test event payload This method has to be synchronized so that it works correctly when using multiple threads.- Parameters:
iQtafTestEventPayload- test event payload- Returns:
- test log collection
-
equals
Override equals to compare two TestScenarioLogCollection objects -
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. -
getFeatureId
public int getFeatureId()Get uniqueId- Returns:
- uniqueId
-
buildId
Build ID- Parameters:
methodId- Method IDtestId- Test ID- Returns:
- ID
-
getScenarioId
Get test ID- Returns:
- test ID
-
getScenarioName
Get testId- Returns:
- testId TestId
-
getStatus
Get status- Returns:
- status Status
-
setStatus
Set test status- Parameters:
status- test status- Returns:
- this
-
setDescription
Set test description- Parameters:
description- test description- Returns:
- this
-
setGroupDependencies
Set test group dependencies- Parameters:
groupDependencies- test group dependencies- Returns:
- this
-
setMethodDependencies
Set test method dependencies- Parameters:
methodDependencies- test method dependencies- Returns:
- this
-
getLogMessages
Get logMessages- Returns:
- logMessages LogMessages
-
addLogMessage
Add log message object This methods needs to run synchronized because of the check for existence.- Parameters:
logMessage- log message object- Returns:
- this
-
addLogMessage
Add log message- Parameters:
level- log levelmessage- log message- Returns:
- this
-
getScreenshotPaths
Get screenshotPaths- Returns:
- screenshotPaths
-
addScreenshotPath
Add screenshot path to test scenario log- Parameters:
filepath- Path to screenshot file- Returns:
- this
-
getScreenshotBefore
Get screenshotBefore- Returns:
- screenshotBefore
-
setScreenshotBefore
Set screenshotBefore- Parameters:
screenshotBefore- ScreenshotBefore- Returns:
- this
-
getScreenshotAfter
Get screenshotAfter- Returns:
- screenshotAfter
-
setScreenshotAfter
Set screenshotAfter- Parameters:
screenshotAfter- ScreenshotAfter- Returns:
- this
-
getTags
Get tags- Returns:
- tags
-
addTag
Add tag to test scenario log- Parameters:
key- Tag keyvalue- Tag value- Returns:
- this
-
debug
Add debug message- Parameters:
message- message- Returns:
- this
-
info
Add info message- Parameters:
message- message- Returns:
- this
-
warn
Add warn message- Parameters:
message- message- Returns:
- this
-
error
Add error message- Parameters:
message- message- Returns:
- this
-
getDescription
Get description- Returns:
- description
-
getGroupDependencies
Get groupDependencies- Returns:
- groupDependencies
-
getMethodDependencies
Get methodDependencies- Returns:
- methodDependencies
-
getStart
Get start- Returns:
- start
-
setStart
Set start- Parameters:
start- Start- Returns:
- this
-
getEnd
Get end- Returns:
- end
-
setEnd
Set end- Parameters:
end- End- Returns:
- this
-
getThreadId
public long getThreadId()Get threadId- Returns:
- threadId
-
setThreadId
Set threadId- Parameters:
threadId- ThreadId- Returns:
- this
-
getThreadName
Get threadName- Returns:
- threadName
-
setThreadName
Set threadName- Parameters:
threadName- ThreadName- Returns:
- this
-
getGroups
Get groups- Returns:
- groups
-
setGroups
Set groups- Parameters:
groups- Groups- Returns:
- this
-
getDuration
public long getDuration()Get duration- Returns:
- duration
-
setDuration
Set duration- Parameters:
duration- Duration- Returns:
- this
-
addParameters
Add test parameters to log- Parameters:
parameters- method parametersvalues- method values- Returns:
- this
-
exists
Check if index already has this ScenarioLogCollection- Parameters:
scenarioLogCollection- Scenario log collection- Returns:
- true if exists, false otherwise
-
getIndexSize
public static int getIndexSize()Count the number of scenario log collections saved in the index- Returns:
- number of scenario log collections saved in the index
-
clearIndex
public static void clearIndex()Remove all scenario log collections
-