Package randoop.test
Class ObjectCheck
java.lang.Object
randoop.test.ObjectCheck
- All Implemented Interfaces:
Check
A check that checks for expected properties of one or more objects generated during the execution
of a
Sequence
, for example:
- Checking that the objects created during execution of a sequence respect reflexivity, transitivity and symmetry of equality.
- Checking that calling
toString()
on the objects created during execution of a sequence does not throw an exception.
An ObjectCheck
has two parts:
- A
ObjectContract
responsible for performing the actual check on a set of runtime values. For example. the classEqualsReflexive
is a checker code class that, given an object o, calls o.equals(o) and checks that it returnstrue
. - A list of
Variable
s, which describe the specific objects in the sequence that the check is over.
-
Field Summary
Modifier and TypeFieldDescriptionprivate final ObjectContract
The contract that is checked.private final Variable[]
The variables for the contract. -
Constructor Summary
ConstructorDescriptionObjectCheck
(ObjectContract contract, Variable... vars) Creates anObjectCheck
for the given contract using the variables as input. -
Method Summary
-
Field Details
-
contract
The contract that is checked. -
vars
The variables for the contract.
-
-
Constructor Details
-
ObjectCheck
Creates anObjectCheck
for the given contract using the variables as input.- Parameters:
contract
- the contract to checkvars
- the input variables for the created check
-
-
Method Details
-
equals
-
hashCode
public int hashCode() -
toString
-
toCodeStringPreStatement
Description copied from interface:Check
Returns a string of Java source code to be emitted before a statement containing this check.- Specified by:
toCodeStringPreStatement
in interfaceCheck
- Returns:
- the string to be included before the statement
-
toCodeStringPostStatement
Description copied from interface:Check
Returns a string of Java source code to be emitted after a statement containing this check.- Specified by:
toCodeStringPostStatement
in interfaceCheck
- Returns:
- the string to be included following the statement
-