net.sf.surrogate.core
Interface SurrogateManager.MockExecutor
- All Known Implementing Classes:
- MockMethod
- Enclosing class:
- SurrogateManager
- public static interface SurrogateManager.MockExecutor
Defines, towards the AspectJ layer, the mock object or method to be
executed.
- Author:
- Per S Hustad
Method Summary |
java.lang.Object |
execute(java.lang.Object[] args)
If the manager returns a non-null MockExecutor, the calling advice
should call "execute" and return the "execute" return value. |
execute
public java.lang.Object execute(java.lang.Object[] args)
throws java.lang.Throwable
- If the manager returns a non-null MockExecutor, the calling advice
should call "execute" and return the "execute" return value. The
throwable can be cached and rethrown with the
ExceptionThrower
utility.
- Parameters:
args
- the arguments, always use
thisJoinPoint.getArgs()
Ignored if the underlying mock is a mock object but used
if it is a MockMethod.- Returns:
- the return value of the underlying mock object. If the
underlying mock object is a
MockMethod
, the return value as
setup in the method is returned. If the underlying object is
a plain mock object, that object is returned - Throws:
java.lang.Throwable
- if a MockMethod
has been set up explicitly to throw an
exeption or there was a mismatch between the JoinPoint args and
the method args.
Copyright © 2005 . All Rights Reserved.