|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
ObjectObjectCheck
public class ObjectCheck extends Object implements Check
A check that checks for expected properties of one or more objects
generated during the execution of a Sequence, for example:
toString() on the objects
created during execution of a sequence does not throw an exception.
An ObjectCheck has two parts:
ObjectContract responsible for performing
the actual check on a set of runtime values. For example.
the class EqualsReflexive is a checker code class that,
given an object o, calls o.equals(o) and checks that
it returns true.
Variables, which describe the specific
objects in the sequence that the check is over.
| Modifier and Type | Field and Description |
|---|---|
ObjectContract |
contract
|
int |
stmt_no
|
Variable[] |
vars
|
| Constructor and Description |
|---|
ObjectCheck(ObjectContract cc,
int stmt_no,
Variable... vars)
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o)
|
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()
For checks involving a primitive-lie value (primitive, String or null) returns a string representation of the value. |
int |
hashCode()
|
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. |
String |
toString()
|
| Methods inherited from class Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public final ObjectContract contract
public final Variable[] vars
public final int stmt_no
| Constructor Detail |
|---|
public ObjectCheck(ObjectContract cc,
int stmt_no,
Variable... vars)
| Method Detail |
|---|
public boolean equals(Object o)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Objectpublic String toCodeStringPreStatement()
Check
toCodeStringPreStatement in interface Checkpublic String toCodeStringPostStatement()
Check
toCodeStringPostStatement in interface Checkpublic String get_value()
get_value in interface Checkpublic boolean evaluate(Execution execution)
Checktrue if the check succeeded, and false
otherwise.
evaluate in interface Checkpublic int get_stmt_no()
Check
get_stmt_no in interface Checkpublic String get_id()
Check
get_id in interface Check
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||