Interface FixtureInstanceFactory<C>

  • Type Parameters:
    C - the fixture class created by this factory

    public interface FixtureInstanceFactory<C>
    Fixture Factories can be used to customize fixture instantiation. You may annotate any fixture class with the FixtureFactory annotation to link an instance factory to it. This factory has to have a no-arg constructor and will be instantiated exactly once.
    Author:
    Rene Schneider - initial API and implementation
    • Method Detail

      • retrieveInstance

        C retrieveInstance()
        Returns a fresh instance of the fixture. This fixture is expected to be "clean" in terms of state.
        Returns:
        a fixture instance
      • releaseInstance

        void releaseInstance​(C anInstance)
        Called after an instance retrieved from retrieveInstance() is no longer required. Integrity guarantees that there will be no more calls to the instance in question after it has been passed to this method.
        Parameters:
        anInstance - the instance to be released