com.agical.rmock.core.expectation
Class Engine
java.lang.Object
com.agical.rmock.core.expectation.Engine
- All Implemented Interfaces:
- Assert, ExpectationsState, LastExpectationProvider, InvocationHandler, StrategyRunner, Verifiable
public class Engine
- extends java.lang.Object
- implements InvocationHandler, Verifiable, ExpectationsState, Assert, LastExpectationProvider, StrategyRunner
(c) Agical AB 2005
- Author:
- joakim.ohlrogge
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Engine
public Engine()
setSectionProvider
public void setSectionProvider(SectionProvider sectionProvider)
invocation
public java.lang.Object invocation(java.lang.String id,
java.lang.Class objectType,
java.lang.String method,
java.lang.Object[] arguments,
MethodHandle methodHandle)
throws java.lang.Throwable
- Description copied from interface:
InvocationHandler
- Called when an invocation is made to a mock. An invocation handler typically records or verifies the
invication.
- Specified by:
invocation
in interface InvocationHandler
- Parameters:
id
- The id of the mock that made the invocationobjectType
- The type of the object that received the method invocationmethod
- The method that was invokedmethodHandle
- A callback to the original method on the receiving object.
- Returns:
- The result of the invocation
- Throws:
java.lang.Exception
java.lang.Throwable
- See Also:
InvocationHandler.invocation(java.lang.String, Class, java.lang.String, java.lang.Object[], MethodHandle)
beginVerify
public void beginVerify()
- Changes mode to verifification mode
- Specified by:
beginVerify
in interface Verifiable
endVerify
public void endVerify()
- Changes ends verification
- Specified by:
endVerify
in interface Verifiable
getLastExpectation
public ModifiableExpectation getLastExpectation()
- Specified by:
getLastExpectation
in interface LastExpectationProvider
setProxyFactory
public void setProxyFactory(ProxyFactory proxyFactory)
- Parameters:
proxyFactory2
-
isInSetupState
public boolean isInSetupState()
- Specified by:
isInSetupState
in interface ExpectationsState
isInVerifyState
public boolean isInVerifyState()
- Specified by:
isInVerifyState
in interface ExpectationsState
assertThat
public void assertThat(java.lang.Object actual,
Expression expression)
- Description copied from interface:
Assert
- Assert method that asserts that the object passed in the actual parameter
passes the constraint passed in the expected parameter.
- Specified by:
assertThat
in interface Assert
- Parameters:
actual
- The actual object that is checked against the expected constraint.expression
- The constraint that actual is expected to pass
setExpectationListener
public void setExpectationListener(ExpectationListener expectationListener)
runStrategy
public void runStrategy(TestStep step)
throws java.lang.Throwable
- Specified by:
runStrategy
in interface StrategyRunner
- Throws:
java.lang.Throwable
setExceptionVerifier
public void setExceptionVerifier(ExceptionVerifier exceptionVerifier)
Copyright © 2005-2011 Agical AB. All Rights Reserved.