Class TestFinderDecorator
java.lang.Object
com.sun.javatest.TestFinder
com.sun.javatest.finder.TestFinderDecorator
A test finder decorator that reads tests from a delegate, and returns the
results in the reverse/random order. This is primarily for debugging
and testing purposes.
-
Nested Class Summary
Nested classes/interfaces inherited from class TestFinder
TestFinder.ErrorHandler, TestFinder.Fault -
Field Summary
Fields inherited from class TestFinder
debug, env -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the current comparator being used.File[]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 theinitmethod.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.booleanDetermine whether a location corresponds to a directory (folder) or an actual file.longlastModified(File f) Determine when the last time this path was modified.voidRead a file, looking for test descriptions and other files that might need to be read.protected voidScan a file, looking for test descriptions and other files that might need to be scanned.voidIncoming files and test descriptions are sorted by their name during processing, this method allows adjustment of the comparison method to be used during this sorting.Returns the total number of tests in the inspected suite if it is known.Methods inherited from class TestFinder
clearErrors, decodeAllArgs, decodeArg, error, error, error, foundFile, foundTestDescription, foundTestDescription, getDefaultComparator, getErrorCount, getErrorHandler, getErrors, init, init, localizedError, normalize, processEntry, setErrorHandler, setRoot
-
Constructor Details
-
TestFinderDecorator
Default constructor
-
-
Method Details
-
getRoot
Description copied from class:TestFinderGet the root file of the test suite, as passed in to theinitmethod.- Overrides:
getRootin classTestFinder- Returns:
- the root file of the test suite
- See Also:
-
getRootDir
Description copied from class:TestFinderGet 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:
getRootDirin classTestFinder- Returns:
- the root directory of the test suite
-
read
Description copied from class:TestFinderRead 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:
readin classTestFinder- Parameters:
file- The file to be read.
-
getTests
Description copied from class:TestFinderGet the test descriptions that were found by the most recent call of read.- Overrides:
getTestsin classTestFinder- Returns:
- the test descriptions that were found by the most recent call of read.
- See Also:
-
getFiles
Description copied from class:TestFinderGet the files that were found by the most recent call of read.- Overrides:
getFilesin classTestFinder- Returns:
- the files that were found by the most recent call of read.
- See Also:
-
getComparator
Description copied from class:TestFinderGet the current comparator being used.- Overrides:
getComparatorin classTestFinder- Returns:
- The current comparator, may be null.
- See Also:
-
setComparator
Description copied from class:TestFinderIncoming files and test descriptions are sorted by their name during processing, this method allows adjustment of the comparison method to be used during this sorting. Sorting can be disabled by calling this method with anullparameter. By default, this class will do US Locale sorting.- Overrides:
setComparatorin classTestFinder- Parameters:
c- The comparison operator to be used. Null indicates no sorting (old behavior).- See Also:
-
getCurrentTestFinder
-
lastModified
Description copied from class:TestFinderDetermine when the last time this path was modified. This is used to decide whether to rescan that location or not. The default implementation defers the choice to the java.- Overrides:
lastModifiedin classTestFinder- Parameters:
f- The location in question.
-
isFolder
Description copied from class:TestFinderDetermine whether a location corresponds to a directory (folder) or an actual file. If the finder implementation chooses, the locations used in read() and scan() may be real or virtual. This method will be queried to determine if a location is a container or something that should be scanned for tests. If it is both...- Overrides:
isFolderin classTestFinder- Parameters:
path- The location in question.
-
totalNumberOfTestsInTheSuite
Description copied from class:TestFinderReturns the total number of tests in the inspected suite if it is known. (For example if preliminary quick scan of the suite was done). Default implementation returns empty Optional.- Overrides:
totalNumberOfTestsInTheSuitein classTestFinder- Returns:
- total number of tests or empty optional if there's no info available
-
scan
Description copied from class:TestFinderScan 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:
scanin classTestFinder- Parameters:
file- The file to scan
-