|
|||||||||||||||||||
30 day Evaluation Version distributed via the Maven Jar Repository. Clover is not free. You have 30 days to evaluate it. Please visit http://www.thecortex.net/clover to obtain a licensed version of Clover | |||||||||||||||||||
Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
Expectation.java | - | - | - | - |
|
1 |
/* Copyright (c) 2000-2003, jMock.org. See bundled LICENSE.txt */
|
|
2 |
package org.jmock.expectation;
|
|
3 |
|
|
4 |
/**
|
|
5 |
* An <EM>Expectation</EM> is an object that we set up at the beginning of a unit test to
|
|
6 |
* expect certain things to happen to it. If it is possible to tell, the Expectation will
|
|
7 |
* fail as soon as an incorrect value has been set.
|
|
8 |
* <p/>
|
|
9 |
* Call verify() at the end of a unit test to check for missing or incomplete values.
|
|
10 |
* <p/>
|
|
11 |
* If no expectations have been set on the object, then no checking will be done and
|
|
12 |
* verify() will do nothing.
|
|
13 |
*/
|
|
14 |
public interface Expectation extends Verifiable { |
|
15 |
|
|
16 |
/**
|
|
17 |
* Return true if any expectations have been set on this object.
|
|
18 |
*/
|
|
19 |
public boolean hasExpectations(); |
|
20 |
|
|
21 |
/**
|
|
22 |
* Tell the object to expect nothing to happen to it, perhaps because the test is exercising
|
|
23 |
* the handling of an error. The Expectation will fail if any actual values are set.
|
|
24 |
* <p/>
|
|
25 |
* Note that this is not the same as not setting any expectations, in which case verify()
|
|
26 |
* will do nothing.
|
|
27 |
*/
|
|
28 |
void setExpectNothing();
|
|
29 |
|
|
30 |
/**
|
|
31 |
* If an incorrect actual value is set, defer reporting this as a failure until verify()
|
|
32 |
* is called on this object.
|
|
33 |
*/
|
|
34 |
public void setFailOnVerify(); |
|
35 |
} |
|
36 |
|
|