Class HTMLTestFinder
java.lang.Object
com.sun.javatest.TestFinder
com.sun.javatest.finder.HTMLTestFinder
This class searches out test descriptions as represented by
certain HTML elements in a hierarchy of HTML files.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class TestFinder
TestFinder.ErrorHandler, TestFinder.Fault -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intA value forsetMode(int)to specify that the child files within the test tree should be determined by sub-directories and HTML files within directories.static final intA value forsetMode(int)to specify that the child files within the test tree should be determined from the HTML <a href=...> tags.Fields inherited from class TestFinder
debug, env -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected intDecode the arg at a specified position in the arg array.protected FileGet the name of the file currently being read.intgetMode()Get the current mode for how this test finder determines the child files to be scanned.getRoot()Get the root file of the test suite, as passed in to theinitmethod.protected voidlocalizedError(String msg) Report a message to the error handler, without additional processing.protected voidScan a file, looking for test descriptions and other files that might need to be scanned.voidsetMode(int mode) Specify the mode for how this test finder determines the child files to be scanned.Methods inherited from class TestFinder
clearErrors, decodeAllArgs, error, error, error, foundFile, foundTestDescription, foundTestDescription, getComparator, getDefaultComparator, getErrorCount, getErrorHandler, getErrors, getFiles, getRootDir, getTests, init, init, isFolder, lastModified, normalize, processEntry, read, setComparator, setErrorHandler, setRoot, totalNumberOfTestsInTheSuite
-
Field Details
-
WEB_WALK
public static final int WEB_WALKA value forsetMode(int)to specify that the child files within the test tree should be determined from the HTML <a href=...> tags.- See Also:
-
DIR_WALK
public static final int DIR_WALKA value forsetMode(int)to specify that the child files within the test tree should be determined by sub-directories and HTML files within directories.- See Also:
-
-
Constructor Details
-
HTMLTestFinder
public HTMLTestFinder()Create an HTMLTestFinder.
-
-
Method Details
-
decodeArg
Description copied from class:TestFinderDecode the arg at a specified position in the arg array. If overridden by a subtype, the subtype should try and decode any args it recognizes, and then call super.decodeArg to give the superclass(es) a chance to recognize any arguments.- Overrides:
decodeArgin classTestFinder- Parameters:
args- The array of argumentsi- The next argument to be decoded- Returns:
- The number of elements consumed in the array; for example, for a simple option like "-v" the result should be 1; for an option with an argument like "-f file" the result should be 2, etc.
- Throws:
TestFinder.Fault- If there is a problem with the value of the current arg, such as a bad value to an option, the Fault exception can be thrown. The exception should NOT be thrown if the current arg is unrecognized: in that case, an implementation should delegate the call to the supertype.
-
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:
-
localizedError
Description copied from class:TestFinderReport a message to the error handler, without additional processing.- Overrides:
localizedErrorin classTestFinder- Parameters:
msg- The message to be reported- See Also:
-
getMode
-
setMode
-
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
-
getCurrentFile
Get the name of the file currently being read.- Returns:
- the name of the file currently being read.
-