Package com.mockobjects.util
Class Null
java.lang.Object
com.mockobjects.util.Null
A class that represents the
null value.
The Null class is used when an
Expectation is set to expect nothing.
Example usage:
public class MockX {
private Expectation... anExpectation = new Expectation...(...);
public MockX() {
anExpectation.setExpectNothing();
}
public void setAnExpectation(Object value) {
anExpectation.setExpected(value);
}
public void setActual(Object value) {
anExpectation.setActual(value);
}
}
The act of calling Expectation.setExpectNothing()
tells the expectation that it should expect no values to change. Since
all Null objects are equal to themselves,
most expectations set their expected value to an instance of
Null, and at the same time, set their actual
value to another instance of Null.
This way, when verify() checks
expectations, they will compare two Null
objects together, which is guaranteed to succeed.- Version:
- $Id: Null.java,v 1.3 2002/03/28 18:16:54 custommonkey Exp $
- Author:
- Francois Beausoleil (fbos@users.sourceforge.net)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
DEFAULT_DESCRIPTION
The default description for allNullobjects. This String is equal to "Null".- See Also:
-
NULL
-
-
Constructor Details
-
Method Details