Package org.testframe.engine
Class TestResultComparator
java.lang.Object
org.testframe.engine.TestResultComparator
- All Implemented Interfaces:
Comparator<TestResult>
Compares two test results according to their test result status. The
motivation for this comparator is that it enables the test results reporter
to group test results according to their test result status, so that, for
example, the failing tests are grouped together and one doesn't have to
scroll through a long list of results.
- Since:
- 1.0
- Author:
- Alonso del Arte
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionint
compare
(TestResult resultA, TestResult resultB) Compares test result statuses according to the order inTestResultStatus
.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.util.Comparator
equals, reversed, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
-
Constructor Details
-
TestResultComparator
public TestResultComparator()
-
-
Method Details
-
compare
Compares test result statuses according to the order inTestResultStatus
.- Specified by:
compare
in interfaceComparator<TestResult>
- Parameters:
resultA
- The first status to compare. For example,TestResultStatus.FAILED
.resultB
- The second status to compare. For example,TestResultStatus.PASSED
.- Returns:
- 0 if the statuses are the same, a negative integer if
resultA
's status is listed earlier thanresultB
's status, or a positive integer ifresultA
's status is listed later thanresultB
's status. The range of this function is currently −3 to +3, but this is not guaranteed to stay the same in later versions.
-