public abstract class TestSuite
extends java.lang.Object
This class represents a grouping of potentially parallelizable
test cases
.
class TypeFormatTestSuite extends TestSuite {
public TypeFormatTestSuite() {
addTest(new ParseBoolean());
addTest(new ParseInt().ignore(true)); // Adds this test case but it is ignored for now.
...
}
class ParseBoolean extends TestCase { ... };
class ParseInt extends TestCase { ... };
...
}
How the test suite is executed, how the test results are logged and how
the test report is created depends upon the TestContext
in which
the test suite is run
. Specialized
test contexts may address specific concerns such as performance
(TimeContext
), memory usage, code coverage, etc. The test
context determinates also how test results are reported (e.g. html
formatted, IDE integrated, etc.)
Modifier | Constructor and Description |
---|---|
protected |
TestSuite()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected TestCase |
addTest(TestCase testCase)
Adds the specified test case to this test suite.
|
java.lang.String |
getName()
Returns the name of this test case.
|
boolean |
isParallelizable()
Indicates if the test cases of this test suite can be run concurrently
(default
true ). |
void |
setUp()
Prepares the test suite execution (the default implementation does
nothing).
|
void |
tearDown()
Cleanup once test suite execution is complete (the default implementation
does nothing).
|
java.util.List<TestCase> |
tests()
Returns the collection of test cases belonging to this test suite.
|
java.lang.String |
toString()
Returns the
String representation of this test suite. |
public java.lang.String getName()
protected TestCase addTest(TestCase testCase)
testCase
- the test case being added.public void setUp()
public void tearDown()
public java.util.List<TestCase> tests()
public boolean isParallelizable()
true
). If the test suite is not parallelizable then
the test cases are executed in sequence, first added runs first.true
if parallelizable;
false
otherwise.public java.lang.String toString()
String
representation of this test suite.toString
in class java.lang.Object
this.getName()
Copyright © 2005 - 2007 Javolution.