Package com.sun.javatest
Class FileParameters
java.lang.Object
com.sun.javatest.BasicParameters
com.sun.javatest.FileParameters
- All Implemented Interfaces:
Parameters
,Parameters.ConcurrencyParameters
,Parameters.EnvParameters
,Parameters.ExcludeListParameters
,Parameters.KeywordsParameters
,Parameters.LegacyEnvParameters
,Parameters.MutableConcurrencyParameters
,Parameters.MutableExcludeListParameters
,Parameters.MutableKeywordsParameters
,Parameters.MutablePriorStatusParameters
,Parameters.MutableTestsParameters
,Parameters.MutableTimeoutFactorParameters
,Parameters.PriorStatusParameters
,Parameters.TestsParameters
,Parameters.TimeoutFactorParameters
An implementation of Parameters, using data read from a .jtp file.
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sun.javatest.Parameters
Parameters.ConcurrencyParameters, Parameters.EnvParameters, Parameters.ExcludeListParameters, Parameters.KeywordsParameters, Parameters.LegacyEnvParameters, Parameters.MutableConcurrencyParameters, Parameters.MutableExcludeListParameters, Parameters.MutableKeywordsParameters, Parameters.MutablePriorStatusParameters, Parameters.MutableTestsParameters, Parameters.MutableTimeoutFactorParameters, Parameters.PriorStatusParameters, Parameters.TestsParameters, Parameters.TimeoutFactorParameters
-
Field Summary
Fields inherited from class com.sun.javatest.BasicParameters
concurrencyError, excludeListError, keywordsError, testSuiteError, timeoutFactorError, workDirError
Fields inherited from interface com.sun.javatest.Parameters.ConcurrencyParameters
MAX_CONCURRENCY, MIN_CONCURRENCY
Fields inherited from interface com.sun.javatest.Parameters.MutableExcludeListParameters
CHECK_EVERY_RUN, CHECK_EVERY_X_DAYS, CUSTOM_EXCLUDE_LIST, INITIAL_EXCLUDE_LIST, LATEST_EXCLUDE_LIST, NO_EXCLUDE_LIST
Fields inherited from interface com.sun.javatest.Parameters.MutableKeywordsParameters
ALL_OF, ANY_OF, EXPR, MATCH_KEYWORDS, NO_KEYWORDS
Fields inherited from interface com.sun.javatest.Parameters.MutablePriorStatusParameters
MATCH_PRIOR_STATUS, NO_PRIOR_STATUS
Fields inherited from interface com.sun.javatest.Parameters.MutableTestsParameters
ALL_TESTS, SPECIFIED_TESTS
Fields inherited from interface com.sun.javatest.Parameters.TimeoutFactorParameters
MAX_TIMEOUT_FACTOR, MIN_TIMEOUT_FACTOR
-
Constructor Summary
ConstructorsConstructorDescriptionCreate an empty FileParameters object.FileParameters
(File file) Create a FileParameters object, based on data read from a parameter file.FileParameters
(String... args) Create a FileParameters object, based on command-line-like args. -
Method Summary
Modifier and TypeMethodDescriptionFile[]
Get the set of files which define the environment used to run the tests.getEnv()
Get the environment of test-suite-specific configuration values, to be passed to the script used to run each test.File[]
Get the set of files which define the environment used to run the tests.Get the name of the environment to be used, from the set of environments contained in the fles set by setEnvFiles.Get an object which provides access to the environment of test-suite-specific configuration values to be used when each test is run.Get an object containing the environments read from the environment files.If there is an error in any of the configuration values, as indicated by isValid, this method will provide a detail message about one or more of the invalid values.Get the report directory given in the parameters.static boolean
isParameterFile
(File file) Determine if the specified file is a parameter file, as determined by whether its extension is .jtp or not.boolean
isValid()
Determine whether all the configuration values are valid.void
setEnvFiles
(File... files) Set the files which contain the environment used to run the tests.void
setEnvName
(String name) Set the name of the environment to be used, from the set of environments contained in the fles set by setEnvFiles.void
setReportDir
(File dir) Set the report directory.Methods inherited from class com.sun.javatest.BasicParameters
equal, equal, getAbsoluteFiles, getConcurrency, getConcurrencyParameters, getCustomExcludeFiles, getExcludeFiles, getExcludeList, getExcludeListFilter, getExcludeListParameters, getExcludeMode, getFilters, getKeywords, getKeywordsFilter, getKeywordsMode, getKeywordsParameters, getLatestExcludeAutoCheckInterval, getLatestExcludeAutoCheckMode, getMatchKeywordsMode, getMatchKeywordsValue, getMatchPriorStatusValues, getPriorStatusFilter, getPriorStatusMode, getPriorStatusParameters, getPriorStatusValues, getRelevantTestFilter, getSpecifiedTests, getTests, getTestsMode, getTestsParameters, getTestSuite, getTimeoutFactor, getTimeoutFactorParameters, getWorkDirectory, isLatestExcludeAutoCheckEnabled, setConcurrency, setCustomExcludeFiles, setExcludeFiles, setExcludeMode, setKeywords, setKeywordsMode, setLatestExcludeAutoCheckEnabled, setLatestExcludeAutoCheckInterval, setLatestExcludeAutoCheckMode, setMatchKeywords, setMatchPriorStatusValues, setPriorStatusMode, setPriorStatusValues, setSpecifiedTests, setTests, setTestsMode, setTestSuite, setTestSuite, setTimeoutFactor, setWorkDirectory, setWorkDirectory
-
Constructor Details
-
FileParameters
public FileParameters()Create an empty FileParameters object. -
FileParameters
Create a FileParameters object, based on data read from a parameter file.- Parameters:
file
- the file to be read to initialize this object- Throws:
FileNotFoundException
- if the file does not existIOException
- if there is a problem reading the file
-
FileParameters
Create a FileParameters object, based on command-line-like args. The args that are accepted are:-t
testsuite-testsuite
testsuite- Specify the test suite
-keywords
expr- Specify a keyword expression, used to filter the tests to be run.
-status
status-list- Specify the status values used to select tests at runtime.
status-list should be a comma-separated list of words from
the following list:
passed
,failed
,error
,notRun
-exclude
exclude-list-file- Specify an exclude-list file containing a list of tests to be excluded from the test run. The option can be specified more than once, with different files.
-envFile
environment-file- Specify an environment file, containing environment entries providing details on how to run tests. The option can be specified more than once, with different files.
-env
environment-name- Specify the name of the environment to be used from the set of environment files.
-concurrency
number- Specify how many tests JT Harness may run at once. The default is 1.
-timeoutFactor
number- Specify a scale factor to be used to multiply the timeout value for each test, to allow for running on slow CPUs.
-report
report-dir-r
report-dir- Specify a directory in which to write reports at the end of the test run.
-workDir
work-dir-w
work-dir- Specify a directory in which to write the results of the individual tests.
- initial-files
- Trailing file arguments are treated as initial files, used to select which parts of the test suite should be run.
- Parameters:
args
- The args used to initialize the FileParameters object.- Throws:
IllegalArgumentException
- If an unrecognized argument is found.
-
-
Method Details
-
isParameterFile
Determine if the specified file is a parameter file, as determined by whether its extension is .jtp or not.- Parameters:
file
- the file to be checked- Returns:
- true if the specified file is a parameter file, and false otherwise
-
getEnvParameters
Description copied from interface:Parameters
Get an object which provides access to the environment of test-suite-specific configuration values to be used when each test is run.- Specified by:
getEnvParameters
in interfaceParameters
- Returns:
- an object which provides access to the environment to be used when each test is run.
-
getEnvFiles
Description copied from interface:Parameters.LegacyEnvParameters
Get the set of files which define the environment used to run the tests. The files are returned as they were set by setEnvFiles.- Specified by:
getEnvFiles
in interfaceParameters.LegacyEnvParameters
- Returns:
- the set of files which define the exclude list
- See Also:
-
setEnvFiles
Description copied from interface:Parameters.LegacyEnvParameters
Set the files which contain the environment used to run the tests. Relative files will be evaluated relative to the test suite root directory.- Specified by:
setEnvFiles
in interfaceParameters.LegacyEnvParameters
- Parameters:
files
- the set of files which contain the environment to be used- See Also:
-
getAbsoluteEnvFiles
Description copied from interface:Parameters.LegacyEnvParameters
Get the set of files which define the environment used to run the tests. The files are all returned as absolute files.- Specified by:
getAbsoluteEnvFiles
in interfaceParameters.LegacyEnvParameters
- Returns:
- the set of files which contact the exclude list
- See Also:
-
getEnvName
Description copied from interface:Parameters.LegacyEnvParameters
Get the name of the environment to be used, from the set of environments contained in the fles set by setEnvFiles.- Specified by:
getEnvName
in interfaceParameters.LegacyEnvParameters
- Returns:
- the name of the environment to be used to run the tests
- See Also:
-
setEnvName
Description copied from interface:Parameters.LegacyEnvParameters
Set the name of the environment to be used, from the set of environments contained in the fles set by setEnvFiles.- Specified by:
setEnvName
in interfaceParameters.LegacyEnvParameters
- Parameters:
name
- the name of the environment to be used to run the tests- See Also:
-
getEnvTable
Get an object containing the environments read from the environment files.- Returns:
- an object containing all the environments read from the environment files.
- See Also:
-
getEnv
Description copied from interface:Parameters.EnvParameters
Get the environment of test-suite-specific configuration values, to be passed to the script used to run each test.- Specified by:
getEnv
in interfaceParameters
- Specified by:
getEnv
in interfaceParameters.EnvParameters
- Returns:
- an environment to be passed to the script used to run each test.
- See Also:
-
isValid
public boolean isValid()Description copied from interface:Parameters
Determine whether all the configuration values are valid. If so, the result will be true; if not, the result will be false, and getErrorMessage will provide details about at least one of the invalid values.- Specified by:
isValid
in interfaceParameters
- Overrides:
isValid
in classBasicParameters
- Returns:
- true if and only if all the configuration values are valid
- See Also:
-
getErrorMessage
Description copied from interface:Parameters
If there is an error in any of the configuration values, as indicated by isValid, this method will provide a detail message about one or more of the invalid values. The result is undefined if isValid is true.- Specified by:
getErrorMessage
in interfaceParameters
- Overrides:
getErrorMessage
in classBasicParameters
- Returns:
- a detail message about one or more invalid values
- See Also:
-
getReportDir
Get the report directory given in the parameters.- Returns:
- the report directory
- See Also:
-
setReportDir
Set the report directory.- Parameters:
dir
- the report directory- See Also:
-