Known Direct Subclasses
|
Class Overview
The canonical case of filtering is when you want to run a single test method in a class. Rather
than introduce runner API just for that one case, JUnit provides a general filtering mechanism.
If you want to filter the tests to be run, extend Filter
and apply an instance of
your filter to the Request
before running it (see
run(Request)
. Alternatively, apply a Filter
to
a Runner
before running tests (for example, in conjunction with
RunWith
.
Summary
Fields |
public
static
Filter |
ALL |
A null Filter that passes all tests through. |
[Expand]
Inherited Methods |
From class
java.lang.Object
Object
|
clone()
|
boolean
|
equals(Object arg0)
|
void
|
finalize()
|
final
Class<?>
|
getClass()
|
int
|
hashCode()
|
final
void
|
notify()
|
final
void
|
notifyAll()
|
String
|
toString()
|
final
void
|
wait()
|
final
void
|
wait(long arg0, int arg1)
|
final
void
|
wait(long arg0)
|
|
Fields
public
static
Filter
ALL
A null Filter
that passes all tests through.
Public Constructors
Public Methods
public
void
apply
(Object child)
Invoke with a Runner
to cause all tests it intends to run
to first be checked with the filter. Only those that pass the filter will be run.
Parameters
child
| the runner to be filtered by the receiver |
public
abstract
String
describe
()
Returns a textual description of this Filter
Returns
- a textual description of this Filter
public
static
Filter
matchMethodDescription
(Description desiredDescription)
Returns a Filter
that only runs the single method described by
desiredDescription
public
abstract
boolean
shouldRun
(Description description)
Parameters
description
| the description of the test to be run |
Returns
true
if the test should be run