Package com.mockobjects.dynamic
Class Mock
java.lang.Object
com.mockobjects.dynamic.Mock
- All Implemented Interfaces:
Verifiable,InvocationHandler
- Direct Known Subclasses:
OrderedMock
-
Constructor Summary
ConstructorsConstructorDescriptionMock(CallFactory callFactory, CallableAddable callableAddable, Class mockedClass, String name) -
Method Summary
Modifier and TypeMethodDescriptionstatic Stringvoidvoidexpect(String methodName, CallSequence deprecated) Deprecated.voidexpect(String methodName, ConstraintMatcher args) voidvoidexpectAndReturn(String methodName, boolean result) voidexpectAndReturn(String methodName, int result) voidexpectAndReturn(String methodName, CallSequence deprecated, Object result) Deprecated.voidexpectAndReturn(String methodName, ConstraintMatcher args, boolean result) voidexpectAndReturn(String methodName, ConstraintMatcher args, int result) voidexpectAndReturn(String methodName, ConstraintMatcher args, Object result) voidexpectAndReturn(String methodName, Object result) voidexpectAndReturn(String methodName, Object singleEqualArg, boolean result) voidexpectAndReturn(String methodName, Object singleEqualArg, int result) voidexpectAndReturn(String methodName, Object singleEqualArg, Object result) voidexpectAndThrow(String methodName, CallSequence deprecated, Throwable throwable) Deprecated.voidexpectAndThrow(String methodName, ConstraintMatcher args, Throwable exception) voidexpectAndThrow(String methodName, Object singleEqualArg, Throwable exception) voidexpectAndThrow(String methodName, Throwable exception) voidexpectNotCalled(String methodName) Deprecated.Not required, as if methodName is called, you will get a an exceptionvoidexpectVoid(String methodName) Deprecated.voidexpectVoid(String methodName, ConstraintMatcher args) Deprecated.voidexpectVoid(String methodName, Object equalArg) Deprecated.voidmatchAndReturn(String methodName, boolean result) voidmatchAndReturn(String methodName, boolean singleEqualArg, Object result) voidmatchAndReturn(String methodName, int result) voidmatchAndReturn(String methodName, int singleEqualArg, Object result) voidmatchAndReturn(String methodName, ConstraintMatcher args, boolean result) voidmatchAndReturn(String methodName, ConstraintMatcher args, int result) voidmatchAndReturn(String methodName, ConstraintMatcher args, Object result) voidmatchAndReturn(String methodName, Object result) voidmatchAndReturn(String methodName, Object singleEqualArg, boolean result) voidmatchAndReturn(String methodName, Object singleEqualArg, int result) voidmatchAndReturn(String methodName, Object singleEqualArg, Object result) voidmatchAndThrow(String methodName, boolean singleEqualArg, Throwable throwable) voidmatchAndThrow(String methodName, int singleEqualArg, Throwable throwable) voidmatchAndThrow(String methodName, ConstraintMatcher args, Throwable throwable) voidmatchAndThrow(String methodName, Object singleEqualArg, Throwable throwable) voidmatchAndThrow(String methodName, Throwable throwable) static Stringproxy()voidreset()toString()voidverify()Throw an AssertionFailedException if any expectations have not been met.
-
Constructor Details
-
Mock
public Mock(CallFactory callFactory, CallableAddable callableAddable, Class mockedClass, String name) -
Mock
-
Mock
-
-
Method Details
-
reset
public void reset() -
mockNameFromClass
-
className
-
getMockName
-
toString
-
proxy
-
invoke
- Specified by:
invokein interfaceInvocationHandler- Throws:
Throwable
-
verify
public void verify()Description copied from interface:VerifiableThrow an AssertionFailedException if any expectations have not been met.- Specified by:
verifyin interfaceVerifiable
-
expect
-
expect
-
expect
-
expectAndReturn
-
expectAndReturn
-
expectAndReturn
-
expectAndReturn
-
expectAndReturn
-
expectAndReturn
-
expectAndReturn
-
expectAndReturn
-
expectAndReturn
-
expectAndThrow
-
expectAndThrow
-
expectAndThrow
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndReturn
-
matchAndThrow
-
matchAndThrow
-
matchAndThrow
-
matchAndThrow
-
matchAndThrow
-
expect
Deprecated.- See Also:
-
expectAndReturn
Deprecated.- See Also:
-
expectAndThrow
Deprecated.- See Also:
-
expectVoid
Deprecated.- See Also:
-
expectVoid
Deprecated.- See Also:
-
expectVoid
Deprecated.- See Also:
-
expectNotCalled
Deprecated.Not required, as if methodName is called, you will get a an exception
-