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 ImageMetadataReader
Ensure aImageMetadataReader
instance exists in the underlyingBeanInstanceMap
.static Interpolator
Ensure a defaultInterpolator
instance exists in the underlyingBeanInstanceMap
.static Interpolator
ensureInterpolator
(Interpolator interpolator) Ensure a specificInterpolator
instance exists in the underlyingBeanInstanceMap
.static StackDisplayer
Ensure aStackDisplayer
instance exists in the underlyingBeanInstanceMap
.static StackReader
Ensure aStackReader
instance exists in the underlyingBeanInstanceMap
.static StackWriter
ensureStackWriter
(boolean tiff) Ensure aStackWriter
instance exists in the underlyingBeanInstanceMap
.static void
Removes anyStackWriter
that may exist in the underlyingBeanInstanceMap
.
-
Method Details
-
ensureStackReader
Ensure aStackReader
instance exists in the underlyingBeanInstanceMap
.- Returns:
- the instance, as already exists, or if newly created.
-
ensureStackWriter
Ensure aStackWriter
instance 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 anyStackWriter
that may exist in the underlyingBeanInstanceMap
. -
ensureImageMetadataReader
Ensure aImageMetadataReader
instance exists in the underlyingBeanInstanceMap
.- Returns:
- the instance, as already exists, or if newly created.
-
ensureInterpolator
Ensure a defaultInterpolator
instance exists in the underlyingBeanInstanceMap
.- Returns:
- the instance, as already exists, or if newly created.
-
ensureInterpolator
Ensure a specificInterpolator
instance exists in the underlyingBeanInstanceMap
.- Parameters:
interpolator
- the interpolator to add, if necessary.- Returns:
- the instance, as already exists, or if newly created.
-
ensureStackDisplayer
Ensure aStackDisplayer
instance 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
-