类 MaxCore
- java.lang.Object
- org.junit.experimental.max.MaxCore
public class MaxCore extends Object
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.
方法概要
所有方法 静态方法 实例方法 具体方法 已过时的方法 修饰符和类型 方法 说明 static MaxCore
forFolder(String folderName)
已过时。use storedLocally()Result
run(Class<?> testClass)
Run all the tests inclass
.Result
run(Request request)
Run all the tests contained inrequest
.Result
run(Request request, JUnitCore core)
Run all the tests contained inrequest
.List<Description>
sortedLeavesForTest(Request request)
Request
sortRequest(Request request)
static MaxCore
storedLocally(File storedResults)
Create a new MaxCore from a serialized file stored at storedResults
方法详细资料
forFolder
@Deprecated public static MaxCore forFolder(String folderName)
已过时。use storedLocally()Create a new MaxCore from a serialized file stored at storedResults
storedLocally
public static MaxCore storedLocally(File storedResults)
Create a new MaxCore from a serialized file stored at storedResults
run
public Result run(Class<?> testClass)
Run all the tests inclass
.- 返回:
- a
Result
describing the details of the test run and the failed tests.
run
public Result run(Request request)
Run all the tests contained inrequest
.- 参数:
request
- the request describing tests- 返回:
- a
Result
describing the details of the test run and the failed tests.
run
public Result run(Request request, JUnitCore core)
Run all the tests contained inrequest
. This variant should be used ifcore
has attached listeners that this run should notify.- 参数:
request
- the request describing testscore
- a JUnitCore to delegate to.- 返回:
- a
Result
describing the details of the test run and the failed tests.
sortRequest
public Request sortRequest(Request request)
- 返回:
- a new Request, which contains all of the same tests, but in a new order.
sortedLeavesForTest
public List<Description> sortedLeavesForTest(Request request)
- 参数:
request
- a request to run- 返回:
- a list of method-level tests to run, sorted in the order specified in the class comment.