Class CriterionTestResult
java.lang.Object
org.sentrysoftware.metricshub.engine.strategy.detection.CriterionTestResult
Represents the result of a criterion test, including information about success, failure, or errors.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFormats and displays the criterion message in a structured, readable format.static CriterionTestResultempty()Creates an empty criterion test result.static CriterionTestResultCreate a detection error report.static CriterionTestResultCreate a detection error report.static CriterionTestResultCreate a detection error report.static CriterionTestResultCreate a detection failure report.static CriterionTestResultCreate a successful detection report.
-
Constructor Details
-
CriterionTestResult
public CriterionTestResult()
-
-
Method Details
-
empty
Creates an empty criterion test result.- Returns:
- A new
CriterionTestResultinstance.
-
failure
Create a detection failure report.- Parameters:
criterion- The failed criterionresult- Its result (that doesn't match with the criterion)- Returns:
- a new
CriterionTestResultinstance
-
error
Create a detection error report.- Parameters:
criterion- The failed criterionreason- The reason why it failedt- the Exception that made the test fail- Returns:
- a new
CriterionTestResultinstance
-
error
Create a detection error report.- Parameters:
criterion- The failed criterionreason- The reason why it failed- Returns:
- a new
CriterionTestResultinstance
-
error
Create a detection error report.- Parameters:
criterion- The failed criteriont- the Exception that made the test fail- Returns:
- a new
CriterionTestResultinstance
-
success
Create a successful detection report.- Parameters:
criterion- The criterion that was fulfilledresult- Its result- Returns:
- a new
CriterionTestResultinstance
-
displayCriterionMessage
Formats and displays the criterion message in a structured, readable format. The output includes information about the executed criterion, its details, the result, and an additional message, each presented in distinct sections.- Returns:
- a formatted string that displays the criterion name, details, result, and message.
-