Package org.xhtmlrenderer.test
Class ReferenceComparison
java.lang.Object
org.xhtmlrenderer.test.ReferenceComparison
ReferenceComparison runs a comparison of rendering a set of source XHTML files against a
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionReferenceComparison
(int width, boolean verbose) Initializes (does not launch) the reference comparison. -
Method Summary
Modifier and TypeMethodDescriptionprivate void
checkDirectories
(File sourceDirectory, File referenceDir, File failedDirectory) void
compareDirectory
(File sourceDirectory, File referenceDir, File failedDirectory) (package private) void
compareFile
(File source, File referenceDir, File failedDirectory, ReferenceComparison.CompareStatistics stat) private boolean
compareLines
(String refText, String text, ReferenceComparison.CompareStatistics statistics) private void
copyToFailed
(File failedDirectory, File refFile, String suffix) private boolean
enableLogging
(boolean isEnabled) listSourceFiles
(File sourceDirectory) private void
static void
private String
readReference
(File referenceDir, String input, String sfx) private void
storeFailed
(File failedDirectory, File sourceFile) private void
storeFailed
(File failedDirectory, File refFile, String suffix, String compareTo) private String
private boolean
verbose()
-
Field Details
-
log
private static final org.slf4j.Logger log -
EXTENSIONS
-
RENDER_SFX
- See Also:
-
LAYOUT_SFX
- See Also:
-
PNG_SFX
- See Also:
-
width
private final int width -
isVerbose
private final boolean isVerbose -
LINE_SEPARATOR
- See Also:
-
-
Constructor Details
-
ReferenceComparison
public ReferenceComparison(int width, boolean verbose) Initializes (does not launch) the reference comparison.- Parameters:
width
- width at which pages should be rendered
-
-
Method Details
-
main
- Throws:
IOException
-
compareDirectory
public void compareDirectory(File sourceDirectory, File referenceDir, File failedDirectory) throws IOException - Throws:
IOException
-
enableLogging
private boolean enableLogging(boolean isEnabled) -
checkDirectories
-
verbose
private boolean verbose() -
listSourceFiles
-
compareFile
void compareFile(File source, File referenceDir, File failedDirectory, ReferenceComparison.CompareStatistics stat) throws IOException - Throws:
IOException
-
trimTrailingLS
-
storeFailed
-
copyToFailed
-
compareLines
private boolean compareLines(String refText, String text, ReferenceComparison.CompareStatistics statistics) throws IOException - Throws:
IOException
-
storeFailed
-
readReference
- Throws:
IOException
-
log
-