java.lang.Object | |
↳ | junit.framework.TestSuite |
Known Direct Subclasses |
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.
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Constructs an empty TestSuite.
| |||||||||||
Constructs a TestSuite from the given class with the given name.
| |||||||||||
Constructs a TestSuite from the given class.
| |||||||||||
Constructs an empty TestSuite.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Adds a test to the suite.
| |||||||||||
Adds the tests from the given class to the suite
| |||||||||||
Counts the number of test cases that will be run by this test.
| |||||||||||
...as the moon sets over the early morning Merlin, Oregon
mountains, our intrepid adventurers type...
| |||||||||||
Returns the name of the suite.
| |||||||||||
Gets a constructor which takes a single String as
its argument or a no arg constructor.
| |||||||||||
Runs the tests and collects their result in a TestResult.
| |||||||||||
Sets the name of the suite.
| |||||||||||
Returns the test at the given index
| |||||||||||
Returns the number of tests in this suite
| |||||||||||
Returns the tests as an enumeration
| |||||||||||
Returns a string containing a concise, human-readable description of this
object.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
From class
java.lang.Object
| |||||||||||
From interface
junit.framework.Test
|
Constructs a TestSuite from the given class with the given name.
Constructs a TestSuite from the given class. Adds all the methods starting with "test" as test cases to the suite. Parts of this method was written at 2337 meters in the Huffihutte, Kanton Uri
Adds the tests from the given class to the suite
Counts the number of test cases that will be run by this test.
...as the moon sets over the early morning Merlin, Oregon mountains, our intrepid adventurers type...
Returns the name of the suite. Not all test suites have a name and this method can return null.
Gets a constructor which takes a single String as its argument or a no arg constructor.
NoSuchMethodException |
---|
Runs the tests and collects their result in a TestResult.
Sets the name of the suite.
name | The name to set |
---|
Returns a string containing a concise, human-readable description of this object. Subclasses are encouraged to override this method and provide an implementation that takes into account the object's type and data. The default implementation is equivalent to the following expression:
getClass().getName() + '@' + Integer.toHexString(hashCode())
See Writing a useful toString
method
if you intend implementing your own toString
method.