Package de.gebit.integrity.fixtures
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 theFixtureFactory
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 Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
releaseInstance(C anInstance)
Called after an instance retrieved fromretrieveInstance()
is no longer required.C
retrieveInstance()
Returns a fresh instance of the fixture.
-
-
-
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 fromretrieveInstance()
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
-
-