Name

Test

Description

Test (see Figure B-5) is an interface implemented by TestCase and TestSuite. A Test can be run and its results collected in a TestResult. It is an important abstraction, since both individual unit tests and sets of tests are run via the Test interface.

The interface Test
Figure B-5. The interface Test

Declaration

public interface Test

Constructors

None (it’s an interface).

Public Methods

public abstract int countTestCases( )

Returns the number of test cases run by this Test.

public abstract void run(TestResult result)

Runs the Test and collect its results in a TestResult.

Protected/Private Methods

None.

Attributes

None.

Get Unit Test Frameworks now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.