|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectthings.testing.unit.Test
public abstract class Test
UNIT testing tool. This is a test. It will run a set of test cases. A test is implemented
by the following steps:
1- Implement the test_prepare() method. Test cases will be DECLARED(String) by name.
2- Implement the test_execute() method. Each case should be reported with a PASS(), FAIL(),
INCONCLUSIVE(), or EXCEPTION(). You may use ABORT() at any time to abort the remaining
tests.
3- Call the test in a TestGroup
You should not call any other method in this class.
The result fields are readable after the test is run.
Version History
EPG - Initial - 26 JUL 04 EPG - Re-write - 19 JUN 05
Field Summary | |
---|---|
int |
abort
|
int |
exception
|
int |
fail
|
int |
inconclusive
|
int |
pass
|
protected ThingsPropertyView |
properties
Properties passed to the test by the harness. |
Result |
result
|
protected java.lang.String |
testName
|
long |
time
|
int |
total
|
long |
totalSize
|
Constructor Summary | |
---|---|
Test()
|
Method Summary | |
---|---|
void |
ABORT(java.lang.String name,
java.lang.String message)
ABORT THIS TEST. |
void |
CODE(java.lang.String name,
java.lang.String code)
Set the CODE for the case. |
void |
COMMENT(java.lang.String name,
java.lang.String message)
COMMENT into the test report |
void |
DECLARE(java.lang.String name)
DECLARE a test case. |
void |
EXCEPTION(java.lang.String name,
java.lang.String message)
EXCEPTION test case report |
void |
EXCEPTION(java.lang.String name,
java.lang.Throwable theException)
EXCEPTION test case report |
Result |
execute()
Run the test. |
void |
FAIL(java.lang.String name,
java.lang.String message)
FAIL a test case report |
java.lang.String |
getLongName()
Get the long name of this test. |
java.lang.String |
getName()
Get the name of this test. |
void |
INCONCLUSIVE(java.lang.String name,
java.lang.String message)
INCONCLUSIVE test case report. |
void |
LOG(java.lang.String text)
Log a comment. |
void |
PASS(java.lang.String name)
PASS a test case report. |
void |
PASS(java.lang.String name,
java.lang.String message)
PASS a test case report with a message. |
void |
prepare(java.lang.String runnerNaming,
java.lang.String givenName,
ResultExpresser expresserIn,
StringPoster log,
ThingsPropertyView view,
int inDepth)
Prepare for the test. |
static void |
PUNT(java.lang.String text)
PUNT is a simple convenience that tosses a test fail exception. |
void |
SET_LONG_NAME(java.lang.String name)
Set the long name for this test. |
void |
SIZE(java.lang.String name,
long size)
Set the SIZE for the case. |
abstract void |
test_execute()
Run the test. |
abstract void |
test_prepare()
Prepare for the test. |
void |
TIME(java.lang.String name,
long time)
Set the TIME for the case. |
void |
VALUE(java.lang.String name,
java.lang.String n,
java.lang.String v)
Set a VALUE for the case. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public int total
public int pass
public int fail
public int abort
public int inconclusive
public int exception
public long time
public long totalSize
public Result result
protected ThingsPropertyView properties
protected java.lang.String testName
Constructor Detail |
---|
public Test()
Method Detail |
---|
public abstract void test_prepare() throws java.lang.Throwable
java.lang.Throwable
public abstract void test_execute() throws java.lang.Throwable
java.lang.Throwable
public void LOG(java.lang.String text) throws ThingsException
text
- the text of the comment
ThingsException
public void DECLARE(java.lang.String name) throws ThingsException
name
- the name of the test. It should be unique
ThingsException
public void PASS(java.lang.String name, java.lang.String message) throws ThingsException
name
- test namemessage
- information
ThingsException
public void PASS(java.lang.String name) throws ThingsException
name
- test name
ThingsException
public void EXCEPTION(java.lang.String name, java.lang.String message) throws ThingsException
name
- test namemessage
- information
ThingsException
public void EXCEPTION(java.lang.String name, java.lang.Throwable theException) throws ThingsException
name
- test nametheException
- the exception that caused it
ThingsException
public void FAIL(java.lang.String name, java.lang.String message) throws ThingsException
name
- test namemessage
- information
ThingsException
public void ABORT(java.lang.String name, java.lang.String message) throws TestAbortException, ThingsException
name
- test namemessage
- information
TestAbortException
ThingsException
public void INCONCLUSIVE(java.lang.String name, java.lang.String message) throws ThingsException
name
- test namemessage
- information
ThingsException
public void TIME(java.lang.String name, long time) throws ThingsException
name
- test nametime
- the time in milliseconds
ThingsException
public void SIZE(java.lang.String name, long size) throws ThingsException
name
- test namesize
- the size
ThingsException
public void CODE(java.lang.String name, java.lang.String code) throws ThingsException
name
- test namecode
- the code
ThingsException
public void VALUE(java.lang.String name, java.lang.String n, java.lang.String v) throws ThingsException
name
- test namen
- the name for the valuev
- the value
ThingsException
public static void PUNT(java.lang.String text) throws TestLocalException
text
- the text of the punt
TestLocalException
public void COMMENT(java.lang.String name, java.lang.String message) throws ThingsException
name
- test namemessage
- information
ThingsException
public void SET_LONG_NAME(java.lang.String name)
name
- the long name as a string.public java.lang.String getName() throws ThingsException
ThingsException
public java.lang.String getLongName() throws ThingsException
ThingsException
public void prepare(java.lang.String runnerNaming, java.lang.String givenName, ResultExpresser expresserIn, StringPoster log, ThingsPropertyView view, int inDepth) throws ThingsException
runnerNaming
- is the name giving to the test run by the running agentgivenName
- the name given to this test.expresserIn
- is the ResultExpresser to use.log
- a string poster used for logging non-result information.view
- is a preperties view that will be avaible to the test
implementationinDepth
- the depth of this test.
ThingsException
ThingsPropertyView
public Result execute() throws ThingsException
ThingsException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |