public abstract class T_Generic extends java.lang.Object implements UnitTest, org.apache.derby.iapi.services.monitor.ModuleControl
To write a test, extend this class with a class which implements the two abstract methods:
UnitTest
,
ModuleControl
Modifier and Type | Field and Description |
---|---|
protected org.apache.derby.iapi.services.stream.HeaderPrintWriter |
out
The HeaderPrintWriter for test output.
|
protected java.lang.String |
shortModuleToTestName
The unqualified name for the module to test.
|
protected java.util.Properties |
startParams
The start parameters for your test.
|
Modifier | Constructor and Description |
---|---|
protected |
T_Generic() |
Modifier and Type | Method and Description |
---|---|
void |
boot(boolean create,
java.util.Properties startParams)
ModuleControl.start
|
boolean |
Execute(org.apache.derby.iapi.services.stream.HeaderPrintWriter out)
UnitTest.Execute
|
protected boolean |
FAIL(java.lang.String msg)
Emit a message indicating why the test failed.
|
protected abstract java.lang.String |
getModuleToTestProtocolName()
Get the name of the protocol for the module to test.
|
protected boolean |
PASS(java.lang.String testName)
Emit a message saying the test passed.
|
void |
REPORT(java.lang.String msg)
Emit a message during a unit test run, indent the message
to allow the PASS/FAIL messages to stand out.
|
protected abstract void |
runTests()
Run the test.
|
void |
stop()
ModuleControl.stop
|
int |
UnitTestDuration()
UnitTest.UnitTestDuration
|
int |
UnitTestType()
UnitTest.UnitTestType
|
protected java.lang.String shortModuleToTestName
protected java.util.Properties startParams
protected org.apache.derby.iapi.services.stream.HeaderPrintWriter out
public void boot(boolean create, java.util.Properties startParams) throws org.apache.derby.iapi.error.StandardException
boot
in interface org.apache.derby.iapi.services.monitor.ModuleControl
org.apache.derby.iapi.error.StandardException
- Module cannot be started.ModuleControl.boot(boolean, java.util.Properties)
public void stop()
stop
in interface org.apache.derby.iapi.services.monitor.ModuleControl
ModuleControl.stop()
public boolean Execute(org.apache.derby.iapi.services.stream.HeaderPrintWriter out)
Execute
in interface UnitTest
out
- A HeaderPrintWriter the test may use for tracing.
To disable tracing the caller may provide a
HeaderPrintWriter which throws away all the data
the test writes.UnitTest.Execute(org.apache.derby.iapi.services.stream.HeaderPrintWriter)
public int UnitTestDuration()
UnitTestDuration
in interface UnitTest
UnitTest.UnitTestDuration()
,
UnitTestConstants
public int UnitTestType()
UnitTestType
in interface UnitTest
UnitTest.UnitTestType()
,
UnitTestConstants
protected boolean FAIL(java.lang.String msg)
msg
- the message.protected boolean PASS(java.lang.String testName)
RESOLVE:Localize this.
testName
- the test which passed.public void REPORT(java.lang.String msg)
protected abstract void runTests() throws java.lang.Exception
java.lang.Exception
- Test code throws theseprotected abstract java.lang.String getModuleToTestProtocolName()
Apache Derby V10.13 Internals - Copyright © 2004,2016 The Apache Software Foundation. All Rights Reserved.