|
|||||||||
PREV NEXT | FRAMES NO FRAMES |
Request
that, when processed, will run all the tests
in a class.
Description
as a child of the receiver.
Before
method you need to release them
after the test runs.BeforeClass
method you need to release them
after all the tests in the class have run.Filter
that passes all tests through.
suite()
method).SelfDescribing
value to this description.
SelfDescribing
objects
to the description.
Statement
to implement an additional
test-running rule.
Statement
to implement this
test-running rule.
Runner
to cause all tests it intends to run
to first be checked with the filter.
runner
using comparator
assertEquals(double expected, double actual, double delta)
instead
assertEquals(String message, double expected, double actual, double delta)
instead
actual
satisfies the condition specified by
matcher
.
actual
satisfies the condition specified by
matcher
.
StringDescription.toString(SelfDescribing)
.
objects
, the test will halt and be ignored.
actual
satisfies the condition specified by matcher
.
false
, the test will halt and be ignored.
Description
that is stored as a string.klass
callable
.
matcher
does not match value
.
Statement
: Call ParentRunner.runChild(Object, RunNotifier)
on each object returned by ParentRunner.getChildren()
(subject to any imposed
filter and sort)
Statement
to run all of the tests in the test class.
Request
that, when processed, will run all the tests
in a set of classes.
Request
that, when processed, will run all the tests
in a set of classes with the default Computer
.
Request
that, when processed, will run all the tests
in a class.
errors
a throwable for each problem noted with the test class (available from ParentRunner.getTestClass()
).
assertEquals(String, String)
fails.Description
named name
.
Description
named after testClass
Description
of a single test named name
in the class clazz
.
Description
of a single test named name
in the class clazz
.
Description
for child
, which can be assumed to
be an element of the list returned by ParentRunner.getChildren()
Description
describes a test which is to be run or has been run.Object.equals(java.lang.Object)
invokedMethod?
Object.equals(java.lang.Object)
invokedMethod?
Throwable
if anything goes wrong.
matcher
to the list of requirements for any thrown exception.
type
substring
matcher
to the list of requirements for the message
returned from any thrown exception.
Failure
holds a description of the failed test and the
exception that was thrown while running it.Failure
with the given description and exception.
count
failures
filter
.
filter
is applied
Description
equals desiredDescription
MaxHistory
from file
, or generates a new one that
will be saved to file
.
BlockJUnit4ClassRunner
, but custom runners can make other uses)FrameworkMethod
for method
target
annotationClass
.
annotationClass
.
annotationType
on this method, if
one exists.
AssertionError
if there are more or less than one.
testClass
, using builder
Runner
for this Request
classes
, building Runners with builder
.
TestClass
object wrapping the class to be executed.
string
string
InitializationError
with one or more
errors errors
as causes
InitializationError
with one cause
with message string
second
target
with
parameters params
.
true
.Object.equals(java.lang.Object)
invokedMethod?JUnitCore
is a facade for running tests.JUnitCore
to run tests.
args
.
Filter
that only runs the single method described by
desiredDescription
Request
that, when processed, will run a single test.
method
passes, or throws an exception if method
fails.
Statement
that invokes method
on test
Throwable
s into one exception.Sorter
that leaves elements in an undefined order
Matcher
s for use with
the Assert.assertThat(Object, org.hamcrest.Matcher)
statementfilter
or sort
tests.Runner
implementations.Parameterized
implements parameterized tests.Parameterized
T
.ParentRunner
that will run @TestClass
failures
type
Request
is an abstract description of tests to be run.Result
collects and summarizes information from running multiple
tests.MethodRule
is a deprecated interface. Port to
TestRule
and
BlockJUnit4ClassRunner.getTestRules(Object)
class
.
request
.
request
.
classes
.
classes
.
request
.
test
.
child
, which can be assumed to be
an element of the list returned by ParentRunner.getChildren()
.
classes
.
classes
.
Statement
that represents a leaf (aka atomic) test.
RunListener
and override the appropriate methods.Runner
runs tests and notifies a RunNotifier
of significant events as it does so.children
.
@RunWith
or extends a class annotated
with @RunWith
, JUnit will invoke the class it references to run the
tests in that class instead of the runner built into JUnit.sorter
Sorter
orders tests.Sorter
that uses comparator
to sort tests
comparator
For example, here is code to run a test suite in alphabetical order:
Description
that is stored as a string.Suite
as a runner allows you to manually
build a suite containing tests from many classes.@RunWith(Suite.class)
JUnitCore
SuiteClasses
annotation specifies the classes to be run when a class
annotated with @RunWith(Suite.class)
is run.Test
annotation tells JUnit that the public void
method
to which it is attached can be run as a test case.TestClass
wrapping klass
.
Ignore
.
method
for Description
s.
type
request
MethodRule
is deprecated.
Use TestWatcher
implements TestRule
instead.SelfDescribing
object as a String.
errors
if the test class has more than one constructor,
or if the constructor takes parameters.
errors
if the test class has more than one constructor
(do not override)
errors
if this method:
is not public, or
returns something other than void, or
is static (given isStatic is false
), or
is not static (given isStatic is true
).
errors
if this method:
is not public, or
takes parameters, or
returns something other than void, or
is static (given isStatic is false
), or
is not static (given isStatic is true
).
errors
if any method in this class is annotated with
annotation
, but:
is not public, or
takes parameters, or
returns something other than void, or
is static (given isStatic is false
), or
is not static (given isStatic is true
).
errors
for each method annotated with @Test
that
is not a public, void instance method with no arguments.
errors
if the test class's single constructor takes
parameters (do not override)
Statement
: run all non-overridden @AfterClass
methods on this class
and superclasses before executing statement
; all AfterClass methods are
always executed: exceptions thrown by previous steps are combined, if
necessary, with exceptions from AfterClass methods into a
MultipleFailureException
.
Statement
: run all non-overridden @BeforeClass
methods on this class
and superclasses before executing statement
; if any throws an
Exception, stop execution and pass the exception on.
|
|||||||||
PREV NEXT | FRAMES NO FRAMES |