Interface IMethodInvocation

All Known Implementing Classes:
MethodInvocation

public interface IMethodInvocation
Author:
Peter Niederwieser
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the arguments for this method invocation.
    Returns the feature which this method invocation belongs to (if any).
    Returns the Specification instance for the current iteration.
    Return the iteration which this method invocation belongs to (if any).
    Returns the method invoked by this method invocation.
    Returns the Specification instance for @Shared fields.
    Returns the specification which this method invocation belongs to.
    Returns the target (receiver) of this method invocation.
    void
    Proceeds with the method call.
    void
    setArguments(Object[] arguments)
    Sets the arguments for this method invocation.
  • Method Details

    • getSpec

      SpecInfo getSpec()
      Returns the specification which this method invocation belongs to.
      Returns:
      the specification which this method invocation belongs to
    • getFeature

      FeatureInfo getFeature()
      Returns the feature which this method invocation belongs to (if any). Differs from MethodInfo.getFeature() in that it reflects the dynamic picture. For example, when a setup method is invoked, this method will return the corresponding feature, whereas MethodInfo.getFeature() will return null.
      Returns:
      the feature which this method invocation belongs to
    • getIteration

      IterationInfo getIteration()
      Return the iteration which this method invocation belongs to (if any). Executing a feature results in at least one but possibly more iterations (e.g. for a data-driven feature).
      Returns:
      the iteration which this method invocation belongs to
    • getSharedInstance

      Object getSharedInstance()
      Returns the Specification instance for @Shared fields.

      Note that in most cases, it's more appropriate to use the context-aware getInstance().

      Returns:
      the Specification instance for @Sharedfields
    • getInstance

      Object getInstance()
      Returns the Specification instance for the current iteration. For methods that operate in a @Shared context (e.g. setupSpec), this method returns the same value as getSharedInstance().
      Returns:
      the Specification instance for the current iteration
    • getTarget

      Object getTarget()
      Returns the target (receiver) of this method invocation. In case of a static method call, a Class instance is returned.

      Note that the target of the method invocation may not necessarily be the Specification instance. That's why in most cases, it's more appropriate to use #getInstance.

      Returns:
      the target (receiver) of this method invocation
    • getMethod

      MethodInfo getMethod()
      Returns the method invoked by this method invocation.
      Returns:
      the method invoked by this method invocation
    • getArguments

      Object[] getArguments()
      Returns the arguments for this method invocation.
      Returns:
      the arguments for this method invocation
    • setArguments

      void setArguments(Object[] arguments)
      Sets the arguments for this method invocation.
    • proceed

      void proceed() throws Throwable
      Proceeds with the method call. Always call this method unless you want to suppress the method call.
      Throws:
      Throwable - any exception thrown by the method call