All Downloads are FREE. Search and download functionalities are using the official Maven repository.

nl.hsac.fitnesse.slim.interaction.InteractionAwareFixture Maven / Gradle / Ivy

There is a newer version: 5.3.17
Show newest version
package nl.hsac.fitnesse.slim.interaction;

import fitnesse.slim.fixtureInteraction.FixtureInteraction;

import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;

/**
 * Interface to allow aspect-oriented behavior to be added to fixtures. These fixtures are explicitly aware
 * of Slim, and are allowed to have control of how Slim interacts with their methods.
 * Intended uses are, for instance: generic exception handling allowing exceptions from any of its methods to
 * be converted to SlimExceptions (without having to implement that in each method invoked), or waiting for the system
 * under test to be in a stable state before invoking the next method (again without having to add that waiting to each
 * method).
 */
public interface InteractionAwareFixture {
  /**
   * Any time Slim wants to invoke a method on the fixture it will invoke this method (instead of the actual method).
   * Implementations are free/responsible to deal with the invocation as they see fit.
   * To invoke the 'normal' or 'real' method, an implementation should invoke interaction#methodInvoke().
   * @param interaction the standard Slim wrapper to call a method (an implementation wanting to have the 'normal' Slim
   *                    invocation executed can call methodInvoke() on this object, with this as instance).
   * @param method the method being invoked.
   * @param arguments the arguments to the method.
   * @return the result of the method.
   * @throws InvocationTargetException exception thrown by the method
   * @throws IllegalAccessException when unable to access method.
   */
  Object aroundSlimInvoke(FixtureInteraction interaction, Method method, Object... arguments)
          throws InvocationTargetException, IllegalAccessException;
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy