C
- the Class type instance of the test itemR
- the type of the return value of the test procedurepublic abstract static class BevoTest.TestCase<C,R>
extends java.lang.Object
TestCase
is a test case and corresponding test procedure
for a test item. A test case is one set of inputs, expected results,
and execution conditions for a test item. A test procedure is a
sequence of actions for the execution of a test. A TestCase
incorporates the test procedure for the case. (The name
TestCaseAndProcedure
was rejected as too verbose, albeit
correct.)
A test case is specified by constructing a concrete subclass of
TestCase
, supplying the expected results and a test
procedure, in the form of an implementation of the
executeTest()
method. See the convenience classes
TestReturns
and TestThrows
for examples.
BevoTest.TestReturns
,
BevoTest.TestThrows
Modifier and Type | Method and Description |
---|---|
java.lang.Class<?> |
getClassUnderTest() |
java.lang.String |
getDescription() |
R |
getExpectedReturn() |
java.lang.Class<? extends java.lang.Throwable> |
getExpectedThrowClass() |
BevoTest.Test |
getTest() |
long |
getTimeOut() |
void |
run(BevoTest.TestLog testLog)
Execute this test procedure, and record events in the given test
log.
|
boolean |
shouldSkip()
Should this test procedure be skipped?
To be overridden, if needed, by the concrete test procedure.
|
java.lang.String |
toString() |
public BevoTest.Test getTest()
Test
which this case is part ofpublic java.lang.String getDescription()
public java.lang.Class<?> getClassUnderTest()
public long getTimeOut()
public R getExpectedReturn()
public java.lang.Class<? extends java.lang.Throwable> getExpectedThrowClass()
null
if no thrown value is expected.public void run(BevoTest.TestLog testLog) throws java.lang.InterruptedException
testLog
- the TestLog
in which to record the
test execution resultsjava.lang.InterruptedException
- if the test framework thread is
interrupted. The interrupted
status of the current thread is
cleared when this exception is
thrown.public boolean shouldSkip()
false
.true
if this test procedure should not be
run, but recorded as skipped.public java.lang.String toString()
toString
in class java.lang.Object