public abstract class TestSuite extends Object
This class represents a grouping of potentially parallelizable
test cases
. [code]
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 { ... };
...
}[/code]
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.
|
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).
|
List<TestCase> |
tests()
Returns the collection of test cases belonging to this test suite.
|
String |
toString()
Returns the
String representation of this test suite. |
public String getName()
protected TestCase addTest(TestCase testCase)
testCase
- the test case being added.public void setUp()
public void tearDown()
public 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.Copyright © 2005–2017 Javolution. All rights reserved.