Class StackWriterTestBase

Object
StackWriterTestBase
Direct Known Subclasses:
PNGTestBase, TiffTestBase

public abstract class StackWriterTestBase extends Object
Base class for testing various implementations of StackWriter.

The extension passed as a parameter determines where the particular directory saved-rasters are saved to test against: src/test/resources/stackWriter/formats/$EXTENSION.

Two types of comparison are optionally possible:

  • Bytewise comparison, where the exact bytes on the file-system must be identical to the saved raster.
  • Voxelwise comparison, where the voxel intensity-values must be identical to the saved-raster.
Author:
Owen Feehan
  • Field Details

    • ALL_SUPPORTED_VOXEL_TYPES

      protected static final VoxelDataType[] ALL_SUPPORTED_VOXEL_TYPES
      All possible voxel types that can be supported.
    • directory

      @TempDir public Path directory
      A temporary directory created for each test method.

      This directory is automatically created before each test method and deleted after the test finishes. It can be used to store temporary files generated during the test execution.

      See Also:
      • TempDir
    • tester

      protected FourChannelStackTester tester
      Performs the tests.
  • Constructor Details

    • StackWriterTestBase

      public StackWriterTestBase(ImageFileFormat format, boolean include3D, ComparisonPlan comparisonPlan)
      Creates a new StackWriterTestBase instance.
      Parameters:
      format - The format to be tested and written.
      include3D - If true, then 3D stacks are also tested and saved, not just 2D stacks.
      comparisonPlan - A plan on which comparisons to execute for a test.
  • Method Details

    • createWriter

      protected abstract StackWriter createWriter()
      Creates the StackWriter to be tested.
      Returns:
      the stack-writer.