Package com.sun.javatest.finder
Class RandomTestFinder
- java.lang.Object
-
- com.sun.javatest.TestFinder
-
- com.sun.javatest.finder.RandomTestFinder
-
public class RandomTestFinder extends TestFinder
A test finder that reads tests from a delegate, and returns the results in the random 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
Constructors Constructor Description RandomTestFinder(TestFinder delegate)
Constructor to create RandomTestFinder object when the original TestFinder instance is already created and initialized.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.io.File[]
getFiles()
Get the files that were found by the most recent call of read.java.io.File
getRoot()
Get the root file of the test suite, as passed in to theinit
method.java.io.File
getRootDir()
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.TestDescription[]
getTests()
Get the test descriptions that were found by the most recent call of read.void
read(java.io.File file)
Read a file, looking for test descriptions and other files that might need to be read.protected void
scan(java.io.File file)
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, init, isFolder, lastModified, localizedError, normalize, processEntry, setComparator, setErrorHandler, setRoot
-
-
-
-
Constructor Detail
-
RandomTestFinder
public RandomTestFinder(TestFinder delegate)
Constructor to create RandomTestFinder 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 Detail
-
getRoot
public java.io.File 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:
TestFinder.setRoot(java.io.File)
-
getRootDir
public java.io.File 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
public void read(java.io.File file)
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
public TestDescription[] 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:
TestFinder.read(java.io.File)
,TestFinder.foundTestDescription(java.util.Map, java.io.File, int)
-
getFiles
public java.io.File[] 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:
TestFinder.read(java.io.File)
,TestFinder.foundFile(java.io.File)
-
scan
protected void scan(java.io.File file)
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
-
-