All Packages Class Hierarchy This Package Previous Next Index
Class junit.framework.TestSuite
java.lang.Object
|
+----junit.framework.TestSuite
- public class TestSuite
- extends Object
- implements Test
A TestSuite is a Composite of Tests.
It runs a collection of test cases. Here is an example using
the dynamic test definition.
TestSuite suite= new TestSuite();
suite.addTest(new MathTest("testAdd"));
suite.addTest(new MathTest("testDivideByZero"));
Alternatively, a TestSuite can extract the tests to be run automatically.
To do so you pass the class of your TestCase class to the
TestSuite constructor.
TestSuite suite= new TestSuite(MathTest.class);
This constructor creates a suite with all the methods
starting with "test" that take no arguments.
- See Also:
- Test
-
TestSuite()
- Constructs an empty TestSuite.
-
TestSuite(Class)
- Constructs a TestSuite from the given class.
-
addTest(Test)
- Adds a test to the suite.
-
countTestCases()
- Counts the number of test cases that will be run by this test.
-
run(TestResult)
- Runs the tests and collects their result in a TestResult.
TestSuite
public TestSuite()
- Constructs an empty TestSuite.
TestSuite
public TestSuite(Class theClass)
- Constructs a TestSuite from the given class. Adds all the methods
starting with "test" as test cases to the suite.
addTest
public void addTest(Test test)
- Adds a test to the suite.
countTestCases
public int countTestCases()
- Counts the number of test cases that will be run by this test.
run
public void run(TestResult result)
- Runs the tests and collects their result in a TestResult.
All Packages Class Hierarchy This Package Previous Next Index