|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jmock.Expectations
public class Expectations
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.
| Field Summary | |
|---|---|
protected WithClause |
with
|
| 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)
|
|
|
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
|
aNonNull(Class<T> type)
|
|
static
|
aNull(Class<T> type)
|
|
static
|
any(Class<T> type)
|
|
static
|
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
|
equal(T value)
|
|
ReceiverClause |
exactly(int count)
|
|
MethodClause |
ignoring(Matcher<?> mockObjectMatcher)
|
|
|
ignoring(T mockObject)
|
|
void |
inSequence(Sequence sequence)
|
|
void |
inSequences(Sequence... sequences)
|
|
|
never(T mockObject)
|
|
static Action |
onConsecutiveCalls(Action... actions)
|
|
|
one(T mockObject)
Deprecated. Use oneOf instead. |
|
|
oneOf(T mockObject)
|
|
static Action |
returnEnumeration(Collection<?> collection)
|
|
static
|
returnEnumeration(T... items)
|
|
static Action |
returnIterator(Collection<?> collection)
|
|
static
|
returnIterator(T... items)
|
|
static Action |
returnValue(Object result)
|
|
static
|
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)
Alternatively, use with. |
|
byte |
with(Matcher<Byte> matcher)
Alternatively, use with. |
|
char |
with(Matcher<Character> matcher)
Alternatively, use with. |
|
double |
with(Matcher<Double> matcher)
Alternatively, use with. |
|
float |
with(Matcher<Float> matcher)
Alternatively, use with. |
|
int |
with(Matcher<Integer> matcher)
Alternatively, use with. |
|
long |
with(Matcher<Long> matcher)
Alternatively, use with. |
|
short |
with(Matcher<Short> matcher)
Alternatively, use with. |
|
|
with(Matcher<T> matcher)
Alternatively, use with. |
|
short |
with(short value)
|
|
|
with(T value)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final WithClause with
| Constructor Detail |
|---|
public Expectations()
| Method Detail |
|---|
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)
oneOf in interface CardinalityClausepublic <T> T one(T mockObject)
oneOf instead.
one in interface CardinalityClausepublic ReceiverClause atLeast(int count)
atLeast in interface CardinalityClause
public ReceiverClause between(int minCount,
int maxCount)
between in interface CardinalityClausepublic ReceiverClause atMost(int count)
atMost in interface CardinalityClausepublic MethodClause allowing(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(Matcher<?> mockObjectMatcher)
ignoring in interface CardinalityClausepublic <T> T never(T mockObject)
never in interface CardinalityClausepublic <T> T with(Matcher<T> matcher)
with in interface ArgumentConstraintPhrasespublic boolean with(Matcher<Boolean> matcher)
with in interface ArgumentConstraintPhrasespublic byte with(Matcher<Byte> matcher)
with in interface ArgumentConstraintPhrasespublic short with(Matcher<Short> matcher)
with in interface ArgumentConstraintPhrasespublic char with(Matcher<Character> matcher)
public int with(Matcher<Integer> matcher)
with in interface ArgumentConstraintPhrasespublic long with(Matcher<Long> matcher)
with in interface ArgumentConstraintPhrasespublic float with(Matcher<Float> matcher)
with in interface ArgumentConstraintPhrasespublic double with(Matcher<Double> matcher)
with 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> Matcher<T> equal(T value)
public static <T> Matcher<T> same(T value)
public static <T> Matcher<T> any(Class<T> type)
public static <T> Matcher<T> anything()
@Deprecated public static Matcher<Object> a(Class<?> type)
aNonNull(java.lang.Class) or any(java.lang.Class) until type inference actually works in a future version of Java
@Deprecated public static Matcher<Object> an(Class<?> type)
aNonNull(java.lang.Class) or any(java.lang.Class) until type inference actually works in a future version of Java
public static <T> Matcher<T> aNull(Class<T> type)
public static <T> Matcher<T> aNonNull(Class<T> type)
public static Action returnValue(Object result)
public static Action throwException(Throwable throwable)
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 static Action doAll(Action... actions)
public static Action onConsecutiveCalls(Action... actions)
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)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||