|
|||||||||
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).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 epsilon)
instead
assertEquals(String message, double expected, double actual, double epsilon)
instead
actual
satisfies the condition specified by
matcher
.
actual
satisfies the condition specified by
matcher
.
objects
, the test will halt and be ignored.
actual
satisfies the condition specified by matcher
.
false
, the test will halt and be ignored.
klass
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 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?
Failure
holds a description of the failed test and the
exception that was thrown while running it.Failure
with the given description and exception.
filter
.
filter
is applied
Description
equals desiredDescription
Runner
for this Request
TestClass
object wrapping the class to be executed.
true
.Object.equals(java.lang.Object)
invokedMethod?JUnitCore
is a facade for running tests.JUnitCore
to run tests.
args
.
Request
that, when processed, will run a single test.
method
passes, or throws an exception if method
fails.
Statement
that invokes method
on test
Sorter
that leaves elements in an undefined order
filter
or sort
tests.Runner
implementations.Parameterized
implements parameterized tests.Parameterized
T
.ParentRunner
that will run @TestClass
Statement
: if method
's @Test
annotation
has the expecting
attribute, return normally only if next
throws an exception of the correct type, and throw an exception
otherwise.
Request
is an abstract description of tests to be run.Result
collects and summarizes information from running multiple
tests.classes
.
request
.
test
.
child
, which can be assumed to be
an element of the list returned by ParentRunner.getChildren()
.
classes
.
RunListener
and override the appropriate methods.Runner
runs tests and notifies a RunNotifier
of significant events as it does so.@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:
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.Ignore
.
method
for Description
s.
errors
for each method annotated with @Test
,
@Before
, or @After
that is not a public, void instance
method with no arguments.
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
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 @After
methods on this class and superclasses before running next
; all
After methods are always executed: exceptions thrown by previous steps
are combined, if necessary, with exceptions from After 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.
Statement
: run all non-overridden @Before
methods on this class and superclasses before running next
; if
any throws an Exception, stop execution and pass the exception on.
Statement
: if method
's @Test
annotation
has the timeout
attribute, throw an exception if next
takes more than the specified number of milliseconds.
|
|||||||||
PREV NEXT | FRAMES NO FRAMES |