Package com.sun.javatest.finder
Class ExpandTestFinder
java.lang.Object
com.sun.javatest.TestFinder
com.sun.javatest.finder.TagTestFinder
com.sun.javatest.finder.ExpandTestFinder
This class allows a new tag "@expand" which allows a single test
description to be expanded into multiple test descriptions using
variable substitution. Variables are declared in the .jte file.
The list of valid entries is identical to those found for JCK.
There is no list of pre-defined keywords. If keyword checking
is needed, then the list of allowed keywords must be
provided via the -allowKeyword
option.
- See Also:
-
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 -
Method Summary
Modifier and TypeMethodDescriptionprotected int
Decode the arg at a specified position in the arg array.protected void
foundTestDescription
(Map<String, String> entries, File file, int line) Report that data for a test description has been found.void
init
(String[] args, File testSuiteRoot, TestEnvironment env) Initialize the data required by the finder.protected void
Handle a test description entry read from a file.Methods inherited from class com.sun.javatest.finder.TagTestFinder
addExtension, exclude, exclude, getClassForExtension, getCurrentFile, getInitialTag, isExcluded, parseComment, scan, scanFile, setInitialTag, unexclude
Methods inherited from class com.sun.javatest.TestFinder
clearErrors, decodeAllArgs, error, error, error, foundFile, foundTestDescription, getComparator, getDefaultComparator, getErrorCount, getErrorHandler, getErrors, getFiles, getRoot, getRootDir, getTests, init, isFolder, lastModified, localizedError, normalize, read, setComparator, setErrorHandler, setRoot, totalNumberOfTestsInTheSuite
-
Constructor Details
-
ExpandTestFinder
public ExpandTestFinder()
-
-
Method Details
-
decodeArg
Description copied from class:TagTestFinder
Decode the arg at a specified position in the arg array. If overridden by a subtype, the subtype should try and decode any arg it recognizes, and then call super.decodeArg to give the superclass(es) a chance to recognize any arguments.- Overrides:
decodeArg
in classTagTestFinder
- 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.
-
init
Description copied from class:TestFinder
Initialize the data required by the finder. Clients creating instances of test finders should call this before allowing use of the finder. Not doing so may result in unexpected results.- Overrides:
init
in classTestFinder
- Parameters:
args
- An array of strings specified as arguments in the environment. Null indicates no args.testSuiteRoot
- The root file that will be passed to test descriptions read by the finder.env
- The environment being used to run the test. May be null.- Throws:
TestFinder.Fault
- if there is a problem interpreting any of args.
-
foundTestDescription
Description copied from class:TestFinder
Report that data for a test description has been found.- Overrides:
foundTestDescription
in classTestFinder
- Parameters:
entries
- The data for the test descriptionfile
- The file being readline
- The line number within the file (used for error messages)
-
processEntry
Description copied from class:TestFinder
Handle a test description entry read from a file. By default, the name-value pair is inserted into the entries dictionary; however, the method can be overridden by a subtype to adjust the name or value before putting it into the dictionary, or even to ignore/fault the pair.- Overrides:
processEntry
in classTestFinder
- Parameters:
entries
- The dictionary of the entries being readname
- The name of the entry that has been readvalue
- The value of the entry that has been read
-