public class Expectations extends java.lang.Object implements org.jmock.internal.ExpectationBuilder, CardinalityClause, ArgumentConstraintPhrases, ActionClause
| Constructor and Description |
|---|
Expectations() |
| Modifier and Type | Method and Description |
|---|---|
static org.hamcrest.Matcher<java.lang.Object> |
a(java.lang.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<java.lang.Object> |
an(java.lang.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(java.lang.Class<T> type) |
static <T> org.hamcrest.Matcher<T> |
aNull(java.lang.Class<T> type) |
static <T> org.hamcrest.Matcher<T> |
any(java.lang.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(java.util.Collection<?> collection) |
static <T> Action |
returnEnumeration(T... items) |
static Action |
returnIterator(java.util.Collection<?> collection) |
static <T> Action |
returnIterator(T... items) |
static Action |
returnValue(java.lang.Object result) |
static <T> org.hamcrest.Matcher<T> |
same(T value) |
void |
then(org.jmock.internal.State state) |
static Action |
throwException(java.lang.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<java.lang.Boolean> matcher) |
byte |
withByte(org.hamcrest.Matcher<java.lang.Byte> matcher) |
char |
withCharacter(org.hamcrest.Matcher<java.lang.Character> matcher) |
double |
withDouble(org.hamcrest.Matcher<java.lang.Double> matcher) |
float |
withFloat(org.hamcrest.Matcher<java.lang.Float> matcher) |
int |
withInteger(org.hamcrest.Matcher<java.lang.Integer> matcher) |
long |
withLong(org.hamcrest.Matcher<java.lang.Long> matcher) |
short |
withShort(org.hamcrest.Matcher<java.lang.Short> matcher) |
public void buildExpectations(Action defaultAction, org.jmock.internal.ExpectationCollector collector)
buildExpectations in interface org.jmock.internal.ExpectationBuilderprotected org.jmock.internal.InvocationExpectationBuilder currentBuilder()
public ReceiverClause exactly(int count)
exactly in interface CardinalityClausepublic <T> T oneOf(T mockObject)
public <T> T one(T mockObject)
oneOf instead.one in interface CardinalityClausepublic ReceiverClause atLeast(int count)
atLeast in interface CardinalityClausepublic ReceiverClause between(int minCount, int maxCount)
between in interface CardinalityClausepublic ReceiverClause atMost(int count)
atMost in interface CardinalityClausepublic MethodClause allowing(org.hamcrest.Matcher<?> mockObjectMatcher)
allowing in interface CardinalityClausepublic <T> T allowing(T mockObject)
allowing in interface CardinalityClausepublic <T> T ignoring(T mockObject)
ignoring in interface CardinalityClausepublic MethodClause ignoring(org.hamcrest.Matcher<?> mockObjectMatcher)
ignoring in interface CardinalityClausepublic <T> T never(T mockObject)
never in interface CardinalityClausepublic <T> T with(org.hamcrest.Matcher<T> matcher)
with in interface ArgumentConstraintPhrasespublic boolean withBoolean(org.hamcrest.Matcher<java.lang.Boolean> matcher)
withBoolean in interface ArgumentConstraintPhrasespublic byte withByte(org.hamcrest.Matcher<java.lang.Byte> matcher)
withByte in interface ArgumentConstraintPhrasespublic short withShort(org.hamcrest.Matcher<java.lang.Short> matcher)
withShort in interface ArgumentConstraintPhrasespublic char withCharacter(org.hamcrest.Matcher<java.lang.Character> matcher)
public int withInteger(org.hamcrest.Matcher<java.lang.Integer> matcher)
withInteger in interface ArgumentConstraintPhrasespublic long withLong(org.hamcrest.Matcher<java.lang.Long> matcher)
withLong in interface ArgumentConstraintPhrasespublic float withFloat(org.hamcrest.Matcher<java.lang.Float> matcher)
withFloat in interface ArgumentConstraintPhrasespublic double withDouble(org.hamcrest.Matcher<java.lang.Double> matcher)
withDouble in interface ArgumentConstraintPhrasespublic 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 ActionClausepublic 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(java.lang.Class<T> type)
public static <T> org.hamcrest.Matcher<T> anything()
@Deprecated public static org.hamcrest.Matcher<java.lang.Object> a(java.lang.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<java.lang.Object> an(java.lang.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(java.lang.Class<T> type)
public static <T> org.hamcrest.Matcher<T> aNonNull(java.lang.Class<T> type)
public static Action returnValue(java.lang.Object result)
public static Action throwException(java.lang.Throwable throwable)
public static Action returnIterator(java.util.Collection<?> collection)
public static <T> Action returnIterator(T... items)
public static Action returnEnumeration(java.util.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)