|
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(java.lang.String name)
Constructs a test case with the given name. |
Method Summary | |
---|---|
protected CanonicalFile |
canonize(java.io.File file)
Canonize file. |
protected CanonicalFile |
createCanonicalTmpFile(java.lang.String filename,
java.lang.String content)
Same as createTmpFile(String, String) but returns a
CanonicalFile . |
protected java.io.File |
createTmpFile(java.lang.String filename,
java.lang.String content)
Create a temporary file in a subdirectory of the test temp directory. |
protected void |
deleteTmpDirectory()
Delete temporary directory. |
protected java.io.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(java.lang.String filename)
Same as useTestFile(String) but returns a CanonicalFile . |
protected java.io.File |
useTestFile(java.lang.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(java.lang.String name)
name
- Name of the test method that gets calledMethod Detail |
---|
protected java.io.File useTestFile(java.lang.String filename)
TestDataManager
to
log access to test data files.
filename
- Name of the file
protected java.io.File createTmpFile(java.lang.String filename, java.lang.String content) throws java.io.IOException
filename
- name of the filecontent
- content
java.io.IOException
- if an IO exception occurrsprotected java.io.File getTmpDirectory()
protected void deleteTmpDirectory()
protected void printUsedFiles()
protected void printUnusedFiles()
protected void printStatistics()
protected CanonicalFile useCanonicalTestFile(java.lang.String filename)
useTestFile(String)
but returns a CanonicalFile
.
If canonization fails, this makes the current test fail.
protected CanonicalFile createCanonicalTmpFile(java.lang.String filename, java.lang.String content) throws java.io.IOException
createTmpFile(String, String)
but returns a
CanonicalFile
. If canonization fails, this makes the current test
fail.
java.io.IOException
protected CanonicalFile canonize(java.io.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 |