java.lang.Object | +--junit.framework.TestSuiteAll Implemented Interfaces:
Test
Constructs an empty TestSuite. |
TestSuite(Class theClass, String name) Constructs a TestSuite from the given class with the given name. |
TestSuite(final Class theClass) Constructs a TestSuite from the given class. |
TestSuite(String name) Constructs an empty TestSuite. |
void | Adds a test to the suite. |
void | addTestSuite(Class testClass) Adds the tests from the given class to the suite |
int | Counts the number of test cases that will be run by this test. |
static Test | createTest(Class theClass, String name) ...as the moon sets over the early morning Merlin, Oregon mountains, our intrepid adventurers type... |
String | getName() Returns the name of the suite. |
static Constructor | getTestConstructor(Class theClass) Gets a constructor which takes a single String as its argument or a no arg constructor. |
void | run(TestResult result) Runs the tests and collects their result in a TestResult. |
void | runTest(Test test, TestResult result) |
void | setName(String name) Sets the name of the suite. |
testAt(int index) Returns the test at the given index | |
int | Returns the number of tests in this suite |
Enumeration | tests() Returns the tests as an enumeration |
String | toString() |
public TestSuite()
public TestSuite(Class theClass, String name)
TestSuite.TestSuite(Class)
public TestSuite(String name)
public TestSuite(final Class theClass)
public void addTest(Test test)
public void addTestSuite(Class testClass)
public int countTestCases()
public static Test createTest(Class theClass, String name)
public String getName()
public static Constructor getTestConstructor(Class theClass)
public void run(TestResult result)
public void runTest(Test test, TestResult result)
public void setName(String name)
public Test testAt(int index)
public int testCount()
public Enumeration tests()
public String toString()
TestSuite
is aComposite
of Tests. It runs a collection of test cases. Here is an example using the dynamic test definition. 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. This constructor creates a suite with all the methods starting with "test" that take no arguments.