Package org.anchoranalysis.test.image
Class DualComparerFactory
Object
DualComparerFactory
Factory for creating
DualComparer
instances to compare directories.-
Method Summary
Modifier and TypeMethodDescriptionstatic DualComparer
compareExplicitDirectoryToTest
(Path pathExplicit, String pathRelativeTestDir) Compares an explicit directory to a directory in Maven'stest/resources
.static DualComparer
compareTemporaryDirectoryToTest
(Path directory, Optional<String> relativeTemporaryDirectory, String relativeResourcesRoot) Compares a directory in a temporary-folder to a directory in Maven'stest/resources
.static DualComparer
compareTwoSubdirectoriesInLoader
(TestLoader loader, String subdirectory1, String subdirectory2) Compares two subdirectories within the sameTestLoader
.static DualComparer
compareTwoSubdirectoriesInLoader
(TestLoader loader1, String subdirectory1, TestLoader loader2, String subdirectory2) Compares two subdirectories from differentTestLoader
s.
-
Method Details
-
compareExplicitDirectoryToTest
public static DualComparer compareExplicitDirectoryToTest(Path pathExplicit, String pathRelativeTestDir) Compares an explicit directory to a directory in Maven'stest/resources
.- Parameters:
pathExplicit
- the path to the explicit directory to comparepathRelativeTestDir
- the relative path to the test directory in Maven'stest/resources
- Returns:
- a
DualComparer
for comparing the two directories
-
compareTemporaryDirectoryToTest
public static DualComparer compareTemporaryDirectoryToTest(Path directory, Optional<String> relativeTemporaryDirectory, String relativeResourcesRoot) Compares a directory in a temporary-folder to a directory in Maven'stest/resources
.- Parameters:
directory
- the temporary folderrelativeTemporaryDirectory
- optionally an additional subdirectory to use relative to the root offolder
.relativeResourcesRoot
- a subdirectory to use in Maven's test/resources relative to the root of the resources- Returns:
- a comparer between the two directories.
-
compareTwoSubdirectoriesInLoader
public static DualComparer compareTwoSubdirectoriesInLoader(TestLoader loader, String subdirectory1, String subdirectory2) Compares two subdirectories within the sameTestLoader
.- Parameters:
loader
- theTestLoader
containing both subdirectoriessubdirectory1
- the relative path to the first subdirectorysubdirectory2
- the relative path to the second subdirectory- Returns:
- a
DualComparer
for comparing the two subdirectories
-
compareTwoSubdirectoriesInLoader
public static DualComparer compareTwoSubdirectoriesInLoader(TestLoader loader1, String subdirectory1, TestLoader loader2, String subdirectory2) Compares two subdirectories from differentTestLoader
s.- Parameters:
loader1
- theTestLoader
containing the first subdirectorysubdirectory1
- the relative path to the first subdirectoryloader2
- theTestLoader
containing the second subdirectorysubdirectory2
- the relative path to the second subdirectory- Returns:
- a
DualComparer
for comparing the two subdirectories
-