Package org.junit.experimental.max
Class MaxCore
java.lang.Object
org.junit.experimental.max.MaxCore
A replacement for JUnitCore, which keeps track of runtime and failure history, and reorders tests
to maximize the chances that a failing test occurs early in the test run.
The rules for sorting are:
- Never-run tests first, in arbitrary order
- Group remaining tests by the date at which they most recently failed.
- Sort groups such that the most recent failure date is first, and never-failing tests are at the end.
- Within a group, run the fastest tests first.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate Runner
buildRunner
(Description each) private Request
constructLeafRequest
(List<Description> leaves) private void
findLeaves
(Description parent, Description description, List<Description> results) private List
<Description> findLeaves
(Request request) static MaxCore
Deprecated.use storedLocally()private Class
<?> Run all the tests inclass
.Run all the tests contained inrequest
.Run all the tests contained inrequest
.sortedLeavesForTest
(Request request) sortRequest
(Request request) static MaxCore
storedLocally
(File storedResults) Create a new MaxCore from a serialized file stored at storedResults
-
Field Details
-
MALFORMED_JUNIT_3_TEST_CLASS_PREFIX
- See Also:
-
history
-
-
Constructor Details
-
MaxCore
-
-
Method Details
-
forFolder
Deprecated.use storedLocally()Create a new MaxCore from a serialized file stored at storedResults -
storedLocally
Create a new MaxCore from a serialized file stored at storedResults -
run
Run all the tests inclass
.- Returns:
- a
Result
describing the details of the test run and the failed tests.
-
run
Run all the tests contained inrequest
.- Parameters:
request
- the request describing tests- Returns:
- a
Result
describing the details of the test run and the failed tests.
-
run
Run all the tests contained inrequest
. This variant should be used ifcore
has attached listeners that this run should notify.- Parameters:
request
- the request describing testscore
- a JUnitCore to delegate to.- Returns:
- a
Result
describing the details of the test run and the failed tests.
-
sortRequest
- Returns:
- a new Request, which contains all of the same tests, but in a new order.
-
constructLeafRequest
-
buildRunner
-
getMalformedTestClass
-
sortedLeavesForTest
- Parameters:
request
- a request to run- Returns:
- a list of method-level tests to run, sorted in the order specified in the class comment.
-
findLeaves
-
findLeaves
-