Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jmock
Class Expectations

    java.lang.Object
      org.jmock.Expectations

All Implemented Interfaces:
  org.jmock.internal.ExpectationBuilder, ActionClause, ArgumentConstraintPhrases, CardinalityClause

    public class Expectations

extends Object
implements org.jmock.internal.ExpectationBuilder, CardinalityClause, ArgumentConstraintPhrases, ActionClause

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.

Author:
  nat

Constructor Summary
`Expectations()`

Method Summary
`static Matcher<Object>` | `a(Class<?> type)` Deprecated. use `aNonNull(java.lang.Class)` or `any(java.lang.Class)` until type inference actually works in a future version of Java
`MethodClause` | `allowing(Matcher<?> mockObjectMatcher)`
`
`<T> T`
` | `allowing(T mockObject)`
`static Matcher<Object>` | `an(Class<?> type)` Deprecated. use `aNonNull(java.lang.Class)` or `any(java.lang.Class)` until type inference actually works in a future version of Java
`static
`<T> Matcher<T>`
` | `aNonNull(Class<T> type)`
`static
`<T> Matcher<T>`
` | `aNull(Class<T> type)`
`static
`<T> Matcher<T>`
` | `any(Class<T> type)`
`static
`<T> Matcher<T>`
` | `anything()`
`ReceiverClause` | `atLeast(int count)`
`ReceiverClause` | `atMost(int count)`
`ReceiverClause` | `between(int minCount, int maxCount)`
`void` | `buildExpectations(Action defaultAction, org.jmock.internal.ExpectationCollector collector)`
`protected org.jmock.internal.InvocationExpectationBuilder` | `currentBuilder()`
`static Action` | `doAll(Action... actions)`
`static
`<T> Matcher<T>`
` | `equal(T value)`
`ReceiverClause` | `exactly(int count)`
`MethodClause` | `ignoring(Matcher<?> mockObjectMatcher)`
`
`<T> T`
` | `ignoring(T mockObject)`
`void` | `inSequence(Sequence sequence)`
`void` | `inSequences(Sequence... sequences)`
`
`<T> T`
` | `never(T mockObject)`
`static Action` | `onConsecutiveCalls(Action... actions)`
`
`<T> T`
` | `one(T mockObject)` This will eventually be deprecated.
`
`<T> T`
` | `oneOf(T mockObject)`
`static Action` | `returnEnumeration(Collection<?> collection)`
`static
`<T> Action`
` | `returnEnumeration(T... items)`
`static Action` | `returnIterator(Collection<?> collection)`
`static
`<T> Action`
` | `returnIterator(T... items)`
`static Action` | `returnValue(Object result)`
`static
`<T> Matcher<T>`
` | `same(T value)`
`void` | `then(org.jmock.internal.State state)`
`static Action` | `throwException(Throwable throwable)`
`void` | `when(org.jmock.internal.StatePredicate predicate)`
`void` | `will(Action action)`
`boolean` | `with(boolean value)`
`byte` | `with(byte value)`
`char` | `with(char value)`
`double` | `with(double value)`
`float` | `with(float value)`
`int` | `with(int value)`
`long` | `with(long value)`
`boolean` | `with(Matcher<Boolean> matcher)`
`byte` | `with(Matcher<Byte> matcher)`
`char` | `with(Matcher<Character> matcher)`
`double` | `with(Matcher<Double> matcher)`
`float` | `with(Matcher<Float> matcher)`
`int` | `with(Matcher<Integer> matcher)`
`long` | `with(Matcher<Long> matcher)`
`short` | `with(Matcher<Short> matcher)`
`
`<T> T`
` | `with(Matcher<T> matcher)`
`short` | `with(short value)`
`
`<T> T`
` | `with(T value)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Expectations

    public Expectations()

Method Detail

### buildExpectations

    public void buildExpectations(Action defaultAction,
                                  org.jmock.internal.ExpectationCollector collector)

  Specified by:
    `buildExpectations` in interface `org.jmock.internal.ExpectationBuilder`

### currentBuilder

    protected org.jmock.internal.InvocationExpectationBuilder currentBuilder()

### exactly

    public ReceiverClause exactly(int count)

  Specified by:
    `exactly` in interface `CardinalityClause`

### oneOf

    public <T> T oneOf(T mockObject)

### one

    public <T> T one(T mockObject)

  This will eventually be deprecated. Use `oneOf` instead.

  Specified by:
    `one` in interface `CardinalityClause`

### atLeast

    public ReceiverClause atLeast(int count)

  Specified by:
    `atLeast` in interface `CardinalityClause`

### between

    public ReceiverClause between(int minCount,
                                  int maxCount)

  Specified by:
    `between` in interface `CardinalityClause`

### atMost

    public ReceiverClause atMost(int count)

  Specified by:
    `atMost` in interface `CardinalityClause`

### allowing

    public MethodClause allowing(Matcher<?> mockObjectMatcher)

  Specified by:
    `allowing` in interface `CardinalityClause`

### allowing

    public <T> T allowing(T mockObject)

  Specified by:
    `allowing` in interface `CardinalityClause`

### ignoring

    public <T> T ignoring(T mockObject)

  Specified by:
    `ignoring` in interface `CardinalityClause`

### ignoring

    public MethodClause ignoring(Matcher<?> mockObjectMatcher)

  Specified by:
    `ignoring` in interface `CardinalityClause`

### never

    public <T> T never(T mockObject)

  Specified by:
    `never` in interface `CardinalityClause`

### with

    public <T> T with(Matcher<T> matcher)

  Specified by:
    `with` in interface `ArgumentConstraintPhrases`

### with

    public boolean with(Matcher<Boolean> matcher)

  Specified by:
    `with` in interface `ArgumentConstraintPhrases`

### with

    public byte with(Matcher<Byte> matcher)

  Specified by:
    `with` in interface `ArgumentConstraintPhrases`

### with

    public short with(Matcher<Short> matcher)

  Specified by:
    `with` in interface `ArgumentConstraintPhrases`

### with

    public char with(Matcher<Character> matcher)

### with

    public int with(Matcher<Integer> matcher)

  Specified by:
    `with` in interface `ArgumentConstraintPhrases`

### with

    public long with(Matcher<Long> matcher)

  Specified by:
    `with` in interface `ArgumentConstraintPhrases`

### with

    public float with(Matcher<Float> matcher)

  Specified by:
    `with` in interface `ArgumentConstraintPhrases`

### with

    public double with(Matcher<Double> matcher)

  Specified by:
    `with` in interface `ArgumentConstraintPhrases`

### with

    public boolean with(boolean value)

### with

    public byte with(byte value)

### with

    public short with(short value)

### with

    public char with(char value)

### with

    public int with(int value)

### with

    public long with(long value)

### with

    public float with(float value)

### with

    public double with(double value)

### with

    public <T> T with(T value)

### will

    public void will(Action action)

  Specified by:
    `will` in interface `ActionClause`

### equal

    public static <T> Matcher<T> equal(T value)

### same

    public static <T> Matcher<T> same(T value)

### any

    public static <T> Matcher<T> any(Class<T> type)

### anything

    public static <T> Matcher<T> anything()

### a

    @Deprecated
    public static Matcher<Object> a(Class<?> type)

  Deprecated. use `aNonNull(java.lang.Class)` or `any(java.lang.Class)` until type inference actually works in a future version of Java

### an

    @Deprecated
    public static Matcher<Object> an(Class<?> type)

  Deprecated. use `aNonNull(java.lang.Class)` or `any(java.lang.Class)` until type inference actually works in a future version of Java

### aNull

    public static <T> Matcher<T> aNull(Class<T> type)

### aNonNull

    public static <T> Matcher<T> aNonNull(Class<T> type)

### returnValue

    public static Action returnValue(Object result)

### throwException

    public static Action throwException(Throwable throwable)

### returnIterator

    public static Action returnIterator(Collection<?> collection)

### returnIterator

    public static <T> Action returnIterator(T... items)

### returnEnumeration

    public static Action returnEnumeration(Collection<?> collection)

### returnEnumeration

    public static <T> Action returnEnumeration(T... items)

### doAll

    public static Action doAll(Action... actions)

### onConsecutiveCalls

    public static Action onConsecutiveCalls(Action... actions)

### when

    public void when(org.jmock.internal.StatePredicate predicate)

### then

    public void then(org.jmock.internal.State state)

### inSequence

    public void inSequence(Sequence sequence)

### inSequences

    public void inSequences(Sequence... sequences)

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD