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 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 BasicParameters
concurrencyError, excludeListError, keywordsError, testSuiteError, timeoutFactorError, workDirErrorFields inherited from interface Parameters.ConcurrencyParameters
MAX_CONCURRENCY, MIN_CONCURRENCYFields inherited from interface Parameters.MutableExcludeListParameters
CHECK_EVERY_RUN, CHECK_EVERY_X_DAYS, CUSTOM_EXCLUDE_LIST, INITIAL_EXCLUDE_LIST, LATEST_EXCLUDE_LIST, NO_EXCLUDE_LISTFields inherited from interface Parameters.MutableKeywordsParameters
ALL_OF, ANY_OF, EXPR, MATCH_KEYWORDS, NO_KEYWORDSFields inherited from interface Parameters.MutablePriorStatusParameters
MATCH_PRIOR_STATUS, NO_PRIOR_STATUSFields inherited from interface Parameters.MutableTestsParameters
ALL_TESTS, SPECIFIED_TESTSFields inherited from interface 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 booleanisParameterFile(File file) Determine if the specified file is a parameter file, as determined by whether its extension is .jtp or not.booleanisValid()Determine whether all the configuration values are valid.voidsetEnvFiles(File... files) Set the files which contain the environment used to run the tests.voidsetEnvName(String name) Set the name of the environment to be used, from the set of environments contained in the fles set by setEnvFiles.voidsetReportDir(File dir) Set the report directory.Methods inherited from class 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:-ttestsuite-testsuitetestsuite- Specify the test suite
-keywordsexpr- Specify a keyword expression, used to filter the tests to be run.
-statusstatus-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 -excludeexclude-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.
-envFileenvironment-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.
-envenvironment-name- Specify the name of the environment to be used from the set of environment files.
-concurrencynumber- Specify how many tests JT Harness may run at once. The default is 1.
-timeoutFactornumber- Specify a scale factor to be used to multiply the timeout value for each test, to allow for running on slow CPUs.
-reportreport-dir-rreport-dir- Specify a directory in which to write reports at the end of the test run.
-workDirwork-dir-wwork-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:ParametersGet an object which provides access to the environment of test-suite-specific configuration values to be used when each test is run.- Specified by:
getEnvParametersin interfaceParameters- Returns:
- an object which provides access to the environment to be used when each test is run.
-
getEnvFiles
Description copied from interface:Parameters.LegacyEnvParametersGet 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:
getEnvFilesin interfaceParameters.LegacyEnvParameters- Returns:
- the set of files which define the exclude list
- See Also:
-
setEnvFiles
Description copied from interface:Parameters.LegacyEnvParametersSet 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:
setEnvFilesin interfaceParameters.LegacyEnvParameters- Parameters:
files- the set of files which contain the environment to be used- See Also:
-
getAbsoluteEnvFiles
Description copied from interface:Parameters.LegacyEnvParametersGet the set of files which define the environment used to run the tests. The files are all returned as absolute files.- Specified by:
getAbsoluteEnvFilesin interfaceParameters.LegacyEnvParameters- Returns:
- the set of files which contact the exclude list
- See Also:
-
getEnvName
Description copied from interface:Parameters.LegacyEnvParametersGet the name of the environment to be used, from the set of environments contained in the fles set by setEnvFiles.- Specified by:
getEnvNamein interfaceParameters.LegacyEnvParameters- Returns:
- the name of the environment to be used to run the tests
- See Also:
-
setEnvName
Description copied from interface:Parameters.LegacyEnvParametersSet the name of the environment to be used, from the set of environments contained in the fles set by setEnvFiles.- Specified by:
setEnvNamein 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:ParametersGet the environment of test-suite-specific configuration values, to be passed to the script used to run each test.- Specified by:
getEnvin interfaceParameters- Specified by:
getEnvin 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:ParametersDetermine 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:
isValidin interfaceParameters- Overrides:
isValidin classBasicParameters- Returns:
- true if and only if all the configuration values are valid
- See Also:
-
getErrorMessage
Description copied from interface:ParametersIf 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:
getErrorMessagein interfaceParameters- Overrides:
getErrorMessagein 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:
-