|
OOoRunner test harness | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--lib.TestCase
TestCase
represent a factory for TestEnvironment
s
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.
TestEnvironment
Field Summary | |
PrintWriter |
log
Specifies the PrintWriter to log information. |
Constructor Summary | |
TestCase()
|
Method Summary | |
protected void |
cleanup(TestParameters tParam,
PrintWriter log)
Called while the TestCase cleanup. |
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 TestEnvironment with an
object to test and related objects. |
void |
disposeTestEnvironment(TestEnvironment tEnv,
TestParameters tParam)
Disposes the TestEnvironment when it is not needed anymore. |
String |
getObjectName()
|
TestEnvironment |
getTestEnvironment(TestParameters tParam)
Creates a TestEnvironment containing an instance of the
implementation object and related objects needed to perform test. |
protected void |
initialize(TestParameters tParam,
PrintWriter log)
Called while the TestCase initialization. |
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 |
public PrintWriter log
Constructor Detail |
public TestCase()
Method Detail |
public void setLogWriter(PrintWriter log)
public void initializeTestCase(TestParameters tParam)
TestCase
. Calls initialize()
method.tParam
- test parameters.protected void initialize(TestParameters tParam, PrintWriter log)
TestCase
initialization. In the
implementation does nothing. Subclasses can override to initialize
objects shared among all TestEnvironment
s.tParam
- test parameterslog
- writer to log information while testing#initializeTestCase()
public void cleanupTestCase(TestParameters tParam)
TestCase
. Calls cleanup()
.tParam
- test parametersprotected void cleanup(TestParameters tParam, PrintWriter log)
TestCase
cleanup. In the implementation
does nothing. Subclasses can override to cleanup objects shared among
all TestEnvironment
s.tParam
- test parameterslog
- writer to log information while testingcleanupTestCase(lib.TestParameters)
public TestEnvironment getTestEnvironment(TestParameters tParam)
TestEnvironment
containing an instance of the
implementation object and related objects needed to perform test.tParam
- test parametersTestEnvironment
#createTestEnvironment()
,
TestEnvironment
public void disposeTestEnvironment(TestEnvironment tEnv, TestParameters tParam)
TestEnvironment
when it is not needed anymore.
The method calls cleanupTestEnvironment()
.tEnv
- the environment to disposetParam
- test parameters#cleanupTestEnvironment()
protected abstract TestEnvironment createTestEnvironment(TestParameters tParam, PrintWriter log)
TestEnvironment
with an
object to test and related objects. Subclasses should implement this
method to provide the implementation and related objects. The method is
called from getTestEnvironment()
.tParam
- test parameterslog
- writer to log information while testingTestEnvironment
,
#getTestEnvironment()
protected void cleanupTestEnvironment(TestParameters Param, TestEnvironment tEnv, PrintWriter log)
TestEnvironment
. In the
implementation does nothing. Subclasses can override to clean up
the environments created by them.tParam
- test parameterstEnv
- the environment to cleanuplog
- writer to log information while testingTestEnvironment
,
#disposeTestEnvironment()
public String getObjectName()
|
OOoRunner test harness | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |