com.agical.rmock.core.expectation
Class Engine

java.lang.Object
  extended by 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

Field Summary
 
Fields inherited from interface com.agical.rmock.core.InvocationHandler
NULL
 
Fields inherited from interface com.agical.rmock.core.expectation.ExpectationsState
NULL
 
Fields inherited from interface com.agical.rmock.core.expectation.modification.LastExpectationProvider
NULL
 
Constructor Summary
Engine()
           
 
Method Summary
 void assertThat(java.lang.Object actual, Expression expression)
          Assert method that asserts that the object passed in the actual parameter passes the constraint passed in the expected parameter.
 void beginVerify()
          Changes mode to verifification mode
 void endVerify()
          Changes ends verification
 ModifiableExpectation getLastExpectation()
           
 java.lang.Object invocation(java.lang.String id, java.lang.Class objectType, java.lang.String method, java.lang.Object[] arguments, MethodHandle methodHandle)
          Called when an invocation is made to a mock.
 boolean isInSetupState()
           
 boolean isInVerifyState()
           
 void runStrategy(TestStep step)
           
 void setExceptionVerifier(ExceptionVerifier exceptionVerifier)
           
 void setExpectationListener(ExpectationListener expectationListener)
           
 void setProxyFactory(ProxyFactory proxyFactory)
           
 void setSectionProvider(SectionProvider sectionProvider)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Engine

public Engine()
Method Detail

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 invocation
objectType - The type of the object that received the method invocation
method - The method that was invoked
methodHandle - 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-2010 Agical AB. All Rights Reserved.