Package com.sun.javatest.finder
Class ReverseTestFinder
java.lang.Object
com.sun.javatest.TestFinder
com.sun.javatest.finder.ReverseTestFinder
A test finder that reads tests from a delegate, and returns the
results in the reverse order. This is primarily for debugging
and testing purposes.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.sun.javatest.TestFinder
TestFinder.ErrorHandler, TestFinder.Fault
-
Field Summary
Fields inherited from class com.sun.javatest.TestFinder
debug, env
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorReverseTestFinder
(TestFinder delegate) Constructor to create ReverseTestFinder object when the original TestFinder instance is already created and initialized. -
Method Summary
Modifier and TypeMethodDescriptionFile[]
getFiles()
Get the files that were found by the most recent call of read.getRoot()
Get the root file of the test suite, as passed in to theinit
method.Get the root directory of the test suite; this is either the root passed in to the init method or if that is a file, it is the directory containing the file.getTests()
Get the test descriptions that were found by the most recent call of read.void
init
(String[] args, File testSuiteRoot, TestEnvironment env) Initialize the test finder.void
Read a file, looking for test descriptions and other files that might need to be read.protected void
Scan a file, looking for test descriptions and other files that might need to be scanned.Methods inherited from class com.sun.javatest.TestFinder
clearErrors, decodeAllArgs, decodeArg, error, error, error, foundFile, foundTestDescription, foundTestDescription, getComparator, getDefaultComparator, getErrorCount, getErrorHandler, getErrors, init, isFolder, lastModified, localizedError, normalize, processEntry, setComparator, setErrorHandler, setRoot, totalNumberOfTestsInTheSuite
-
Constructor Details
-
ReverseTestFinder
public ReverseTestFinder()Default constructor -
ReverseTestFinder
Constructor to create ReverseTestFinder object when the original TestFinder instance is already created and initialized. Finders created with this constructor do not require the init() method to be invoked.- Parameters:
delegate
- - the real test finder object.
-
-
Method Details
-
init
Initialize the test finder.- Overrides:
init
in classTestFinder
- Parameters:
args
- The first entry in the array should be the name of the test finder to be used to actually read the tests; subsequent entries in the array will be passed through to the init method for that class.testSuiteRoot
- The root file of the test suite to be read.env
- An environment for the test finder to use if required. The ReverseTestFinder does not use this value directly; it just passes it on to the test finder to which it delegates the reading.- Throws:
TestFinder.Fault
- if any problems occur during initialization.
-
getRoot
Description copied from class:TestFinder
Get the root file of the test suite, as passed in to theinit
method.- Overrides:
getRoot
in classTestFinder
- Returns:
- the root file of the test suite
- See Also:
-
getRootDir
Description copied from class:TestFinder
Get the root directory of the test suite; this is either the root passed in to the init method or if that is a file, it is the directory containing the file.- Overrides:
getRootDir
in classTestFinder
- Returns:
- the root directory of the test suite
-
read
Description copied from class:TestFinder
Read a file, looking for test descriptions and other files that might need to be read. If the file is relative, it will be evaluated relative to getRootDir. Depending on the test finder, the file may be either a plain file or a directory.- Overrides:
read
in classTestFinder
- Parameters:
file
- The file to be read.
-
getTests
Description copied from class:TestFinder
Get the test descriptions that were found by the most recent call of read.- Overrides:
getTests
in classTestFinder
- Returns:
- the test descriptions that were found by the most recent call of read.
- See Also:
-
getFiles
Description copied from class:TestFinder
Get the files that were found by the most recent call of read.- Overrides:
getFiles
in classTestFinder
- Returns:
- the files that were found by the most recent call of read.
- See Also:
-
scan
Description copied from class:TestFinder
Scan a file, looking for test descriptions and other files that might need to be scanned. The implementation depends on the type of test finder.- Specified by:
scan
in classTestFinder
- Parameters:
file
- The file to scan
-