Package org.castor.xmlctf
Class CastorTestCase
java.lang.Object
junit.framework.Assert
junit.framework.TestCase
org.castor.xmlctf.CastorTestCase
- All Implemented Interfaces:
junit.framework.Test
public class CastorTestCase
extends junit.framework.TestCase
Abstracts a test case in the CTF (Castor Test Framework). A CTF test case can
be driven by a directory or by a JAR file.
- Version:
- $Revision: 6787 $ $Date: 2004-03-08 17:23:25 -0700 (Mon, 08 Mar 2004) $
- Author:
- Arnaud Blandin
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final short
A directory-based Castor test case.static final short
A JAR-based Castor test case.static final String
Name of the resource for the test descriptor XML document.static final short
An unknown type of Castor test case. -
Constructor Summary
ConstructorsConstructorDescriptionCastorTestCase
(File file, String directoryToHere, String outputRoot) Constructs a CTF test case given a File (either a JAR file or a directory) and a directory where temporary files will be placed.CastorTestCase
(String name) Constructs a CTF test case given only a test case name. -
Method Summary
Modifier and TypeMethodDescriptionshort
getType()
boolean
Returns a boolean that when true indicates the output directory has been compiled.void
setClassLoader
(ClassLoader loader) Sets the ClassLoader to use for loading the resources for this test case.void
setDirectoryCompiled
(boolean compiled) Sets a flag to indicate the output directory has been compiled.junit.framework.Test
suite()
Assembles and returns a test suite containing all known tests.Methods inherited from class junit.framework.TestCase
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, countTestCases, createResult, fail, fail, failNotEquals, failNotSame, failSame, format, getName, run, run, runBare, runTest, setName, setUp, tearDown, toString
-
Field Details
-
UNKNOWN
public static final short UNKNOWNAn unknown type of Castor test case.- See Also:
-
DIRECTORY
public static final short DIRECTORYA directory-based Castor test case.- See Also:
-
JAR
public static final short JARA JAR-based Castor test case.- See Also:
-
TEST_DESCRIPTOR
Name of the resource for the test descriptor XML document.- See Also:
-
-
Constructor Details
-
CastorTestCase
Constructs a CTF test case given only a test case name.- Parameters:
name
- the name of the test case
-
CastorTestCase
Constructs a CTF test case given a File (either a JAR file or a directory) and a directory where temporary files will be placed. The test case name will be derived from the file (JAR or directory) name.- Parameters:
file
- Either a directory containing TestDescriptor.xml or a JAR file containing META-INF/TestDescriptor.xmldirectoryToHere
- directory path leading to the current test.outputRoot
- Directory where temporary files and output will go.
-
-
Method Details
-
getClassLoader
-
getTestFile
-
getType
public short getType() -
getDirectoryToHere
-
getOutputRootFile
-
isDirectoryCompiled
public boolean isDirectoryCompiled()Returns a boolean that when true indicates the output directory has been compiled. This is useful for preventing the compilation of a directory multiple times when more than one test case exists in a given directory.- Returns:
- true when the output root directory has already been compiled.
-
setClassLoader
Sets the ClassLoader to use for loading the resources for this test case.- Parameters:
loader
- the class loader to use
-
setDirectoryCompiled
public void setDirectoryCompiled(boolean compiled) Sets a flag to indicate the output directory has been compiled. This prevents compiling a directory multiple times unnecessarily when more than one test case exists in a given directory.- Parameters:
compiled
- true if the output directory for this test case has been compiled
-
suite
public junit.framework.Test suite()Assembles and returns a test suite containing all known tests.- Returns:
- A non-null test suite if we can load the test descriptor
-