org.castor.xmlctf
Class CastorTestCase
TestCase
org.castor.xmlctf.CastorTestCase
public class CastorTestCase
extends 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.
$Revision: 6787 $ $Date: 2004-03-08 17:23:25 -0700 (Mon, 08 Mar 2004) $static short | DIRECTORY - A directory-based Castor test case.
|
static short | JAR - A JAR-based Castor test case.
|
static String | TEST_DESCRIPTOR - Name of the resource for the test descriptor XML document.
|
static short | UNKNOWN - An unknown type of Castor test case.
|
CastorTestCase(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.
|
DIRECTORY
public static final short DIRECTORY
A directory-based Castor test case.
JAR
public static final short JAR
A JAR-based Castor test case.
TEST_DESCRIPTOR
public static final String TEST_DESCRIPTOR
Name of the resource for the test descriptor XML document.
UNKNOWN
public static final short UNKNOWN
An unknown type of Castor test case.
CastorTestCase
public CastorTestCase(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. The test
case name will be derived from the file (JAR or directory) name.
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.
CastorTestCase
public CastorTestCase(String name)
Constructs a CTF test case given only a test case name.
name
- the name of the test case
getClassLoader
public ClassLoader getClassLoader()
getDirectoryToHere
public String getDirectoryToHere()
getOutputRootFile
public File getOutputRootFile()
getTestFile
public File getTestFile()
getType
public short getType()
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.
- true when the output root directory has already been compiled.
setClassLoader
public void setClassLoader(ClassLoader loader)
Sets the ClassLoader to use for loading the resources for this test case.
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.
compiled
- true if the output directory for this test case has been
compiled
suite
public Test suite()
Assembles and returns a test suite containing all known tests.
- A non-null test suite if we can load the test descriptor
Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com