|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.easymock.internal.MocksControl
org.easymock.classextension.internal.MocksClassControl
org.unitils.easymock.util.LenientMocksControl
public class LenientMocksControl
An EasyMock mock control that uses the reflection argument matcher for all arguments of a method invocation.
No explicit argument matcher setting is needed (or allowed). This control will automatically report lenient reflection argument matchers. These matchers can apply some leniency when comparing expected and actual argument values. Setting theReflectionComparatorMode.IGNORE_DEFAULTS
mode will for example ignore all fields that
have default values as expected values. E.g. if a null value is recorded as argument it will not be checked when
the actual invocation occurs. The same applies for inner-fields of object arguments that contain default java values.
Setting the ReflectionComparatorMode.LENIENT_DATES
mode will ignore the actual date values of arguments and
inner fields of arguments. It will only check whether both dates are null or both dates are not null. The actual
date and hour do not matter.
Setting the ReflectionComparatorMode.LENIENT_ORDER
mode will ignore the actual order of collections and
arrays arguments and inner fields of arguments. It will only check whether they both contain the same elements.
ReflectionComparatorMode
,
ReflectionComparator
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.easymock.internal.MocksControl |
---|
org.easymock.internal.MocksControl.MockType |
Field Summary |
---|
Fields inherited from class org.easymock.internal.MocksControl |
---|
AT_LEAST_ONCE, ONCE, ZERO_OR_MORE |
Constructor Summary | |
---|---|
LenientMocksControl(org.easymock.internal.MocksControl.MockType type,
ReflectionComparatorMode... modes)
Creates a mock control. |
|
LenientMocksControl(ReflectionComparatorMode... modes)
Creates a default (no default returns and no order checking) mock control. |
Method Summary | |
---|---|
org.easymock.internal.IMocksControlState |
getState()
Overriden to be able to replace the record behavior that going to record all method invocations. |
Methods inherited from class org.easymock.classextension.internal.MocksClassControl |
---|
createMock, createMock, createMock, createMock, createProxyFactory |
Methods inherited from class org.easymock.internal.MocksControl |
---|
andAnswer, andReturn, andStubAnswer, andStubReturn, andStubThrow, andThrow, anyTimes, asStub, atLeastOnce, checkOrder, createMock, createMock, once, replay, reset, setLegacyDefaultMatcher, setLegacyDefaultReturnValue, setLegacyDefaultThrowable, setLegacyDefaultVoidCallable, setLegacyMatcher, times, times, verify |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.easymock.IMocksControl |
---|
checkOrder, createMock, createMock, replay, reset, verify |
Methods inherited from interface org.easymock.IExpectationSetters |
---|
andAnswer, andReturn, andStubAnswer, andStubReturn, andStubThrow, andThrow, anyTimes, asStub, atLeastOnce, once, times, times |
Constructor Detail |
---|
public LenientMocksControl(ReflectionComparatorMode... modes)
modes
- the modes for the reflection argument matcherpublic LenientMocksControl(org.easymock.internal.MocksControl.MockType type, ReflectionComparatorMode... modes)
type
- the EasyMock mock typemodes
- the modes for the reflection argument matcherMethod Detail |
---|
public org.easymock.internal.IMocksControlState getState()
getState
in class org.easymock.internal.MocksControl
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |