|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.easymock.MockControl<T>
public class MockControl<T>
A MockControl
object controls the behavior of its associated
mock object. For more information, see the EasyMock documentation.
Field Summary | |
---|---|
static ArgumentsMatcher |
ALWAYS_MATCHER
Matches always. |
static ArgumentsMatcher |
ARRAY_MATCHER
Matches if each expected argument is equal to the corresponding actual argument for non-array arguments; array arguments are compared with the appropriate java.util.Arrays.equals() -method. |
static ArgumentsMatcher |
EQUALS_MATCHER
Matches if each expected argument is equal to the corresponding actual argument. |
protected static org.easymock.internal.IBehaviorFactory |
NICE_BEHAVIOR_FACTORY
internal constant with protected visibility to allow
access for extensions. |
static org.easymock.internal.Range |
ONE
Exactly one call. |
static org.easymock.internal.Range |
ONE_OR_MORE
One or more calls. |
protected static org.easymock.internal.IBehaviorFactory |
ORDERED_BEHAVIOR_FACTORY
internal constant with protected visibility to allow
access for extensions. |
protected static org.easymock.internal.IBehaviorFactory |
UNORDERED_BEHAVIOR_FACTORY
internal constant with protected visibility to allow
access for extensions. |
static org.easymock.internal.Range |
ZERO_OR_MORE
Zero or more calls. |
Constructor Summary | |
---|---|
protected |
MockControl(java.lang.Class<T> toMock,
org.easymock.internal.IProxyFactory<T> proxyFactory,
org.easymock.internal.IBehaviorFactory behaviorFactory)
Creates a new mock control object using the provided proxy and behavior factory - this is an internal constructor with protected
visibility to allow access for extensions. |
Method Summary | ||
---|---|---|
static
|
createControl(java.lang.Class<T> toMock)
Creates a mock control object for the specified interface. |
|
static
|
createNiceControl(java.lang.Class<T> toMock)
Creates a mock control object for the specified interface. |
|
static
|
createStrictControl(java.lang.Class<T> toMock)
Creates a mock control object for the specified interface. |
|
void |
expectAndDefaultReturn(boolean ignored,
boolean value)
Same as setDefaultReturnValue(boolean) . |
|
void |
expectAndDefaultReturn(double ignored,
double value)
Same as setDefaultReturnValue(double) . |
|
void |
expectAndDefaultReturn(float ignored,
float value)
Same as setDefaultReturnValue(float) . |
|
void |
expectAndDefaultReturn(long ignored,
long value)
Same as setDefaultReturnValue(long) . |
|
|
expectAndDefaultReturn(V1 ignored,
V2 value)
Same as setDefaultReturnValue(Object) . |
|
void |
expectAndDefaultThrow(boolean ignored,
java.lang.Throwable throwable)
Same as setDefaultThrowable(Throwable) . |
|
void |
expectAndDefaultThrow(double ignored,
java.lang.Throwable throwable)
Same as setDefaultThrowable(Throwable) . |
|
void |
expectAndDefaultThrow(float ignored,
java.lang.Throwable throwable)
Same as setDefaultThrowable(Throwable) . |
|
void |
expectAndDefaultThrow(long ignored,
java.lang.Throwable throwable)
Same as setDefaultThrowable(Throwable) . |
|
void |
expectAndDefaultThrow(java.lang.Object ignored,
java.lang.Throwable throwable)
Same as setDefaultThrowable(Throwable) . |
|
void |
expectAndReturn(boolean ignored,
boolean value)
Same as setReturnValue(boolean) . |
|
void |
expectAndReturn(boolean ignored,
boolean value,
int count)
Same as setReturnValue(boolean, int) . |
|
void |
expectAndReturn(boolean ignored,
boolean value,
int min,
int max)
Same as setReturnValue(boolean, int, int) . |
|
void |
expectAndReturn(boolean ignored,
boolean value,
org.easymock.internal.Range range)
Same as setReturnValue(boolean, Range) . |
|
void |
expectAndReturn(double ignored,
double value)
Same as setReturnValue(double) . |
|
void |
expectAndReturn(double ignored,
double value,
int count)
Same as setReturnValue(double, int) . |
|
void |
expectAndReturn(double ignored,
double value,
int min,
int max)
Same as setReturnValue(double, int, int) . |
|
void |
expectAndReturn(double ignored,
double value,
org.easymock.internal.Range range)
Same as setReturnValue(double, Range) . |
|
void |
expectAndReturn(float ignored,
float value)
Same as setReturnValue(float) . |
|
void |
expectAndReturn(float ignored,
float value,
int count)
Same as setReturnValue(float, int) . |
|
void |
expectAndReturn(float ignored,
float value,
int min,
int max)
Same as setReturnValue(float, int, int) . |
|
void |
expectAndReturn(float ignored,
float value,
org.easymock.internal.Range range)
Same as setReturnValue(float, Range) . |
|
void |
expectAndReturn(long ignored,
long value)
Same as setReturnValue(long) . |
|
void |
expectAndReturn(long ignored,
long value,
int count)
Same as setReturnValue(long, int) . |
|
void |
expectAndReturn(long ignored,
long value,
int min,
int max)
Same as setReturnValue(long, int, int) . |
|
void |
expectAndReturn(long ignored,
long value,
org.easymock.internal.Range range)
Same as setReturnValue(long, Range) . |
|
|
expectAndReturn(V1 ignored,
V2 value)
Same as setReturnValue(Object) . |
|
|
expectAndReturn(V1 ignored,
V2 value,
int count)
Same as setReturnValue(Object, int) . |
|
|
expectAndReturn(V1 ignored,
V2 value,
int min,
int max)
Same as setReturnValue(Object, int, int) . |
|
|
expectAndReturn(V1 ignored,
V2 value,
org.easymock.internal.Range range)
Same as setReturnValue(Object, Range) . |
|
void |
expectAndThrow(boolean ignored,
java.lang.Throwable throwable)
Same as setThrowable(Throwable) . |
|
void |
expectAndThrow(boolean ignored,
java.lang.Throwable throwable,
int count)
Same as setThrowable(Throwable, int) . |
|
void |
expectAndThrow(boolean ignored,
java.lang.Throwable throwable,
int min,
int max)
Same as setThrowable(Throwable, int, int) . |
|
void |
expectAndThrow(boolean ignored,
java.lang.Throwable throwable,
org.easymock.internal.Range range)
Same as setThrowable(Throwable, Range) . |
|
void |
expectAndThrow(double ignored,
java.lang.Throwable throwable)
Same as setThrowable(Throwable) . |
|
void |
expectAndThrow(double ignored,
java.lang.Throwable throwable,
int count)
Same as setThrowable(Throwable, int) . |
|
void |
expectAndThrow(double ignored,
java.lang.Throwable throwable,
int min,
int max)
Same as setThrowable(Throwable, int, int) . |
|
void |
expectAndThrow(double ignored,
java.lang.Throwable throwable,
org.easymock.internal.Range range)
Same as setThrowable(Throwable, Range) . |
|
void |
expectAndThrow(float ignored,
java.lang.Throwable throwable)
Same as setThrowable(Throwable) . |
|
void |
expectAndThrow(float ignored,
java.lang.Throwable throwable,
int count)
Same as setThrowable(Throwable, int) . |
|
void |
expectAndThrow(float ignored,
java.lang.Throwable throwable,
int min,
int max)
Same as setThrowable(Throwable, int, int) . |
|
void |
expectAndThrow(float ignored,
java.lang.Throwable throwable,
org.easymock.internal.Range range)
Same as setThrowable(Throwable, Range) . |
|
void |
expectAndThrow(long ignored,
java.lang.Throwable throwable)
Same as setThrowable(Throwable) . |
|
void |
expectAndThrow(long ignored,
java.lang.Throwable throwable,
int count)
Same as setThrowable(Throwable, int) . |
|
void |
expectAndThrow(long ignored,
java.lang.Throwable throwable,
int min,
int max)
Same as setThrowable(Throwable, int, int) . |
|
void |
expectAndThrow(long ignored,
java.lang.Throwable throwable,
org.easymock.internal.Range range)
Same as setThrowable(Throwable, Range) . |
|
void |
expectAndThrow(java.lang.Object ignored,
java.lang.Throwable throwable)
Same as setThrowable(Throwable) . |
|
void |
expectAndThrow(java.lang.Object ignored,
java.lang.Throwable throwable,
int count)
Same as setThrowable(Throwable, int) . |
|
void |
expectAndThrow(java.lang.Object ignored,
java.lang.Throwable throwable,
int min,
int max)
Same as setThrowable(Throwable, int, int) . |
|
void |
expectAndThrow(java.lang.Object ignored,
java.lang.Throwable throwable,
org.easymock.internal.Range range)
Same as setThrowable(Throwable, Range) . |
|
T |
getMock()
Returns the mock object. |
|
void |
replay()
Switches the mock object from record state to replay state. |
|
void |
reset()
Resets the mock control and the mock object to the state directly after creation. |
|
void |
setDefaultMatcher(ArgumentsMatcher matcher)
Sets the default ArgumentsMatcher for all methods of the mock object. |
|
void |
setDefaultReturnValue(boolean value)
Records that the mock object will by default allow the last method specified by a method call, and will react by returning the provided return value. |
|
void |
setDefaultReturnValue(double value)
Records that the mock object will by default allow the last method specified by a method call, and will react by returning the provided return value. |
|
void |
setDefaultReturnValue(float value)
Records that the mock object will by default allow the last method specified by a method call, and will react by returning the provided return value. |
|
void |
setDefaultReturnValue(long value)
Records that the mock object will by default allow the last method specified by a method call, and will react by returning the provided return value. |
|
void |
setDefaultReturnValue(java.lang.Object value)
Records that the mock object will by default allow the last method specified by a method call, and will react by returning the provided return value. |
|
void |
setDefaultThrowable(java.lang.Throwable throwable)
Records that the mock object will by default allow the last method specified by a method call, and will react by throwing the provided Throwable. |
|
void |
setDefaultVoidCallable()
Records that the mock object will by default allow the last method specified by a method call. |
|
void |
setMatcher(ArgumentsMatcher matcher)
Sets the ArgumentsMatcher for the last method called on the mock object. |
|
void |
setReturnValue(boolean value)
Records that the mock object will expect the last method call once, and will react by returning the provided return value. |
|
void |
setReturnValue(boolean value,
int times)
Records that the mock object will expect the last method call a fixed number of times, and will react by returning the provided return value. |
|
void |
setReturnValue(boolean value,
int minCount,
int maxCount)
Records that the mock object will expect the last method call between minCount and maxCount times, and will react
by returning the provided return value. |
|
void |
setReturnValue(boolean value,
org.easymock.internal.Range range)
Records that the mock object will expect the last method call the number of times specified by the range argument, and will react by returning the provided return value. |
|
void |
setReturnValue(double value)
Records that the mock object will expect the last method call once, and will react by returning the provided return value. |
|
void |
setReturnValue(double value,
int times)
Records that the mock object will expect the last method call a fixed number of times, and will react by returning the provided return value. |
|
void |
setReturnValue(double value,
int minCount,
int maxCount)
Records that the mock object will expect the last method call between minCount and maxCount times, and will react
by returning the provided return value. |
|
void |
setReturnValue(double value,
org.easymock.internal.Range range)
Records that the mock object will expect the last method call the number of times specified by the range argument, and will react by returning the provided return value. |
|
void |
setReturnValue(float value)
Records that the mock object will expect the last method call once, and will react by returning the provided return value. |
|
void |
setReturnValue(float value,
int times)
Records that the mock object will expect the last method call a fixed number of times, and will react by returning the provided return value. |
|
void |
setReturnValue(float value,
int minCount,
int maxCount)
Records that the mock object will expect the last method call between minCount and maxCount times, and will react
by returning the provided return value. |
|
void |
setReturnValue(float value,
org.easymock.internal.Range range)
Records that the mock object will expect the last method call the number of times specified by the range argument, and will react by returning the provided return value. |
|
void |
setReturnValue(long value)
Records that the mock object will expect the last method call once, and will react by returning the provided return value. |
|
void |
setReturnValue(long value,
int times)
Records that the mock object will expect the last method call a fixed number of times, and will react by returning the provided return value. |
|
void |
setReturnValue(long value,
int minCount,
int maxCount)
Records that the mock object will expect the last method call between minCount and maxCount times, and will react
by returning the provided return value. |
|
void |
setReturnValue(long value,
org.easymock.internal.Range range)
Records that the mock object will expect the last method call the number of times specified by the range argument, and will react by returning the provided return value. |
|
void |
setReturnValue(java.lang.Object value)
Records that the mock object will expect the last method call once, and will react by returning the provided return value. |
|
void |
setReturnValue(java.lang.Object value,
int times)
Records that the mock object will expect the last method call a fixed number of times, and will react by returning the provided return value. |
|
void |
setReturnValue(java.lang.Object value,
int minCount,
int maxCount)
Records that the mock object will expect the last method call between minCount and maxCount times, and will react
by returning the provided return value. |
|
void |
setReturnValue(java.lang.Object value,
org.easymock.internal.Range range)
Records that the mock object will expect the last method call the number of times specified by the range argument, and will react by returning the provided return value. |
|
void |
setThrowable(java.lang.Throwable throwable)
Records that the mock object will expect the last method call once, and will react by throwing the provided Throwable. |
|
void |
setThrowable(java.lang.Throwable throwable,
int times)
Records that the mock object will expect the last method call a fixed number of times, and will react by throwing the provided Throwable. |
|
void |
setThrowable(java.lang.Throwable throwable,
int minCount,
int maxCount)
Records that the mock object will expect the last method call between minCount and maxCount times, and will react
by throwing the provided Throwable. |
|
void |
setThrowable(java.lang.Throwable throwable,
org.easymock.internal.Range range)
Records that the mock object will expect the last method call the number of times specified by the range argument, and will react by throwing the provided Throwable. |
|
void |
setVoidCallable()
Records that the mock object will expect the last method call once, and will react by returning silently. |
|
void |
setVoidCallable(int times)
Records that the mock object will expect the last method call a fixed number of times, and will react by returning silently. |
|
void |
setVoidCallable(int minCount,
int maxCount)
Records that the mock object will expect the last method call between minCount and maxCount times, and will react
by returning silently. |
|
void |
setVoidCallable(org.easymock.internal.Range range)
Records that the mock object will expect the last method call the number of times specified by the range argument, and will react by returning silently. |
|
void |
verify()
Verifies that all expectations have been met. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.easymock.internal.IBehaviorFactory NICE_BEHAVIOR_FACTORY
protected
visibility to allow
access for extensions.
protected static final org.easymock.internal.IBehaviorFactory ORDERED_BEHAVIOR_FACTORY
protected
visibility to allow
access for extensions.
protected static final org.easymock.internal.IBehaviorFactory UNORDERED_BEHAVIOR_FACTORY
protected
visibility to allow
access for extensions.
public static final org.easymock.internal.Range ONE
public static final org.easymock.internal.Range ONE_OR_MORE
public static final org.easymock.internal.Range ZERO_OR_MORE
public static final ArgumentsMatcher EQUALS_MATCHER
public static final ArgumentsMatcher ALWAYS_MATCHER
public static final ArgumentsMatcher ARRAY_MATCHER
java.util.Arrays.equals()
-method.
Constructor Detail |
---|
protected MockControl(java.lang.Class<T> toMock, org.easymock.internal.IProxyFactory<T> proxyFactory, org.easymock.internal.IBehaviorFactory behaviorFactory)
protected
visibility to allow access for extensions.
toMock
- the class of the interface to mock.proxyFactory
- the proxy factory.behaviorFactory
- the behavior factory.Method Detail |
---|
public static <T> MockControl<T> createControl(java.lang.Class<T> toMock)
MockControl
and its associated mock object will not check
the order of expected method calls. An unexpected method call on the mock
object will lead to an AssertionFailedError
.
toMock
- the class of the interface to mock.
public static <T> MockControl<T> createStrictControl(java.lang.Class<T> toMock)
MockControl
and its associated mock object will check the
order of expected method calls. An unexpected method call on the mock
object will lead to an AssertionFailedError
.
toMock
- the class of the interface to mock.
public static <T> MockControl<T> createNiceControl(java.lang.Class<T> toMock)
MockControl
and its associated mock object will not check
the order of expected method calls. An unexpected method call on the mock
object will return an empty value (0, null, false).
toMock
- the class of the interface to mock.
public T getMock()
public final void reset()
public void replay()
java.lang.IllegalStateException
- if the mock object already is in replay state.public void verify()
java.lang.IllegalStateException
- if the mock object is in record state.
junit.framework.AssertionFailedError
- if any expectation has not been met.public void setVoidCallable()
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before, or if the last method
called on the mock was no void method.public void setThrowable(java.lang.Throwable throwable)
throwable
- the Throwable to throw.
java.lang.IllegalStateException
- if the mock object is in replay state or if no method was
called on the mock object before.
java.lang.IllegalArgumentException
- if the last method called on the mock cannot throw the
provided Throwable.
java.lang.NullPointerException
- if throwable is null.public void setReturnValue(boolean value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return boolean
.public void setReturnValue(long value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return
byte, short, char, int, or long
.public void setReturnValue(float value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return float
.public void setReturnValue(double value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return double
.public void setReturnValue(java.lang.Object value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return an object.
java.lang.IllegalArgumentException
- if the provided return value is not compatible to the return
value of the last method called on the mock object.public void setVoidCallable(int times)
times
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before, or if the last method
called on the mock was no void method.public void setThrowable(java.lang.Throwable throwable, int times)
throwable
- the Throwable to throw.times
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state or if no method was
called on the mock object before.
java.lang.IllegalArgumentException
- if the last method called on the mock cannot throw the
provided Throwable.
java.lang.NullPointerException
- if throwable is null.public void setReturnValue(boolean value, int times)
value
- the return value.times
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return boolean
.public void setReturnValue(double value, int times)
value
- the return value.times
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return double
.public void setReturnValue(float value, int times)
value
- the return value.times
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return float
.public void setReturnValue(long value, int times)
value
- the return value.times
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return
byte, short, char, int, or long
.public void setReturnValue(java.lang.Object value, int times)
value
- the return value.times
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return an object.
java.lang.IllegalArgumentException
- if the provided return value is not compatible to the return
value of the last method called on the mock object.public void setVoidCallable(org.easymock.internal.Range range)
range
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before, or if the last method
called on the mock was no void method.public void setThrowable(java.lang.Throwable throwable, org.easymock.internal.Range range)
throwable
- the Throwable to throw.range
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state or if no method was
called on the mock object before.
java.lang.IllegalArgumentException
- if the last method called on the mock cannot throw the
provided Throwable.
java.lang.NullPointerException
- if throwable is null.public void setReturnValue(boolean value, org.easymock.internal.Range range)
value
- the return value.range
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return boolean
.public void setReturnValue(double value, org.easymock.internal.Range range)
value
- the return value.range
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return double
.public void setReturnValue(float value, org.easymock.internal.Range range)
value
- the return value.range
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return float
.public void setReturnValue(long value, org.easymock.internal.Range range)
value
- the return value.range
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return
byte, short, char, int, or long
.public void setReturnValue(java.lang.Object value, org.easymock.internal.Range range)
value
- the return value.range
- the number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return an object.
java.lang.IllegalArgumentException
- if the provided return value is not compatible to the return
value of the last method called on the mock object.public void setDefaultVoidCallable()
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before, or if the last method
called on the mock was no void method.public void setDefaultThrowable(java.lang.Throwable throwable)
throwable
- throwable the throwable to be thrown
java.lang.IllegalArgumentException
- if the last method called on the mock cannot throw the
provided Throwable.
java.lang.NullPointerException
- if throwable is null.
java.lang.IllegalStateException
- if the mock object is in replay state, or if no method was
called on the mock object before.public void setDefaultReturnValue(boolean value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return boolean
.public void setDefaultReturnValue(long value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return
byte, short, char, int, or long
.public void setDefaultReturnValue(float value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return float
.public void setDefaultReturnValue(double value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return double
.public void setDefaultReturnValue(java.lang.Object value)
value
- the return value.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return an object.
java.lang.IllegalArgumentException
- if the provided return value is not compatible to the return
value of the last method called on the mock object.public void setMatcher(ArgumentsMatcher matcher)
java.lang.IllegalStateException
- if called in replay state, or if no method was called on the
mock object before.public void setVoidCallable(int minCount, int maxCount)
minCount
and maxCount
times, and will react
by returning silently.
minCount
- the minimum number of times that the call is expected.maxCount
- the maximum number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before, or if the last method
called on the mock was no void method.public void setThrowable(java.lang.Throwable throwable, int minCount, int maxCount)
minCount
and maxCount
times, and will react
by throwing the provided Throwable.
throwable
- the Throwable to throw.minCount
- the minimum number of times that the call is expected.maxCount
- the maximum number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state or if no method was
called on the mock object before.
java.lang.IllegalArgumentException
- if the last method called on the mock cannot throw the
provided Throwable.
java.lang.NullPointerException
- if throwable is null.public void setReturnValue(boolean value, int minCount, int maxCount)
minCount
and maxCount
times, and will react
by returning the provided return value.
value
- the return value.minCount
- the minimum number of times that the call is expected.maxCount
- the maximum number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return boolean
.public void setReturnValue(long value, int minCount, int maxCount)
minCount
and maxCount
times, and will react
by returning the provided return value.
value
- the return value.minCount
- the minimum number of times that the call is expected.maxCount
- the maximum number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return
byte, short, char, int, or long
.public void setReturnValue(float value, int minCount, int maxCount)
minCount
and maxCount
times, and will react
by returning the provided return value.
value
- the return value.minCount
- the minimum number of times that the call is expected.maxCount
- the maximum number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return float
.public void setReturnValue(double value, int minCount, int maxCount)
minCount
and maxCount
times, and will react
by returning the provided return value.
value
- the return value.minCount
- the minimum number of times that the call is expected.maxCount
- the maximum number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return double
.public void setReturnValue(java.lang.Object value, int minCount, int maxCount)
minCount
and maxCount
times, and will react
by returning the provided return value.
value
- the return value.minCount
- the minimum number of times that the call is expected.maxCount
- the maximum number of times that the call is expected.
java.lang.IllegalStateException
- if the mock object is in replay state, if no method was
called on the mock object before. or if the last method
called on the mock does not return an object.
java.lang.IllegalArgumentException
- if the provided return value is not compatible to the return
value of the last method called on the mock object.public void setDefaultMatcher(ArgumentsMatcher matcher)
java.lang.IllegalStateException
- if called in replay state, or if any behavior is already
defined on the mock object.public void expectAndReturn(boolean ignored, boolean value)
setReturnValue(boolean)
. For explanation,
see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(long ignored, long value)
setReturnValue(long)
. For explanation, see
"Convenience Methods for Return Values" in the EasyMock documentation.
ignored
- an ignored value.public void expectAndReturn(float ignored, float value)
setReturnValue(float)
. For explanation, see
"Convenience Methods for Return Values" in the EasyMock documentation.
ignored
- an ignored value.public void expectAndReturn(double ignored, double value)
setReturnValue(double)
. For explanation, see
"Convenience Methods for Return Values" in the EasyMock documentation.
ignored
- an ignored value.public <V1,V2 extends V1> void expectAndReturn(V1 ignored, V2 value)
setReturnValue(Object)
. For explanation, see
"Convenience Methods for Return Values" in the EasyMock documentation.
ignored
- an ignored value.public void expectAndReturn(boolean ignored, boolean value, org.easymock.internal.Range range)
setReturnValue(boolean, Range)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(long ignored, long value, org.easymock.internal.Range range)
setReturnValue(long, Range)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(float ignored, float value, org.easymock.internal.Range range)
setReturnValue(float, Range)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(double ignored, double value, org.easymock.internal.Range range)
setReturnValue(double, Range)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public <V1,V2 extends V1> void expectAndReturn(V1 ignored, V2 value, org.easymock.internal.Range range)
setReturnValue(Object, Range)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(boolean ignored, boolean value, int count)
setReturnValue(boolean, int)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(long ignored, long value, int count)
setReturnValue(long, int)
. For explanation,
see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(float ignored, float value, int count)
setReturnValue(float, int)
. For explanation,
see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(double ignored, double value, int count)
setReturnValue(double, int)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public <V1,V2 extends V1> void expectAndReturn(V1 ignored, V2 value, int count)
setReturnValue(Object, int)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(boolean ignored, boolean value, int min, int max)
setReturnValue(boolean, int, int)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(long ignored, long value, int min, int max)
setReturnValue(long, int, int)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(float ignored, float value, int min, int max)
setReturnValue(float, int, int)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndReturn(double ignored, double value, int min, int max)
setReturnValue(double, int, int)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public <V1,V2 extends V1> void expectAndReturn(V1 ignored, V2 value, int min, int max)
setReturnValue(Object, int, int)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(boolean ignored, java.lang.Throwable throwable)
setThrowable(Throwable)
. For explanation,
see "Convenience Methods for Throwables" in the EasyMock documentation.
ignored
- an ignored value.public void expectAndThrow(long ignored, java.lang.Throwable throwable)
setThrowable(Throwable)
. For explanation,
see "Convenience Methods for Throwables" in the EasyMock documentation.
ignored
- an ignored value.public void expectAndThrow(float ignored, java.lang.Throwable throwable)
setThrowable(Throwable)
. For explanation,
see "Convenience Methods for Throwables" in the EasyMock documentation.
ignored
- an ignored value.public void expectAndThrow(double ignored, java.lang.Throwable throwable)
setThrowable(Throwable)
. For explanation,
see "Convenience Methods for Throwables" in the EasyMock documentation.
ignored
- an ignored value.public void expectAndThrow(java.lang.Object ignored, java.lang.Throwable throwable)
setThrowable(Throwable)
. For explanation,
see "Convenience Methods for Throwables" in the EasyMock documentation.
ignored
- an ignored value.public void expectAndThrow(boolean ignored, java.lang.Throwable throwable, org.easymock.internal.Range range)
setThrowable(Throwable, Range)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(long ignored, java.lang.Throwable throwable, org.easymock.internal.Range range)
setThrowable(Throwable, Range)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(float ignored, java.lang.Throwable throwable, org.easymock.internal.Range range)
setThrowable(Throwable, Range)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(double ignored, java.lang.Throwable throwable, org.easymock.internal.Range range)
setThrowable(Throwable, Range)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(java.lang.Object ignored, java.lang.Throwable throwable, org.easymock.internal.Range range)
setThrowable(Throwable, Range)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(boolean ignored, java.lang.Throwable throwable, int count)
setThrowable(Throwable, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(long ignored, java.lang.Throwable throwable, int count)
setThrowable(Throwable, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(float ignored, java.lang.Throwable throwable, int count)
setThrowable(Throwable, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(double ignored, java.lang.Throwable throwable, int count)
setThrowable(Throwable, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(java.lang.Object ignored, java.lang.Throwable throwable, int count)
setThrowable(Throwable, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(boolean ignored, java.lang.Throwable throwable, int min, int max)
setThrowable(Throwable, int, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(long ignored, java.lang.Throwable throwable, int min, int max)
setThrowable(Throwable, int, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(float ignored, java.lang.Throwable throwable, int min, int max)
setThrowable(Throwable, int, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(double ignored, java.lang.Throwable throwable, int min, int max)
setThrowable(Throwable, int, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndThrow(java.lang.Object ignored, java.lang.Throwable throwable, int min, int max)
setThrowable(Throwable, int, int)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultReturn(boolean ignored, boolean value)
setDefaultReturnValue(boolean)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultReturn(long ignored, long value)
setDefaultReturnValue(long)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultReturn(float ignored, float value)
setDefaultReturnValue(float)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultReturn(double ignored, double value)
setDefaultReturnValue(double)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public <V1,V2 extends V1> void expectAndDefaultReturn(V1 ignored, V2 value)
setDefaultReturnValue(Object)
. For
explanation, see "Convenience Methods for Return Values" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultThrow(boolean ignored, java.lang.Throwable throwable)
setDefaultThrowable(Throwable)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultThrow(long ignored, java.lang.Throwable throwable)
setDefaultThrowable(Throwable)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultThrow(float ignored, java.lang.Throwable throwable)
setDefaultThrowable(Throwable)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultThrow(double ignored, java.lang.Throwable throwable)
setDefaultThrowable(Throwable)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.public void expectAndDefaultThrow(java.lang.Object ignored, java.lang.Throwable throwable)
setDefaultThrowable(Throwable)
. For
explanation, see "Convenience Methods for Throwables" in the EasyMock
documentation.
ignored
- an ignored value.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |