Logo Search packages:      
Sourcecode: jmock2 version File versions  Download package

Object org::jmock::internal::InvocationExpectation::invoke ( Invocation  invocation  )  throws Throwable [inline]

Invokes the expectation: records that the invocation has occurred and fakes some behaviour in response.

Parameters:
invocation The invocation to record and fake.
Returns:
A result that is eventually returned from the method call that caused the invocation.
Exceptions:
Throwable An exception that is eventually thrown from the method call that caused the invocation.
IllegalStateException The expectation has been invoked with a method that it doesn't match or the faked behaviour has been set up incorrectly. For example, IllegalStateException is thrown when trying to return a value or throw a checked exception that is incompatible with the return type of the method being mocked

Implements org::jmock::api::Expectation.

Definition at line 111 of file InvocationExpectation.java.

References org::jmock::api::Invokable::invoke().

                                                                 {
            invocationCount++;
            performSideEffects();
            final Object result = action.invoke(invocation);
        invocation.checkReturnTypeCompatibility(result);
        return result;
      }


Generated by  Doxygen 1.6.0   Back to index