Package org.jmock.api

Class Invocation

java.lang.Object
org.jmock.api.Invocation
All Implemented Interfaces:
org.hamcrest.SelfDescribing

public class Invocation extends Object implements org.hamcrest.SelfDescribing
The static details about a method and the run-time details of its invocation.
Since:
1.0
  • Field Details

    • NO_PARAMETERS

      public static final Object[] NO_PARAMETERS
    • invokedObject

      private final Object invokedObject
    • invokedMethod

      private final Method invokedMethod
    • parameterValues

      private final Object[] parameterValues
    • mode

      private final Invocation.ExpectationMode mode
    • BOX_TYPES

      private static final Map<Class<?>,Class<?>> BOX_TYPES
  • Constructor Details

  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object other)
      Overrides:
      equals in class Object
    • equals

      public boolean equals(Invocation other)
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • describeTo

      public void describeTo(org.hamcrest.Description description)
      Specified by:
      describeTo in interface org.hamcrest.SelfDescribing
    • getInvokedObject

      public Object getInvokedObject()
    • getInvokedMethod

      public Method getInvokedMethod()
    • getParameterCount

      public int getParameterCount()
    • getParameter

      public Object getParameter(int i)
    • getParametersAsArray

      public Object[] getParametersAsArray()
    • applyTo

      public Object applyTo(Object target) throws Throwable
      Throws:
      Throwable
    • checkReturnTypeCompatibility

      public void checkReturnTypeCompatibility(Object value)
    • isCompatible

      private boolean isCompatible(Class<?> returnType, Class<?> valueType)
    • isBoxedType

      private boolean isBoxedType(Class<?> primitiveType, Class<?> referenceType)
    • failIfReturnTypeIsNotNull

      private void failIfReturnTypeIsNotNull(Object result)
    • failIfReturnTypeIsPrimitive

      private void failIfReturnTypeIsPrimitive()
    • reportTypeError

      private void reportTypeError(Class<?> returnType, Class<?> valueType)
    • isBuildingExpectation

      public boolean isBuildingExpectation()