nl.hsac.fitnesse.slim.interaction.InteractionAwareFixture Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of hsac-fitnesse-fixtures Show documentation
Show all versions of hsac-fitnesse-fixtures Show documentation
Fixtures to assist in testing via FitNesse
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