Package org.anchoranalysis.test.image.io
Class BeanInstanceMapFixture
Object
BeanInstanceMapFixture
Creates a
BeanInstanceMap with useful entries for testing, and associates it with bean
creation.- Author:
- Owen Feehan
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends AnchorBean<?>>
Tcheck(T bean) Checks if a bean has all necessary items, throwing a run-time exception if it does not.static ImageMetadataReaderEnsure aImageMetadataReaderinstance exists in the underlyingBeanInstanceMap.static InterpolatorEnsure a defaultInterpolatorinstance exists in the underlyingBeanInstanceMap.static InterpolatorensureInterpolator(Interpolator interpolator) Ensure a specificInterpolatorinstance exists in the underlyingBeanInstanceMap.static StackDisplayerEnsure aStackDisplayerinstance exists in the underlyingBeanInstanceMap.static StackReaderEnsure aStackReaderinstance exists in the underlyingBeanInstanceMap.static StackWriterensureStackWriter(boolean tiff) Ensure aStackWriterinstance exists in the underlyingBeanInstanceMap.static voidRemoves anyStackWriterthat may exist in the underlyingBeanInstanceMap.
-
Method Details
-
ensureStackReader
Ensure aStackReaderinstance exists in the underlyingBeanInstanceMap.- Returns:
- the instance, as already exists, or if newly created.
-
ensureStackWriter
Ensure aStackWriterinstance exists in the underlyingBeanInstanceMap.This leaves a global side-affect after being used, which may affect subsequent tests run in the same maven unit.
- Parameters:
tiff- if true, TIFFs are created, otherwise PNGs.- Returns:
- the instance, as already exists, or if newly created.
-
removeStackWriter
public static void removeStackWriter()Removes anyStackWriterthat may exist in the underlyingBeanInstanceMap. -
ensureImageMetadataReader
Ensure aImageMetadataReaderinstance exists in the underlyingBeanInstanceMap.- Returns:
- the instance, as already exists, or if newly created.
-
ensureInterpolator
Ensure a defaultInterpolatorinstance exists in the underlyingBeanInstanceMap.- Returns:
- the instance, as already exists, or if newly created.
-
ensureInterpolator
Ensure a specificInterpolatorinstance exists in the underlyingBeanInstanceMap.- Parameters:
interpolator- the interpolator to add, if necessary.- Returns:
- the instance, as already exists, or if newly created.
-
ensureStackDisplayer
Ensure aStackDisplayerinstance exists in the underlyingBeanInstanceMap.- Returns:
- the instance, as already exists, or if newly created.
-
check
Checks if a bean has all necessary items, throwing a run-time exception if it does not.- Type Parameters:
T- bean-type- Parameters:
bean- bean to check.- Returns:
- the checked bean
- Throws:
AnchorFriendlyRuntimeException- if the bean is misconfigured
-