Package com.sun.javatest
Class TestDescription
java.lang.Object
com.sun.javatest.TestDescription
- All Implemented Interfaces:
Serializable
TestDescription objects embody the parameters of a test and provide the
ability to run a test. The parameters are normally found by parsing
HTML files and looking for distinguished constructions whose parameters
provide the necessary description of a test.
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTestDescription
(File root, File file, Map<?, ?> params) Construct a test description from the parameters of a recognized descriptions. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Deprecated.getDir()
Get the directory for this test description.Deprecated.usegetParameter("executeArgs")
insteadDeprecated.usegetParameter("executeClass")
insteadgetFile()
Get the file for this test description.getId()
Get the id within the file for this test description.String[]
Get the set of keywords for this test description, as specified by the "keywords" parameter.Get the set of keywords for this test description, as specified by the "keywords" parameter.getName()
Get the name of this test description; if not given explicitly, it defaults to the filename root of the first source file.getParameter
(String key) Get a parameter of the test description by name.int
Get the number of parameters contained in this test description.Get an iterator for the names of the parameters contained in this test description.getRoot()
Deprecated.No longer relevant for some test suites, so will not be supported in the future.Get the root directory for this test suite WARNING: If this description has been read in from a .jtr file, the rootDir may be inappropriate for this system.Deprecated.Use getRootRelativeFile().getParent()Get the file of the test, relative to the root dir for the test suite.Get the path of the test, relative to the root dir for the test suite.Get the url of the test, relative to the root dir for the test suite.File[]
Get the set of source files for this test description, as specified by the "source" parameter.String[]
Get the set of source files for this test description, as specified by the "source" parameter.URL[]
Get a list of associated files for a specified test description.int
Deprecated.usegetParameter("timeout")
insteadgetTitle()
Get the title of this test description.int
hashCode()
toString()
Simple standard debugging output.
-
Constructor Details
-
TestDescription
Construct a test description from the parameters of a recognized descriptions.- Parameters:
root
- The root file of the test suitefile
- The file containing the test descriptionparams
- The collected parameters of the test description- Throws:
IllegalArgumentException
- if the file argument is an absolute filename and does not begin with the root filename.
-
-
Method Details
-
hashCode
public int hashCode() -
equals
-
getDir
Get the directory for this test description.- Returns:
- the directory containing this test description
-
getFile
Get the file for this test description. WARNING: If this description has been read in from a .jtr file, the rootDir may be inappropriate for this system.- Returns:
- the file containing this test description
-
getId
Get the id within the file for this test description.- Returns:
- the id within the file of this test description
-
getTitle
Get the title of this test description. This title is determined from the "title" parameter, if present, defaulting to the value returned bygetName()
.- Returns:
- the title of this test description
-
getName
Get the name of this test description; if not given explicitly, it defaults to the filename root of the first source file.- Returns:
- the name of this test description
-
getKeywords
Get the set of keywords for this test description, as specified by the "keywords" parameter.- Returns:
- the set of keywords
-
getKeywordTable
Get the set of keywords for this test description, as specified by the "keywords" parameter. They are returned in canonical form (lower-case).- Returns:
- the set of keywords
-
getSources
Get the set of source files for this test description, as specified by the "source" parameter.- Returns:
- The sources as specified in the HTML test description
- See Also:
-
getSourceFiles
Get the set of source files for this test description, as specified by the "source" parameter. The files in the "source" parameter should normally be relative, in which case, they will be evaluated relative to the directory containing this test description. Then, if any of the files are under the user's current directory, they will be returned relative to that directory; otherwise, they will be returned as absolute filenames.- Returns:
- filenames specified by the source parameter.
- See Also:
-
getSourceURLs
Get a list of associated files for a specified test description. Normally, this will include the file containing the test description, and any source files used by the test. By default, the source files are determined from the test description's "source" entry.- Returns:
- a list of associated files for this test description
-
getClassDir
Deprecated.usegetParameter("classDir")
insteadGet the optional class directory for this test description, as specified by the "classDir" parameter.- Returns:
- the class directory, or null if not specified
-
getExecuteClass
Deprecated.usegetParameter("executeClass")
insteadGet the execution class for this test description, as specified by the "executeClass" parameter.- Returns:
- the execute class name, or null if not specified
-
getExecuteArgs
Deprecated.usegetParameter("executeArgs")
insteadGet the execution args for this test description, as specified by the "executeArgs" parameter.- Returns:
- the execute args, or null if not specified
-
getTimeout
Deprecated.usegetParameter("timeout")
insteadGet the requested timeout value for this test description, as specified by the "timeout" parameter.- Returns:
- the timeout value, or 0 if not specified
-
getRoot
Deprecated.No longer relevant for some test suites, so will not be supported in the future. If needed the value can be determined by asking the test suite'sTestFinder
.Get the root file for this test suite; THIS IS PROVIDED FOR BACKWARDS COMPATIBILTY FOR JCK ONLY. It returns the name of testsuite.html within the root directory of the test suite. WARNING: If this description has been read in from a .jtr file, the rootDir may be inappropriate for this system.- Returns:
- the root file for this test suite
- See Also:
-
getRootDir
Get the root directory for this test suite WARNING: If this description has been read in from a .jtr file, the rootDir may be inappropriate for this system.- Returns:
- the root directory for this test suite
-
getRootRelativePath
Get the path of the test, relative to the root dir for the test suite. This is the path to the source file for this description. The internal separator is always '/'.- Returns:
- the path for this test description within the test suite
-
getRootRelativeFile
Get the file of the test, relative to the root dir for the test suite.- Returns:
- A platform specific path to the source file.
-
getRootRelativeURL
Get the url of the test, relative to the root dir for the test suite. This is the path to the source file for this description, plus the test id if necessary. Again, the path separator is always '/'.- Returns:
- a relative URL for this test within the test suite
-
getRootRelativeDir
Deprecated.Use getRootRelativeFile().getParent()Get the path of the test directory, relative to the root directory for the test suite.- Returns:
- the a relative path to the directory containing this test description
-
getParameterCount
public int getParameterCount()Get the number of parameters contained in this test description.- Returns:
- the number of parameters
-
getParameterKeys
Get an iterator for the names of the parameters contained in this test description.- Returns:
- an iterator for the names of the parameters
-
getParameter
Get a parameter of the test description by name.- Parameters:
key
- the name of the parameter value to be returned- Returns:
- the value of the specified parameter, or null if not found
-
toString
Simple standard debugging output.
-
getParameter("classDir")
instead