| org.apache.velocity.test.BaseTestCase
All known Subclasses: org.apache.velocity.test.MacroForwardDefineTestCase, org.apache.velocity.test.WrappedExceptionTestCase, org.apache.velocity.test.ExceptionTestCase, org.apache.velocity.test.MethodOverloadingTestCase, org.apache.velocity.test.InfoTestCase, org.apache.velocity.test.EncodingTestCase, org.apache.velocity.test.SecureIntrospectionTestCase, org.apache.velocity.test.TexenTestCase, org.apache.velocity.test.ResourceLoaderInstanceTestCase, org.apache.velocity.test.Introspector3TestCase, org.apache.velocity.test.MultiLoaderTestCase, org.apache.velocity.test.ContextSafetyTestCase, org.apache.velocity.test.ResourceCachingTestCase, org.apache.velocity.test.FilteredEventHandlingTestCase, org.apache.velocity.test.ClasspathResourceTestCase, org.apache.velocity.test.Introspector2TestCase, org.apache.velocity.test.MultipleFileResourcePathTestCase, org.apache.velocity.test.AbsoluteFileResourceLoaderTestCase, org.apache.velocity.test.TemplateTestCase, org.apache.velocity.test.issues.Velocity285TestCase, org.apache.velocity.test.ParseExceptionTestCase, org.apache.velocity.test.SetTestCase, org.apache.velocity.test.IntrospectorTestCase, org.apache.velocity.test.InlineScopeVMTestCase, org.apache.velocity.test.BuiltInEventHandlerTestCase, org.apache.velocity.test.AnakiaTestCase, org.apache.velocity.test.UberspectorTestCase, org.apache.velocity.test.StringResourceLoaderTestCase, org.apache.velocity.test.util.introspection.ClassMapTestCase, org.apache.velocity.test.issues.VelTools66TestCase, org.apache.velocity.test.IncludeErrorTestCase, org.apache.velocity.test.sql.BaseSQLTest, org.apache.velocity.test.VelocityAppTestCase, org.apache.velocity.test.MiscTestCase, org.apache.velocity.test.TexenClasspathTestCase, org.apache.velocity.test.IncludeEventHandlingTestCase, org.apache.velocity.test.CommonsExtPropTestCase, org.apache.velocity.test.TestBaseTestCase,
BaseTestCase | abstract public class BaseTestCase extends TestCase implements TemplateTestBase(Code) | | Base test case that provides a few utility methods for
the rest of the tests.
author: Daniel Rall version: $Id: BaseTestCase.java 490718 2006-12-28 13:35:49Z wglass $ |
Method Summary | |
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 | getFileName(String dir, String base, String ext, boolean mustExist) | final protected static String | getTestCaseName(String s) Turns a base file name into a test case name.
Parameters: s - The base file 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 boolean | isMatch(String result, String compareDir, String baseFileName, 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. |
BaseTestCase | public BaseTestCase(String name)(Code) | | Default constructor.
|
assureResultsDirectoryExists | protected static void assureResultsDirectoryExists(String resultsDirectory)(Code) | | 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)(Code) | | Concatenates the file name parts together appropriately.
The full path to the file. |
getTestCaseName | final protected static String getTestCaseName(String s)(Code) | | Turns a base file name into a test case name.
Parameters: s - The base file name. The test case name. |
isMatch | protected boolean isMatch(String resultsDir, String compareDir, String baseFileName, String resultExt, String compareExt) throws Exception(Code) | | Returns whether the processed template matches the
content of the provided comparison file.
Whether the output matches the contentsof the comparison file. exception: Exception - Test failure condition. |
isMatch | protected boolean isMatch(String result, String compareDir, String baseFileName, String compareExt) throws Exception(Code) | | Returns whether the processed template matches the
content of the provided comparison file.
Whether the output matches the contentsof the comparison file. exception: Exception - Test failure condition. |
normalizeNewlines | protected String normalizeNewlines(String source)(Code) | | 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.
author: Sam Ruby source with all line terminations changed to Unix style |
|
|