Package com.mockobjects.util
Class Verifier
java.lang.Object
com.mockobjects.util.Verifier
Helper class to verify all
Expectation
s
of an object.
The Verifier
class provides two static
methods to verify objects:
verifyObject(Object)
verifyField(Field, Object)
Example usage:
Verifying all expectations on one object at a time:
public class MockX implements Verifiable { private Expectation... anExpectation = new Expectation...(...); private Expectation... aSecondExpectation = new Expectation...(...); public void verify() { Verifier.verifyObject(this); } }This example shows how most mocks implement
Verifiable
, i.e.: by delegation.- Version:
- $Id: Verifier.java,v 1.5 2002/09/29 16:44:28 smgf Exp $
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic void
verifyObject
(Object anObject) Verifies all the fields of type Verifiable in the given object, including those inherited from superclasses.
-
Constructor Details
-
Verifier
public Verifier()
-
-
Method Details
-
verifyObject
Verifies all the fields of type Verifiable in the given object, including those inherited from superclasses.- Parameters:
anObject
- The object to be verified.
-