| 
 | OOoRunner test harness | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
lib
Class  TestCase
java.lang.Object | +--lib.TestCase
- Direct Known Subclasses:
- BasicTestCase
- public abstract class TestCase- extends Object
TestCase represent a factory for TestEnvironments
 creation and disposing for a given implementation object. The
 TestEnvironment contains an instance of the implementation
 object and all additional objects needed to perform tests on the object.
 
The TestCase provides four methods for its subclasses to
 define its functionality: initialize(), cleanup(),
 createTestEnvironment() and disposeTestEnvironment().
 The first two are intended to initialize and cleanup common objects shared
 among all instances of TestEnvironment produced by the
 TestCase, and they are called at the beginning and at the end of
 the TestCase lifecycle accordingly.
 
The other two are intended to produce and dispose
 TestEnvironment instances. The
 createTestEnvironment() is called to create a
 TestEnvironment instance and the
 disposeTestEnvironment() is called when the instane is not used
 anymore.
- See Also:
- TestEnvironment
| Field Summary | |
|  PrintWriter | logSpecifies the PrintWriter to log information. | 
| Constructor Summary | |
| TestCase() | |
| Method Summary | |
| protected  void | cleanup(TestParameters tParam,
        PrintWriter log)Called while the TestCasecleanup. | 
|  void | cleanupTestCase(TestParameters tParam)Cleans up the TestCase. | 
| protected  void | cleanupTestEnvironment(TestParameters Param,
                       TestEnvironment tEnv,
                       PrintWriter log)Called while disposing a TestEnvironment. | 
| protected abstract  TestEnvironment | createTestEnvironment(TestParameters tParam,
                      PrintWriter log)Called to create an instance of TestEnvironmentwith an
 object to test and related objects. | 
|  void | disposeTestEnvironment(TestEnvironment tEnv,
                       TestParameters tParam)Disposes the TestEnvironmentwhen it is not needed anymore. | 
|  String | getObjectName() | 
|  TestEnvironment | getTestEnvironment(TestParameters tParam)Creates a TestEnvironmentcontaining an instance of the
 implementation object and related objects needed to perform test. | 
| protected  void | initialize(TestParameters tParam,
           PrintWriter log)Called while the TestCaseinitialization. | 
|  void | initializeTestCase(TestParameters tParam)Initializes the TestCase. | 
|  void | setLogWriter(PrintWriter log)Sets the log to write information during testing. | 
| Methods inherited from class java.lang.Object | 
| clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait | 
| Field Detail | 
log
public PrintWriter log
- Specifies the PrintWriter to log information.
| Constructor Detail | 
TestCase
public TestCase()
| Method Detail | 
setLogWriter
public void setLogWriter(PrintWriter log)
- Sets the log to write information during testing.
initializeTestCase
public void initializeTestCase(TestParameters tParam)
- Initializes the TestCase. Callsinitialize()method.- Parameters:
- tParam- test parameters.
 
initialize
protected void initialize(TestParameters tParam, PrintWriter log)
- Called while the TestCaseinitialization. In the implementation does nothing. Subclasses can override to initialize objects shared among allTestEnvironments.- Parameters:
- tParam- test parameters- log- writer to log information while testing
- See Also:
- #initializeTestCase()
 
cleanupTestCase
public void cleanupTestCase(TestParameters tParam)
- Cleans up the TestCase. Callscleanup().- Parameters:
- tParam- test parameters
 
cleanup
protected void cleanup(TestParameters tParam, PrintWriter log)
- Called while the TestCasecleanup. In the implementation does nothing. Subclasses can override to cleanup objects shared among allTestEnvironments.- Parameters:
- tParam- test parameters- log- writer to log information while testing
- See Also:
- cleanupTestCase(lib.TestParameters)
 
getTestEnvironment
public TestEnvironment getTestEnvironment(TestParameters tParam)
- Creates a TestEnvironmentcontaining an instance of the implementation object and related objects needed to perform test.- Parameters:
- tParam- test parameters
- Returns:
- the created TestEnvironment
- See Also:
- #createTestEnvironment(),- TestEnvironment
 
disposeTestEnvironment
public void disposeTestEnvironment(TestEnvironment tEnv, TestParameters tParam)
- Disposes the TestEnvironmentwhen it is not needed anymore. The method callscleanupTestEnvironment().- Parameters:
- tEnv- the environment to dispose- tParam- test parameters
- See Also:
- #cleanupTestEnvironment()
 
createTestEnvironment
protected abstract TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log)
- Called to create an instance of TestEnvironmentwith an object to test and related objects. Subclasses should implement this method to provide the implementation and related objects. The method is called fromgetTestEnvironment().- Parameters:
- tParam- test parameters- log- writer to log information while testing
- See Also:
- TestEnvironment,- #getTestEnvironment()
 
cleanupTestEnvironment
protected void cleanupTestEnvironment(TestParameters Param, TestEnvironment tEnv, PrintWriter log)
- Called while disposing a TestEnvironment. In the implementation does nothing. Subclasses can override to clean up the environments created by them.- Parameters:
- tParam- test parameters- tEnv- the environment to cleanup- log- writer to log information while testing
- See Also:
- TestEnvironment,- #disposeTestEnvironment()
 
getObjectName
public String getObjectName()
- Returns:
- the name of the object
 
| 
 | OOoRunner test harness | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

