|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.ObjectTestCase
edu.tum.cs.commons.test.CCSMTestCaseBase
public abstract class CCSMTestCaseBase
Base class for test cases that access test data files. This class provides a simple mechanism for accessing test data files in a specified directory and provides statistics on test file usage and non-usage.
The test files a test case accesses must reside in the following location:
test-data/<Name of the package the test case resides in>
For example if a test case is defined in package demo.test the
test files it accesses must be located in directory
test-data/demo.test.
| Constructor Summary | |
|---|---|
CCSMTestCaseBase()
Default constructor |
|
CCSMTestCaseBase(String name)
Constructs a test case with the given name. |
|
| Method Summary | |
|---|---|
protected CanonicalFile |
canonize(File file)
Canonize file. |
protected CanonicalFile |
createCanonicalTmpFile(String filename,
String content)
Same as createTmpFile(String, String) but returns a
CanonicalFile. |
protected File |
createTmpFile(String filename,
String content)
Create a temporary file in a subdirectory of the test temp directory. |
protected void |
deleteTmpDirectory()
Delete temporary directory. |
protected File |
getTmpDirectory()
Get temporary directory. |
static boolean |
is64BitVM()
Checks if we run on a 64 bit VM |
protected void |
printStatistics()
Print report about used and unused test files. |
protected void |
printUnusedFiles()
Print report about unused test files. |
protected void |
printUsedFiles()
Print report about used test files. |
protected CanonicalFile |
useCanonicalTestFile(String filename)
Same as useTestFile(String) but returns a CanonicalFile. |
protected File |
useTestFile(String filename)
Use test file. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CCSMTestCaseBase()
public CCSMTestCaseBase(String name)
name - Name of the test method that gets called| Method Detail |
|---|
protected File useTestFile(String filename)
TestDataManager to
log access to test data files.
filename - Name of the file
protected File createTmpFile(String filename,
String content)
throws IOException
filename - name of the filecontent - content
IOException - if an IO exception occurrsprotected File getTmpDirectory()
protected void deleteTmpDirectory()
protected void printUsedFiles()
protected void printUnusedFiles()
protected void printStatistics()
protected CanonicalFile useCanonicalTestFile(String filename)
useTestFile(String) but returns a CanonicalFile.
If canonization fails, this makes the current test fail.
protected CanonicalFile createCanonicalTmpFile(String filename,
String content)
throws IOException
createTmpFile(String, String) but returns a
CanonicalFile. If canonization fails, this makes the current test
fail.
IOExceptionprotected CanonicalFile canonize(File file)
public static boolean is64BitVM()
|
TUM CCSM Commons | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||