Logo Search packages:      
Sourcecode: jmock2 version File versions  Download package

org::jmock::Expectations Class Reference

Inheritance diagram for org::jmock::Expectations:

List of all members.

Detailed Description

Provides most of the syntax of jMock's "domain-specific language" API. The methods of this class don't make any sense on their own, so the Javadoc is rather sparse. Consult the documentation on the jMock website for information on how to use this API.


Definition at line 45 of file Expectations.java.

Public Member Functions

MethodClause allowing (Matcher<?> mockObjectMatcher)
ReceiverClause atLeast (int count)
ReceiverClause atMost (int count)
ReceiverClause between (int minCount, int maxCount)
void buildExpectations (Action defaultAction, ExpectationCollector collector)
ReceiverClause exactly (int count)
MethodClause ignoring (Matcher<?> mockObjectMatcher)
void inSequence (Sequence sequence)
void inSequences (Sequence...sequences)
void then (State state)
void when (StatePredicate predicate)
void will (Action action)
double with (double value)
float with (float value)
long with (long value)
int with (int value)
char with (char value)
short with (short value)
byte with (byte value)
boolean with (boolean value)
double with (Matcher< Double > matcher)
float with (Matcher< Float > matcher)
long with (Matcher< Long > matcher)
int with (Matcher< Integer > matcher)
char with (Matcher< Character > matcher)
short with (Matcher< Short > matcher)
byte with (Matcher< Byte > matcher)
boolean with (Matcher< Boolean > matcher)

Static Public Member Functions

static Matcher< Object > a (Class<?> type)
static Matcher< Object > an (Class<?> type)
static< T > Matcher< T > aNonNull (@SuppressWarnings("unused") Class< T > type)
static< T > Matcher< T > aNull (@SuppressWarnings("unused") Class< T > type)
static< T > Matcher< T > any (@SuppressWarnings("unused") Class< T > type)
static< T > Matcher< T > anything ()
static Action doAll (Action...actions)
static< T > Matcher< T > equal (T value)
static Action onConsecutiveCalls (Action...actions)
static< T > Action returnEnumeration (T...items)
static Action returnEnumeration (Collection<?> collection)
static< T > Action returnIterator (T...items)
static Action returnIterator (Collection<?> collection)
static Action returnValue (Object result)
static< T > Matcher< T > same (T value)
static Action throwException (Throwable throwable)

Protected Member Functions

InvocationExpectationBuilder currentBuilder ()

Package Functions

public< T > T allowing (T mockObject)
public< T > T ignoring (T mockObject)
public< T > T never (T mockObject)
public< T > T one (T mockObject)
public< T > T oneOf (T mockObject)
public< T > T with (T value)
public< T > T with (Matcher< T > matcher)

Private Member Functions

void addParameterMatcher (Matcher<?> matcher)
void checkLastExpectationWasFullySpecified ()
void initialiseExpectationCapture (Cardinality cardinality)

Private Attributes

< InvocationExpectationBuilder > 
builders = new ArrayList<InvocationExpectationBuilder>()
InvocationExpectationBuilder currentBuilder = null

The documentation for this class was generated from the following file:

Generated by  Doxygen 1.6.0   Back to index