public class Expectations extends Object implements org.jmock.internal.ExpectationBuilder, CardinalityClause, ArgumentConstraintPhrases, ActionClause
Constructor and Description |
---|
Expectations() |
Modifier and Type | Method and Description |
---|---|
static org.hamcrest.Matcher<Object> |
a(Class<?> type)
Deprecated.
use
aNonNull(java.lang.Class<T>) or any(java.lang.Class<T>) until type inference actually works in a future version of Java |
MethodClause |
allowing(org.hamcrest.Matcher<?> mockObjectMatcher) |
<T> T |
allowing(T mockObject) |
static org.hamcrest.Matcher<Object> |
an(Class<?> type)
Deprecated.
use
aNonNull(java.lang.Class<T>) or any(java.lang.Class<T>) until type inference actually works in a future version of Java |
static <T> org.hamcrest.Matcher<T> |
aNonNull(Class<T> type) |
static <T> org.hamcrest.Matcher<T> |
aNull(Class<T> type) |
static <T> org.hamcrest.Matcher<T> |
any(Class<T> type) |
static <T> org.hamcrest.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> org.hamcrest.Matcher<T> |
equal(T value) |
ReceiverClause |
exactly(int count) |
MethodClause |
ignoring(org.hamcrest.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> org.hamcrest.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) |
<T> T |
with(org.hamcrest.Matcher<T> matcher) |
short |
with(short value) |
<T> T |
with(T value) |
boolean |
withBoolean(org.hamcrest.Matcher<Boolean> matcher) |
byte |
withByte(org.hamcrest.Matcher<Byte> matcher) |
char |
withCharacter(org.hamcrest.Matcher<Character> matcher) |
double |
withDouble(org.hamcrest.Matcher<Double> matcher) |
float |
withFloat(org.hamcrest.Matcher<Float> matcher) |
int |
withInteger(org.hamcrest.Matcher<Integer> matcher) |
long |
withLong(org.hamcrest.Matcher<Long> matcher) |
short |
withShort(org.hamcrest.Matcher<Short> matcher) |
public void buildExpectations(Action defaultAction, org.jmock.internal.ExpectationCollector collector)
buildExpectations
in interface org.jmock.internal.ExpectationBuilder
protected org.jmock.internal.InvocationExpectationBuilder currentBuilder()
public ReceiverClause exactly(int count)
exactly
in interface CardinalityClause
public <T> T oneOf(T mockObject)
public <T> T one(T mockObject)
oneOf
instead.one
in interface CardinalityClause
public ReceiverClause atLeast(int count)
atLeast
in interface CardinalityClause
public ReceiverClause between(int minCount, int maxCount)
between
in interface CardinalityClause
public ReceiverClause atMost(int count)
atMost
in interface CardinalityClause
public MethodClause allowing(org.hamcrest.Matcher<?> mockObjectMatcher)
allowing
in interface CardinalityClause
public <T> T allowing(T mockObject)
allowing
in interface CardinalityClause
public <T> T ignoring(T mockObject)
ignoring
in interface CardinalityClause
public MethodClause ignoring(org.hamcrest.Matcher<?> mockObjectMatcher)
ignoring
in interface CardinalityClause
public <T> T never(T mockObject)
never
in interface CardinalityClause
public <T> T with(org.hamcrest.Matcher<T> matcher)
with
in interface ArgumentConstraintPhrases
public boolean withBoolean(org.hamcrest.Matcher<Boolean> matcher)
withBoolean
in interface ArgumentConstraintPhrases
public byte withByte(org.hamcrest.Matcher<Byte> matcher)
withByte
in interface ArgumentConstraintPhrases
public short withShort(org.hamcrest.Matcher<Short> matcher)
withShort
in interface ArgumentConstraintPhrases
public char withCharacter(org.hamcrest.Matcher<Character> matcher)
public int withInteger(org.hamcrest.Matcher<Integer> matcher)
withInteger
in interface ArgumentConstraintPhrases
public long withLong(org.hamcrest.Matcher<Long> matcher)
withLong
in interface ArgumentConstraintPhrases
public float withFloat(org.hamcrest.Matcher<Float> matcher)
withFloat
in interface ArgumentConstraintPhrases
public double withDouble(org.hamcrest.Matcher<Double> matcher)
withDouble
in interface ArgumentConstraintPhrases
public boolean with(boolean value)
public byte with(byte value)
public short with(short value)
public char with(char value)
public int with(int value)
public long with(long value)
public float with(float value)
public double with(double value)
public <T> T with(T value)
public void will(Action action)
will
in interface ActionClause
public static <T> org.hamcrest.Matcher<T> equal(T value)
public static <T> org.hamcrest.Matcher<T> same(T value)
public static <T> org.hamcrest.Matcher<T> any(Class<T> type)
public static <T> org.hamcrest.Matcher<T> anything()
@Deprecated public static org.hamcrest.Matcher<Object> a(Class<?> type)
aNonNull(java.lang.Class<T>)
or any(java.lang.Class<T>)
until type inference actually works in a future version of Java@Deprecated public static org.hamcrest.Matcher<Object> an(Class<?> type)
aNonNull(java.lang.Class<T>)
or any(java.lang.Class<T>)
until type inference actually works in a future version of Javapublic static <T> org.hamcrest.Matcher<T> aNull(Class<T> type)
public static <T> org.hamcrest.Matcher<T> aNonNull(Class<T> type)
public static Action returnIterator(Collection<?> collection)
public static <T> Action returnIterator(T... items)
public static Action returnEnumeration(Collection<?> collection)
public static <T> Action returnEnumeration(T... items)
public void when(org.jmock.internal.StatePredicate predicate)
public void then(org.jmock.internal.State state)
public void inSequence(Sequence sequence)
public void inSequences(Sequence... sequences)