org.apache.velocity.test
Class BaseTestCase
TestCase
org.apache.velocity.test.BaseTestCase
public class BaseTestCase
extends TestCase
Base test case that provides a few utility methods for
the rest of the tests.
$Id: BaseTestCase.java,v 1.12.4.1 2004/03/03 23:23:04 geirm Exp $private Perl5Util | perl - used for nomalization of output and compare data
|
protected static void | assureResultsDirectoryExists(String resultsDirectory) - Assures that the results directory exists.
|
protected static String | getFileName(String dir, String base, String ext) - Concatenates the file name parts together appropriately.
|
protected static String | getTestCaseName(String s) - Turns a base file name into a test case name.
|
protected boolean | isMatch(String resultsDir, String compareDir, String baseFileName, String resultExt, String compareExt) - Returns whether the processed template matches the
content of the provided comparison file.
|
protected String | normalizeNewlines(String source) - Normalizes lines to account for platform differences.
|
perl
private Perl5Util perl
used for nomalization of output and compare data
BaseTestCase
public BaseTestCase(String name)
Default constructor.
assureResultsDirectoryExists
protected static void assureResultsDirectoryExists(String resultsDirectory)
Assures that the results directory exists. If the results directory
cannot be created, fails the test.
getFileName
protected static String getFileName(String dir,
String base,
String ext)
Concatenates the file name parts together appropriately.
- The full path to the file.
getTestCaseName
protected static final String getTestCaseName(String s)
Turns a base file name into a test case name.
isMatch
protected boolean isMatch(String resultsDir,
String compareDir,
String baseFileName,
String resultExt,
String compareExt)
throws Exception
Returns whether the processed template matches the
content of the provided comparison file.
- Whether the output matches the contents
of the comparison file.
normalizeNewlines
protected String normalizeNewlines(String source)
Normalizes lines to account for platform differences. Macs use
a single \r, DOS derived operating systems use \r\n, and Unix
uses \n. Replace each with a single \n.
- source with all line terminations changed to Unix style
Copyright B) 2002 Apache Software Foundation. All Rights Reserved.