public abstract class TimedTestFramework
extends java.lang.Object
Modifier and Type | Field | Description |
---|---|---|
protected int |
badCount |
|
protected java.lang.String |
currentTestName |
|
protected int |
outputLimit |
|
protected java.io.PrintStream |
realStandardError |
|
protected java.io.PrintStream |
realStandardOutput |
|
protected int |
testCount |
|
protected int |
wrongCount |
Modifier | Constructor | Description |
---|---|---|
protected |
TimedTestFramework() |
Modifier and Type | Method | Description |
---|---|---|
protected void |
captureStandardOutput() |
Start storing up the standard output into a string.
|
protected void |
check(boolean test) |
Check that TEST is true, printing PASSED or ERROR messages
accordingly and updating test and error counts.
|
protected void |
check(java.lang.Object correct,
java.lang.Object test) |
Check that CORRECT is equal to TEST, using the "same" test below.
|
protected void |
check(java.lang.String msg,
boolean test) |
Check that TEST is true, printing either a PASSED message or
or an ERROR message incorporating MSG accordingly and updating
test and error counts.
|
protected void |
check(java.lang.String msg,
java.lang.Object correct,
java.lang.Object test) |
Check that CORRECT is equal to TEST, using the "same" test below.
|
protected void |
failure(java.lang.String msg) |
Report a "failure" (typically a test that blows up instead of producing
a result).
|
protected void |
failure(java.lang.Throwable e) |
Report a "failure" from exception E.
|
int |
getBadCount() |
Cumulative number of "bad" tests: those causing an exception
|
protected java.lang.String |
getCapturedError() |
Return the captured output from the standard error output.
|
protected java.lang.String |
getCapturedOutput() |
Return the captured output from the standard output.
|
int |
getErrorCount() |
Cumulative count of tests that fail due to exceptions.
|
int |
getPassedCount() |
Passed tests.
|
int |
getTestCount() |
Cumulative number of calls to check.
|
int |
getWrongCount() |
Cumulative number of calls to where the arguments were not the same.
|
protected void |
report() |
|
protected void |
restoreStandardOutput() |
Stop capturing standard output, and revert to initial behavior.
|
static boolean |
same(java.lang.Object x,
java.lang.Object y) |
True iff X equals Y in the sense that either
1) X and Y are arrays of the same length and their respective
elements are == (if primitive) and (recursively) the same otherwise;
or
2) X and Y are both null.
|
static boolean |
sameArrays(java.lang.Object x,
java.lang.Object y) |
|
protected void |
setTestName(java.lang.String name) |
|
protected void |
setVerbosity(boolean verbose) |
|
static java.lang.String |
toString(java.lang.Object x) |
protected int testCount
protected int wrongCount
protected int badCount
protected java.lang.String currentTestName
protected final java.io.PrintStream realStandardOutput
protected final java.io.PrintStream realStandardError
protected int outputLimit
protected void report()
protected void setVerbosity(boolean verbose)
protected void setTestName(java.lang.String name)
protected void captureStandardOutput()
protected void restoreStandardOutput()
protected java.lang.String getCapturedOutput()
protected java.lang.String getCapturedError()
protected void check(boolean test)
protected void check(java.lang.Object correct, java.lang.Object test)
protected void check(java.lang.String msg, java.lang.Object correct, java.lang.Object test)
protected void check(java.lang.String msg, boolean test)
protected void failure(java.lang.String msg)
protected void failure(java.lang.Throwable e)
public static boolean same(java.lang.Object x, java.lang.Object y)
public static boolean sameArrays(java.lang.Object x, java.lang.Object y)
public static java.lang.String toString(java.lang.Object x)
public int getTestCount()
public int getPassedCount()
public int getWrongCount()
public int getBadCount()
public int getErrorCount()