|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
The base interface for all test cases. Application test designers must derive their tests from TestCase directly or indirectly. The same TestCase class can be used in many test suites , or even in the same suite with different test parameters. Since TestCases are stateful , they cannot be shared. Thereforre , a new instance is created for every TestCase. TestCase implementers must provide the implementation class with a default constructor.
Method Summary | |
void |
init(TestParameters params)
Initializes the TestCase with the given test parameters. |
void |
test(java.io.PrintStream output)
Runs the test. |
Method Detail |
public void init(TestParameters params) throws ParameterException
public void init(TestParameters params) throws ParameterException {
bytes = params.getBytesArray("data");
try {
optionalParam = params.getString("optionalParam");
}
catch(MissingParameterException mpe) {
// do nothing
}
}
params
- The object containing the test data (parameters).public void test(java.io.PrintStream output) throws java.lang.Throwable
The test case developer should not try to catch any exception just to print the exception stack trace. Instead , the test case should focus on the methods to be tested using the given test parameters passed in via init(). If the test developer developes pesimistic test cases (which are recommanded) , any exception that is expected to be raised under these conditions , may be logged , but it must not fail the Test.
output
- The output stream to which the test case should write
diagnostics and informatories.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |