public class

MaxCore

extends Object
java.lang.Object
   ↳ org.junit.experimental.max.MaxCore

Class Overview

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:

  1. Never-run tests first, in arbitrary order
  2. Group remaining tests by the date at which they most recently failed.
  3. Sort groups such that the most recent failure date is first, and never-failing tests are at the end.
  4. Within a group, run the fastest tests first.

Summary

Public Methods
static MaxCore forFolder(String folderName)
This method is deprecated. use storedLocally()
Result run(Request request)
Run all the tests contained in request.
Result run(Class<?> testClass)
Run all the tests in class.
Result run(Request request, JUnitCore core)
Run all the tests contained in request.
Request sortRequest(Request request)
List<Description> sortedLeavesForTest(Request request)
static MaxCore storedLocally(File storedResults)
Create a new MaxCore from a serialized file stored at storedResults
[Expand]
Inherited Methods
From class java.lang.Object

Public Methods

public static MaxCore forFolder (String folderName)

This method is deprecated.
use storedLocally()

Create a new MaxCore from a serialized file stored at storedResults

public Result run (Request request)

Run all the tests contained in request.

Parameters
request the request describing tests
Returns
  • a Result describing the details of the test run and the failed tests.

public Result run (Class<?> testClass)

Run all the tests in class.

Returns
  • a Result describing the details of the test run and the failed tests.

public Result run (Request request, JUnitCore core)

Run all the tests contained in request. This variant should be used if core has attached listeners that this run should notify.

Parameters
request the request describing tests
core a JUnitCore to delegate to.
Returns
  • a Result describing the details of the test run and the failed tests.

public Request sortRequest (Request request)

Returns
  • a new Request, which contains all of the same tests, but in a new order.

public List<Description> sortedLeavesForTest (Request request)

Parameters
request a request to run
Returns
  • a list of method-level tests to run, sorted in the order specified in the class comment.

public static MaxCore storedLocally (File storedResults)

Create a new MaxCore from a serialized file stored at storedResults