|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
public interface Check extends Serializable
A correctness check performed on some aspect of a unit test's execution. Examples include assertions, calls to invariant or "checkRep" methods, or try-catch clauses that check for expected exceptions.
Check objects are inserted as a decorations on
specific indices of an ExecutableSequence. Thus, a check is
always associated with a specific index in a sequence. A check at
index i means that the check is to performed after statement i
finishes executing.
A check implements two methods that specify the code to be
emitted before and/or after a statement in a Sequence
is executed.
A check may require some code to be emitted before and/or after the
statement is printed. For example, a check for checking that
x is not null after the statement "Foo x =
m()" is executed might emit the assertion code
"assertNotNull(x);", and would do so after the
statement is printed. As a second example, a check for checking
that an expected exception is thrown by a statement would need to
emit something like "try {" before the statement, and
the catch clause after the statement.
Checks are Serializable so that an ExecutableSequence can be
serialized along with its associated checks.
| Modifier and Type | Method and Description |
|---|---|
boolean |
evaluate(Execution execution)
Evaluates this check on the given unfolding execution of a sequence, returning true if the check succeeded, and false
otherwise. |
String |
get_id()
Returns a unique string identifier for the check. |
int |
get_stmt_no()
Returns the offset in the sequence of this check |
String |
get_value()
Returns a short string that can be used to uniquely identify this check. |
String |
toCodeStringPostStatement()
Returns a string of Java source code to be emitted after a statement containing this check. |
String |
toCodeStringPreStatement()
Returns a string of Java source code to be emitted before a statement containing this check. |
| Method Detail |
|---|
String toCodeStringPreStatement()
String toCodeStringPostStatement()
String get_value()
String get_id()
int get_stmt_no()
boolean evaluate(Execution execution)
true if the check succeeded, and false
otherwise.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||