org.unitils.mock.core
Class ObservedInvocation

java.lang.Object
  extended by org.unitils.mock.core.proxy.ProxyInvocation
      extended by org.unitils.mock.core.ObservedInvocation

public class ObservedInvocation
extends ProxyInvocation

Author:
Filip Neven, Tim Ducheyne, Kenny Claes

Constructor Summary
ObservedInvocation(ProxyInvocation proxyInvocation, BehaviorDefiningInvocation behaviorDefiningInvocation, MockBehavior mockBehavior)
          Creates a observed invocation for the given prosy invocation.
 
Method Summary
 BehaviorDefiningInvocation getBehaviorDefiningInvocation()
           
 MockBehavior getMockBehavior()
           
 Object getResult()
           
 Object getResultAtInvocationTime()
           
 boolean hasMockBehavior()
           
 void setResult(Object result)
          Sets the result of the invocation.
 
Methods inherited from class org.unitils.mock.core.proxy.ProxyInvocation
getArguments, getArgumentsAtInvocationTime, getInvokedAt, getInvokedAtTrace, getLineNumber, getMethod, getMockName, getNrOfNotNullArguments, getProxy, invokeOriginalBehavior
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ObservedInvocation

public ObservedInvocation(ProxyInvocation proxyInvocation,
                          BehaviorDefiningInvocation behaviorDefiningInvocation,
                          MockBehavior mockBehavior)
Creates a observed invocation for the given prosy invocation. The argumentsAtInvocationTime should be copies (deep clones) of the arguments at the time of the invocation. This way the original values can still be used later-on even when changes occur to the original values (pass-by-value vs pass-by-reference).

Parameters:
proxyInvocation - The proxy invocation, not null
behaviorDefiningInvocation - The invocation that defined the behavior, null if there is no behavior
mockBehavior - The executed behavior, not null
Method Detail

setResult

public void setResult(Object result)
Sets the result of the invocation. This is set afterwards to make it possible to get the correct sequence in the report when there are nested mock invocations.

Parameters:
result - The result of the invocation

getResult

public Object getResult()

getResultAtInvocationTime

public Object getResultAtInvocationTime()

getBehaviorDefiningInvocation

public BehaviorDefiningInvocation getBehaviorDefiningInvocation()

getMockBehavior

public MockBehavior getMockBehavior()

hasMockBehavior

public boolean hasMockBehavior()


Copyright © 2011. All Rights Reserved.