Package com.sun.javatest
Class InterviewParameters
- java.lang.Object
-
- com.sun.interview.Interview
-
- com.sun.javatest.InterviewParameters
-
- All Implemented Interfaces:
Parameters
- Direct Known Subclasses:
BasicInterviewParameters
public abstract class InterviewParameters extends Interview implements Parameters
Configuration parameters provided via an interview.- Since:
- 3.0
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
InterviewParameters.JTIFault
Indicates problems when accessing the configuration file.static interface
InterviewParameters.TemplateManager
The template manager is used to change behavior of template saving, the default implementation is the context manager of corresponding test suite.static class
InterviewParameters.TestSuiteFault
Indicates problems when accessing the test suite.static class
InterviewParameters.WorkDirFault
Indicates problems when accessing the work directory.-
Nested classes/interfaces inherited from class com.sun.interview.Interview
Interview.BadHelpFault, Interview.Fault, Interview.HelpNotFoundFault, Interview.NotOnPathFault, Interview.Observer
-
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 Modifier and Type Field Description protected java.io.File[]
kflFiles
-
Fields inherited from class com.sun.interview.Interview
EXPORT_IGNORE_ALL_EXCEPTIONS, EXPORT_IGNORE_NO_EXCEPTIONS, EXPORT_IGNORE_RUNTIME_EXCEPTIONS, EXTERNAL_PREF, helpSetFactory, INTERVIEW, LOCALE, MARKERS, MARKERS_PREF, QUESTION, SEMANTIC_MAX_VERSION, SEMANTIC_PRE_32, SEMANTIC_VERSION_32, SEMANTIC_VERSION_43, SEMANTIC_VERSION_50, TEMPLATE_PREF
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
InterviewParameters(java.lang.String tag)
Create an InterviewParameters object.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description boolean
checkForUpdates()
Returns true if there was updatevoid
clear()
Clear any responses to all the questions in this interview, and then recursively, in its child interviews.void
dispose()
Clean up an InterviewParameters object.BackupPolicy
getBackupPolicy()
Get the backup policy to be used when saving configuration files.int
getConcurrency()
Get an integer specifying the maximum number of tests that may be run in parallel.protected abstract Question
getConcurrencyFirstQuestion()
Get the first question concerning the number of tests that may be run in parallel.protected Question
getConcurrencySuccessorQuestion()
Get the next question after those concerning the number of tests that may be run in parallel.java.lang.String
getDescription()
Get a description for this configuration.TestEnvironment
getEnv()
Get the environment of test-suite-specific configuration values, to be passed to the script used to run each test.protected abstract Question
getEnvFirstQuestion()
Get the first question to be asked concerning the environment to be set up and used for each test to be run.protected Question
getEnvSuccessorQuestion()
Get the next question to be asked after those concerning the environment to be set up and used for each test to be run.protected abstract Question
getEpilogFirstQuestion()
Get the first question of the epilog, which should be asked after all the other questions in the configuration interview have been asked.java.lang.String
getErrorMessage()
If there is an error in any of the configuration values, as indicated by isValid, this method will provide a detail message about the first question for which there is a problem.ExcludeList
getExcludeList()
Get an exclude list which identifies tests or test cases to be excluded from the test run.TestFilter
getExcludeListFilter()
Get a filter which will filter tests according to the result of getExcludeList().protected abstract Question
getExcludeListFirstQuestion()
Get the first question to be asked concerning the exclude list to be used to exclude tests from the test run.protected Question
getExcludeListSuccessorQuestion()
Get the next question to be asked after those concerning the exclude list to be used to exclude tests from the test run.TestFilter
getExcludeTableFilter()
Deprecated.Use getExcludeListFilter().protected Question
getExcludeTableFirstQuestion()
Deprecated.Use getExcludeListFirstQuestion().protected Question
getExcludeTableSuccessorQuestion()
Deprecated.Use getExcludeListFirstQuestion().java.io.File
getFile()
Get the file associated with this interview.TestFilter[]
getFilters()
Get an array of the non-null filters returned from getExcludeListFilter, getKeywordsFilter, getPriorStatusFilter, and getRelevantTestFilter.Keywords
getKeywords()
Get a keywords object which identifies tests to be run according to their keywords.TestFilter
getKeywordsFilter()
Get a filter which will filter tests according to the result of getKeywords().protected abstract Question
getKeywordsFirstQuestion()
Get the first question to be asked concerning the keywords that may be used to select tests for the test run.protected Question
getKeywordsSuccessorQuestion()
Get the next question to be asked after those concerning the keywords that may be used to select tests for the test run.java.io.File[]
getKnownFailureFiles()
Get the current set of known failures list files.KnownFailuresList
getKnownFailuresList()
Get the combined known failures list.boolean
getMarkersEnabled()
Check whether or not markers should be enabled.boolean
getMarkersFilterEnabled()
Check whether or not the history list should be filtered to just show questions which have been marked.java.lang.String
getName()
Get the name for this configuration.TestFilter
getPriorStatusFilter()
Get a filter which will filter tests according to the result of getPriorStatusValus().protected abstract Question
getPriorStatusFirstQuestion()
Get the first question to be asked concerning whether tests should be selected for execution according to their prior execution status.protected Question
getPriorStatusSuccessorQuestion()
Get the next question to be asked after those concerning whether tests should be selected for execution according to their prior execution status.boolean[]
getPriorStatusValues()
Get an array of booleans which identify tests to be run according to their prior execution status.protected Question
getPrologSuccessorQuestion()
Get the next question to the asked after the initial prolog of questions.CustomPropagationController
getPropagationController()
TestFilter
getRelevantTestFilter()
Get a test-suite specific filter which will filter tests according to test-suite-specific criteria, as perhaps determined by a configuration interview.InterviewParameters.TemplateManager
getTemplateManger()
Return the template manager for this InterviewParameters.java.lang.String
getTemplatePath()
Return String path to the template file for the current instance.java.lang.String[]
getTests()
Get the paths identifying the tests or folders of tests within the test suite to be run.protected abstract Question
getTestsFirstQuestion()
Get the first question to be asked concerning the set of tests and folders of tests to be run.protected Question
getTestsSuccessorQuestion()
Get the next question to be asked after those concerning the tests and folders of tests to be run.float
getTimeoutFactor()
Get an integer specifying a scale factor to be applied to the standard timeout for the test.protected abstract Question
getTimeoutFactorFirstQuestion()
Get the first question concerning the scale factor to be applied to the standard timeout for each test.protected Question
getTimeoutFactorSuccessorQuestion()
Get the next question after those concerning the scale factor to be applied to the standard timeout for each test.void
init(java.lang.String[] args)
Initialize an InterviewParameters object.protected boolean
isAutoUpdatableKey(java.lang.String key)
protected boolean
isAutoUpdatableKey(java.lang.String key, java.lang.String subkey)
boolean
isFileLoaded()
Check if the current file has been loaded into this interview, or if the interview has been saved in it.boolean
isFileNewer()
Determine if the file associated with this interview has been modified on disk after the last call of load or save.static boolean
isInterviewFile(java.io.File f)
Determine if the specified file is an interview file, as determined by whether its extension is .jti or not.boolean
isTemplate()
Determine if the current instance is a template or not.protected boolean
isUpdatableKey(java.lang.String key)
boolean
isValid()
Determine whether all the configuration values are valid, by checking if the interview has been completed.boolean
load()
Load the interview with the contents of the file associated with the interview.void
load(Parameters other)
Load the interview as best as possible with the data in another Parameters object.boolean
load(java.io.File file)
Load the interview with the contents of a specified file, which will become the default file associated with the interview.void
load(java.util.Map data, boolean checkChecksum)
Load the state for questions from an archive map.boolean
load(java.util.Map data, java.io.File file)
Load the interview with data that has already been read from a specified file, which will become the default file associated with the interview.static InterviewParameters
open(java.io.File file)
Create an InterviewParameters as determined by the contents of an interview file.static InterviewParameters
open(java.io.File file, TestSuite testSuite)
Create an InterviewParameters by populating the interview for a specified test suite with responses from a given file.static InterviewParameters
open(java.io.File file, WorkDirectory workDir)
Create an InterviewParameters by populating the interview for a specified work directory with responses from a given file.static InterviewParameters
open(java.io.File testSuitePath, java.io.File workDirPath, java.io.File configFilePath)
Open a a configuration file, based on paths for the configuration file, test suite and work directory.static InterviewParameters
open(java.lang.String testSuitePath, java.lang.String workDirPath, java.lang.String configFilePath)
Open a a configuration file, based on paths for the configuration file, test suite and work directory.void
save()
Save the current set of answers for the interview in the standard file associated with the interview.void
save(java.io.File file)
Save the current state of the interview in a specified file, and make that file the new file associated with the interview.void
save(java.io.File file, boolean isTemplate)
Save the current state of the interview in a specified file, and make that file the new file associated with the interview.void
save(java.util.Map data)
Save the state for questions in an archive map.void
saveAs(java.io.File file)
Save the current state of the interview in a specified file, including the paths for the test suite and work directory.void
saveAs(java.io.File file, boolean saveTestSuite, boolean saveWorkDir)
Save the current state of the interview in a specified file.void
saveAs(java.io.File file, boolean saveTestSuite, boolean saveWorkDir, boolean isTemplate)
Save the current state of the interview in a specified file.void
setBackupPolicy(BackupPolicy backupPolicy)
Set the backup policy to be used when saving configuration files.void
setFile(java.io.File f)
Set the file associated with this interview.void
setKnownFailureFiles(java.io.File[] files)
Set the set of KFL files.void
setMarkersEnabled(boolean on)
Specify whether or not markers should be enabled.void
setMarkersFilterEnabled(boolean on)
Specify whether or not the history list should be filtered to just show questions which have been marked.void
setPropagationController(CustomPropagationController pc)
void
setTemplate(boolean tm)
Set if the current instance is a template or not.void
setTemplateManger(InterviewParameters.TemplateManager tm)
Set given template manager for this InterviewParameters.void
setTemplatePath(java.lang.String tu)
Set the location of a configuration's master template.abstract void
setWorkDirectory(WorkDirectory workDir)
Set the work directory to be used for this test run.-
Methods inherited from class com.sun.interview.Interview
addObserver, callInterview, clearMarkedResponses, containsObserver, createChecklist, createChecklistItem, createChecklistItem, createChecklistItem, export, getAllQuestions, getCurrentQuestion, getDefaultImage, getExportIgnoreExceptionPolicy, getExternalProperties, getFirstQuestion, getHelpSet, getInterview, getInterviewSemantics, getParent, getPath, getPathToCurrent, getPropertyKeys, getQuestions, getRawPath, getResourceBundle, getResourceString, getResourceString, getRoot, getTag, getTitle, hasNext, hasValidNext, isChecklistEmpty, isChecksumValid, isEdited, isFinishable, isFirst, isInterviewFinishable, isLast, isRoot, isStarted, iteratePath, iteratePathToCurrent, last, load, next, pathContains, pathContains, prev, propagateTemplateForAll, readLocale, removeAllMarkers, removeMarkers, removeObserver, reset, retrieveProperty, retrieveTemplateKeys, retrieveTemplateProperty, setBaseTag, setCurrentQuestion, setDefaultImage, setEdited, setExportIgnoreExceptionPolicy, setFirstQuestion, setHelpSet, setHelpSet, setHelpSet, setInterviewSemantics, setResourceBundle, setResourceBundle, setTitle, storeProperty, storeTemplateProperties, storeTemplateProperty, updatePath, updatePath, verifyPathContains, writeLocale
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.sun.javatest.Parameters
getConcurrencyParameters, getEnvParameters, getExcludeListParameters, getKeywordsParameters, getPriorStatusParameters, getTestsParameters, getTestSuite, getTimeoutFactorParameters, getWorkDirectory, setTestSuite
-
-
-
-
Method Detail
-
setPropagationController
public void setPropagationController(CustomPropagationController pc)
-
getPropagationController
public CustomPropagationController getPropagationController()
-
setWorkDirectory
public abstract void setWorkDirectory(WorkDirectory workDir)
Set the work directory to be used for this test run.- Specified by:
setWorkDirectory
in interfaceParameters
- Parameters:
workDir
- the work directory to be used for this test run. It must match the test suite to be used for this test run- See Also:
Parameters.getWorkDirectory()
-
setTemplateManger
public void setTemplateManger(InterviewParameters.TemplateManager tm)
Set given template manager for this InterviewParameters.- Parameters:
tm
- new template manager
-
getTemplateManger
public InterviewParameters.TemplateManager getTemplateManger()
Return the template manager for this InterviewParameters.
-
init
public void init(java.lang.String[] args) throws Interview.Fault
Initialize an InterviewParameters object. This method is called when the object is created from an entry in a .jtt file. By default, the method throws an exception if any arguments are given. It should be redefined by any test suites that wish to support this type of initialization.- Parameters:
args
- test suite specific args with which to initialize this InterviewParameters object- Throws:
Interview.Fault
- if any problems occurred while processing the arguments
-
dispose
public void dispose()
Clean up an InterviewParameters object. This method should be invoked at the moment InterviewParameters object becomes useless by the code, that controls it's lifecycle. For example, at the end of the method which created it's local instance. Any following invocations on this object may result in unpredictable exceptions because of object inconsistence.
-
getName
public java.lang.String getName()
Get the name for this configuration. By default and for backwards compatibility, this defaults to the name of the test environment, which means that the whole environment may need to be evaluated to get the required value. Subtypes may choose to override this method to provide a more efficient implementation.Since the default implementation gets the name from the test environment, clients should not use this method to determine the name for the test environment, unless this method is redefined. The default implementation detects such a circular usage, and returns null in this case.
- Returns:
- the name for this configuration, or null if not known.
-
getDescription
public java.lang.String getDescription()
Get a description for this configuration. By default and for backwards compatibility, this defaults to the description entry in the test environment, which means that the whole environment may need to be evaluated to get the required value. Subtypes may choose to override this method to provide a more efficient implementation.- Returns:
- a description for this configuration, or null if not known
-
getPrologSuccessorQuestion
protected Question getPrologSuccessorQuestion()
Get the next question to the asked after the initial prolog of questions. The default value is the result of getEnvFirstQuestion.- Returns:
- the next question to be asked after the initial prolog of questions.
- See Also:
Interview.setFirstQuestion(com.sun.interview.Question)
-
getEnv
public TestEnvironment getEnv()
Description copied from interface:Parameters
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
- Returns:
- an environment to be passed to the script used to run each test.
- See Also:
Parameters.EnvParameters.getEnv()
-
getEnvFirstQuestion
protected abstract Question getEnvFirstQuestion()
Get the first question to be asked concerning the environment to be set up and used for each test to be run. If these questions are contained in an interview, this method can be simply implemented as:
return callInterview(
envInterview, getEnvSuccessorQuestion);
- Returns:
- the first question to be asked concerning the environment to be set up and used for each test to be run.
- See Also:
getEnvSuccessorQuestion()
-
getEnvSuccessorQuestion
protected Question getEnvSuccessorQuestion()
Get the next question to be asked after those concerning the environment to be set up and used for each test to be run. The default value is the result of getTestsFirstQuestion.- Returns:
- the next question to be asked after those concerning the environment to be set up and used for each test to be run.
- See Also:
getEnvFirstQuestion()
-
getTests
public java.lang.String[] getTests()
Description copied from interface:Parameters
Get the paths identifying the tests or folders of tests within the test suite to be run.- Specified by:
getTests
in interfaceParameters
- Returns:
- an array of paths identifying the tests to be run
- See Also:
Parameters.TestsParameters.getTests()
-
getTestsFirstQuestion
protected abstract Question getTestsFirstQuestion()
Get the first question to be asked concerning the set of tests and folders of tests to be run.- Returns:
- the first question to be asked concerning the set of tests and folders of tests to be run.
- See Also:
getTestsSuccessorQuestion()
-
getTestsSuccessorQuestion
protected Question getTestsSuccessorQuestion()
Get the next question to be asked after those concerning the tests and folders of tests to be run. The default value is the result of getExcludeListFirstQuestion.- Returns:
- the next question to be asked after those concerning the tests and folders of tests to be run.
- See Also:
getTestsFirstQuestion()
-
getExcludeList
public ExcludeList getExcludeList()
Description copied from interface:Parameters
Get an exclude list which identifies tests or test cases to be excluded from the test run.- Specified by:
getExcludeList
in interfaceParameters
- Returns:
- an exclude list identifying tests or test cases to be excluded from the test run.
- See Also:
Parameters.getExcludeListFilter()
,Parameters.ExcludeListParameters.getExcludeList()
-
getKnownFailuresList
public KnownFailuresList getKnownFailuresList()
Get the combined known failures list. Interviews expecting to use known failures lists should generally override this method and add support for users to change it.- Returns:
- Current known failures list - combined from the one or more file specified by the user.
- Since:
- 4.4
- See Also:
setKnownFailureFiles(java.io.File[])
,BasicInterviewParameters
-
setKnownFailureFiles
public void setKnownFailureFiles(java.io.File[] files)
Set the set of KFL files.- Parameters:
files
- The known failures list files. The array should contain one or more elements.- Since:
- 4.4
-
getKnownFailureFiles
public java.io.File[] getKnownFailureFiles()
Get the current set of known failures list files. The default implementation will return the value in the kflFiles field, which subclasses may set.- Returns:
- The list of known failure list files. Null if none.
- Since:
- 4.4
- See Also:
setKnownFailureFiles(java.io.File[])
-
getExcludeListFirstQuestion
protected abstract Question getExcludeListFirstQuestion()
Get the first question to be asked concerning the exclude list to be used to exclude tests from the test run.- Returns:
- the first question to be asked concerning the exclude list to be used to exclude tests from the test run.
- See Also:
getExcludeListSuccessorQuestion()
-
getExcludeTableFirstQuestion
protected Question getExcludeTableFirstQuestion()
Deprecated.Use getExcludeListFirstQuestion().Get the first question to be asked concerning the exclude list to be used to exclude tests from the test run.- Returns:
- the first question to be asked concerning the exclude list to be used to exclude tests from the test run
- See Also:
getExcludeListFirstQuestion()
-
getExcludeListSuccessorQuestion
protected Question getExcludeListSuccessorQuestion()
Get the next question to be asked after those concerning the exclude list to be used to exclude tests from the test run. The default value is the result of getKeywordsFirstQuestion,- Returns:
- the next question to be asked after those concerning the exclude list to be used to exclude tests from the test run.
- See Also:
getExcludeListFirstQuestion()
-
getExcludeTableSuccessorQuestion
protected Question getExcludeTableSuccessorQuestion()
Deprecated.Use getExcludeListFirstQuestion().Get the next question to be asked after those concerning the exclude list to be used to exclude tests from the test run.- Returns:
- the next question to be asked after those concerning the exclude list to be used to exclude tests from the test run
- See Also:
getExcludeListSuccessorQuestion()
-
getKeywords
public Keywords getKeywords()
Description copied from interface:Parameters
Get a keywords object which identifies tests to be run according to their keywords.- Specified by:
getKeywords
in interfaceParameters
- Returns:
- a keywords object which identifies tests to be run according to their keywords.
- See Also:
Parameters.KeywordsParameters.getKeywords()
-
getKeywordsFirstQuestion
protected abstract Question getKeywordsFirstQuestion()
Get the first question to be asked concerning the keywords that may be used to select tests for the test run.- Returns:
- the first question to be asked concerning the keywords that may be used to select tests for the test run.
- See Also:
getKeywordsSuccessorQuestion()
-
getKeywordsSuccessorQuestion
protected Question getKeywordsSuccessorQuestion()
Get the next question to be asked after those concerning the keywords that may be used to select tests for the test run. The default value is the result of getPriorStatusQuestion.- Returns:
- the next question to be asked after those concerning the keywords that may be used to select tests for the test run.
- See Also:
getKeywordsFirstQuestion()
-
getPriorStatusValues
public boolean[] getPriorStatusValues()
Description copied from interface:Parameters
Get an array of booleans which identify tests to be run according to their prior execution status. The array can be indexed by the constants Status.PASSED, Status.FAILED, Status.ERROR, and Status.NOT_RUN. For each of those values, if the corresponding boolean in the array is true, a test will be selected if its status matches the index. If the array is null, all tests will be selected.- Specified by:
getPriorStatusValues
in interfaceParameters
- Returns:
- an array of booleans which identifying tests to be run according to their prior execution status, or null if no such criteria is required.
- See Also:
Parameters.PriorStatusParameters.getPriorStatusValues()
-
getPriorStatusFirstQuestion
protected abstract Question getPriorStatusFirstQuestion()
Get the first question to be asked concerning whether tests should be selected for execution according to their prior execution status.- Returns:
- the first question to be asked concerning whether tests should be selected for execution according to their prior execution status.
- See Also:
getPriorStatusSuccessorQuestion()
-
getPriorStatusSuccessorQuestion
protected Question getPriorStatusSuccessorQuestion()
Get the next question to be asked after those concerning whether tests should be selected for execution according to their prior execution status. The default value is the result of getConcurrencyFirstQuestion- Returns:
- the next question to be asked after those concerning whether tests should be selected for execution according to their prior execution status.
- See Also:
getPriorStatusFirstQuestion()
-
getConcurrency
public int getConcurrency()
Description copied from interface:Parameters
Get an integer specifying the maximum number of tests that may be run in parallel.- Specified by:
getConcurrency
in interfaceParameters
- Returns:
- an integer specifying the maximum number of tests that may be run in parallel
- See Also:
Parameters.ConcurrencyParameters.getConcurrency()
-
getConcurrencyFirstQuestion
protected abstract Question getConcurrencyFirstQuestion()
Get the first question concerning the number of tests that may be run in parallel.- Returns:
- the first question concerning the number of tests that may be run in parallel.
- See Also:
getConcurrencySuccessorQuestion()
-
getConcurrencySuccessorQuestion
protected Question getConcurrencySuccessorQuestion()
Get the next question after those concerning the number of tests that may be run in parallel. The default is the result of getTimeoutFactorFirstQuestion- Returns:
- the next question after those concerning the number of tests that may be run in parallel.
- See Also:
getConcurrencyFirstQuestion()
-
getTimeoutFactor
public float getTimeoutFactor()
Description copied from interface:Parameters
Get an integer specifying a scale factor to be applied to the standard timeout for the test.- Specified by:
getTimeoutFactor
in interfaceParameters
- Returns:
- an integer specifying a scale factor to be applied to the standard timeout for each test.
- See Also:
Parameters.TimeoutFactorParameters.getTimeoutFactor()
-
getTimeoutFactorFirstQuestion
protected abstract Question getTimeoutFactorFirstQuestion()
Get the first question concerning the scale factor to be applied to the standard timeout for each test.- Returns:
- the first question concerning the scale factor to be applied to the standard timeout for each test.
- See Also:
getTimeoutFactorSuccessorQuestion()
-
getTimeoutFactorSuccessorQuestion
protected Question getTimeoutFactorSuccessorQuestion()
Get the next question after those concerning the scale factor to be applied to the standard timeout for each test. The default is the result of getEpilogFirstQuestion- Returns:
- the next question after those concerning the scale factor to be applied to the standard timeout for each test.
- See Also:
getTimeoutFactorFirstQuestion()
-
getEpilogFirstQuestion
protected abstract Question getEpilogFirstQuestion()
Get the first question of the epilog, which should be asked after all the other questions in the configuration interview have been asked. The epilog should terminate in the standard way with a FinalQuestion.- Returns:
- the first question of the epilog, which should be asked after all the other questions in the configuration interview have been asked.
-
isValid
public boolean isValid()
Determine whether all the configuration values are valid, by checking if the interview has been completed. 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
- Returns:
- true if and only if all the configuration values are valid
- See Also:
getErrorMessage()
,Interview.isFinishable()
-
getErrorMessage
public java.lang.String getErrorMessage()
If there is an error in any of the configuration values, as indicated by isValid, this method will provide a detail message about the first question for which there is a problem.- Specified by:
getErrorMessage
in interfaceParameters
- Returns:
- a detail message about the first question with an invalid answer, or null if none.
- See Also:
isValid()
-
getExcludeTableFilter
public TestFilter getExcludeTableFilter()
Deprecated.Use getExcludeListFilter().Get a filter which will filter tests according to the result of getExcludeList(). If the result of getExcludeList is null or an empty exclude list, the result of this method will also be null.- Returns:
- a filter which will filter tests according to the result of getExcludeList()
- See Also:
getExcludeListFilter()
-
getExcludeListFilter
public TestFilter getExcludeListFilter()
Description copied from interface:Parameters
Get a filter which will filter tests according to the result of getExcludeList(). If the result of getExcludeList is null or an empty exclude list, the result of this method will also be null.- Specified by:
getExcludeListFilter
in interfaceParameters
- Returns:
- a filter which will filter tests according to the result of getExcludeList().
- See Also:
Parameters.getExcludeList()
-
getKeywordsFilter
public TestFilter getKeywordsFilter()
Description copied from interface:Parameters
Get a filter which will filter tests according to the result of getKeywords(). If the result of getKeywords is null, the result of this method will also be null.- Specified by:
getKeywordsFilter
in interfaceParameters
- Returns:
- a filter which will filter tests according to the result of getKeywords().
- See Also:
Parameters.getKeywords()
-
getPriorStatusFilter
public TestFilter getPriorStatusFilter()
Description copied from interface:Parameters
Get a filter which will filter tests according to the result of getPriorStatusValus(). If the result of getPriorStatusValues is null, the result of this method will also be null.- Specified by:
getPriorStatusFilter
in interfaceParameters
- Returns:
- a filter which will filter tests according to the result of getPriorStatusValues().
- See Also:
Parameters.getPriorStatusValues()
-
getRelevantTestFilter
public TestFilter getRelevantTestFilter()
Description copied from interface:Parameters
Get a test-suite specific filter which will filter tests according to test-suite-specific criteria, as perhaps determined by a configuration interview. For example, if the platform being tested does not support some optional feature, the tests for that feature could be automatically filtered out. If no such filter is required, null can be returned.- Specified by:
getRelevantTestFilter
in interfaceParameters
- Returns:
- a test-suite-specific filter, or null if no such filter is required.
-
getFilters
public TestFilter[] getFilters()
Description copied from interface:Parameters
Get an array of the non-null filters returned from getExcludeListFilter, getKeywordsFilter, getPriorStatusFilter, and getRelevantTestFilter.- Specified by:
getFilters
in interfaceParameters
- Returns:
- an array of the non-null filters returned by the various getXXXFilter methods.
- See Also:
Parameters.getExcludeListFilter()
,Parameters.getKeywordsFilter()
,Parameters.getPriorStatusFilter()
,Parameters.getRelevantTestFilter()
-
isTemplate
public boolean isTemplate()
Determine if the current instance is a template or not.- Returns:
- true if the current instance is a template, and false otherwise
-
setTemplate
public void setTemplate(boolean tm)
Set if the current instance is a template or not. For internal use only, architects should not use this.
-
isAutoUpdatableKey
protected boolean isAutoUpdatableKey(java.lang.String key)
-
isAutoUpdatableKey
protected boolean isAutoUpdatableKey(java.lang.String key, java.lang.String subkey)
-
isUpdatableKey
protected boolean isUpdatableKey(java.lang.String key)
-
getTemplatePath
public java.lang.String getTemplatePath()
Return String path to the template file for the current instance. If the current instance is a template (isTemplate() returns true), the path to itself will be returned.- Returns:
- String path to the template file, or null if the instance is not template-based
-
setTemplatePath
public void setTemplatePath(java.lang.String tu)
Set the location of a configuration's master template. Do not change this value if this instance is a template.
-
getFile
public java.io.File getFile()
Get the file associated with this interview.- Returns:
- the file associated with this interview.
- See Also:
setFile(java.io.File)
,load()
,save()
-
setFile
public void setFile(java.io.File f)
Set the file associated with this interview. This file will be used by subsequent load and save operations.
-
isInterviewFile
public static boolean isInterviewFile(java.io.File f)
Determine if the specified file is an interview file, as determined by whether its extension is .jti or not.- Parameters:
f
- the file to be checked- Returns:
- true if the specified file is an interview file, and false otherwise
-
open
public static InterviewParameters open(java.io.File file) throws java.io.IOException, Interview.Fault
Create an InterviewParameters as determined by the contents of an interview file.- Parameters:
file
- the file to be read- Returns:
- an InterviewParameters as determined by the contents of an interview file.
- Throws:
java.io.IOException
- is there is a problem reading the fileInterview.Fault
- if there is a problem instantiating the interview
-
open
public static InterviewParameters open(java.io.File file, TestSuite testSuite) throws java.io.IOException, Interview.Fault
Create an InterviewParameters by populating the interview for a specified test suite with responses from a given file.- Parameters:
file
- the file to be readtestSuite
- the test suite for which to create the interview- Returns:
- an InterviewParameters as determined by the test suite and the contents of an interview file
- Throws:
java.io.IOException
- is there is a problem reading the fileInterview.Fault
- if there is a problem instantiating the interview
-
open
public static InterviewParameters open(java.io.File file, WorkDirectory workDir) throws java.io.IOException, Interview.Fault
Create an InterviewParameters by populating the interview for a specified work directory with responses from a given file.- Parameters:
file
- the file to be readworkDir
- the work directory (implying the test suite) for which to create the interview- Returns:
- an InterviewParameters as determined by the work directory and the contents of an interview file
- Throws:
java.io.IOException
- is there is a problem reading the fileInterview.Fault
- if there is a problem instantiating the interview
-
clear
public void clear()
Description copied from class:Interview
Clear any responses to all the questions in this interview, and then recursively, in its child interviews.
-
open
public static InterviewParameters open(java.lang.String testSuitePath, java.lang.String workDirPath, java.lang.String configFilePath) throws Interview.Fault
Open a a configuration file, based on paths for the configuration file, test suite and work directory. Any, but not all, of these paths may be null. Any non-null path must specify an appropriate existing file, otherwise an exception will be thrown.- Parameters:
testSuitePath
- the path for the test suite; if not specified, the test suite will default from the work directory (if specified) or the configuration file.workDirPath
- the path for the work directory; if not specified, the work directory will the default from the config file (if specified), or will be null if no configuration file is givenconfigFilePath
- the path for the configuration file; if not specified, the result will be a blank interview as created by the test suite.- Returns:
- an InterviewParameters object created from the given arguments
- Throws:
Interview.Fault
- if there is any problem creating the result
-
open
public static InterviewParameters open(java.io.File testSuitePath, java.io.File workDirPath, java.io.File configFilePath) throws Interview.Fault
Open a a configuration file, based on paths for the configuration file, test suite and work directory. Any, but not all, of these paths may be null. Any non-null path must specify an appropriate existing file, otherwise an exception will be thrown.- Parameters:
testSuitePath
- the path for the test suite; if not specified, the test suite will default from the work directory (if specified) or the configuration file.workDirPath
- the path for the work directory; if not specified, the work directory will bdefault from the config file (if specified), or will be null if no configuration file is givenconfigFilePath
- the path for the configuration file; if not specified, the result will be a blank interview as created by the test suite.- Returns:
- an InterviewParameters object created from the gievn arguments
- Throws:
Interview.Fault
- if there is any problem creating the result
-
load
public boolean load() throws java.io.IOException, Interview.Fault
Load the interview with the contents of the file associated with the interview. If the file does not exist, the interview will be cleared.- Returns:
- true if there was an update from template
- Throws:
java.io.IOException
- is there is a problem reading the fileInterview.Fault
- if there is a problem loading the interview
-
load
public boolean load(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException, Interview.Fault
Load the interview with the contents of a specified file, which will become the default file associated with the interview.- Parameters:
file
- the file to be loaded- Returns:
- true if there was an update from template
- Throws:
java.io.FileNotFoundException
- if the specified file does not exist.java.io.IOException
- is there is a problem reading the fileInterview.Fault
- if there is a problem loading the interview
-
load
public boolean load(java.util.Map data, java.io.File file) throws Interview.Fault
Load the interview with data that has already been read from a specified file, which will become the default file associated with the interview.- Parameters:
data
- the data to be loadedfile
- the file from which the data was read- Returns:
- true if there was an update from template
- Throws:
Interview.Fault
- if there is a problem loading the interview
-
checkForUpdates
public boolean checkForUpdates()
Returns true if there was update
-
load
public void load(java.util.Map data, boolean checkChecksum) throws Interview.Fault
Description copied from class:Interview
Load the state for questions from an archive map. The map will be passed to each question in this interview and in any child interviews, and each question shouldload
its state, according to its tag. The data must normally contain a valid checksum, generated duringInterview.save(java.util.Map)
.- Overrides:
load
in classInterview
- Parameters:
data
- The archive map from which the state should be loaded.checkChecksum
- If true, the checksum in the data will be checked.- Throws:
Interview.Fault
- if the checksum is found to be incorrect.
-
load
public void load(Parameters other)
Load the interview as best as possible with the data in another Parameters object. If any of the various sub-objects as returned by getXXXParameters are not recognized, they will be ignored.- Parameters:
other
- The Parameters object to be copied.
-
save
public void save() throws java.io.IOException, Interview.Fault
Save the current set of answers for the interview in the standard file associated with the interview.- Throws:
java.io.IOException
- is there is a problem writing the fileInterview.Fault
- if there is a problem preparing the interview to be written- See Also:
getFile()
-
save
public void save(java.io.File file) throws java.io.IOException, Interview.Fault
Save the current state of the interview in a specified file, and make that file the new file associated with the interview.- Parameters:
file
- the file in which to save the state of the interview- Throws:
java.io.IOException
- is there is a problem writing the fileInterview.Fault
- if there is a problem preparing the interview to be written- See Also:
getFile()
-
save
public void save(java.io.File file, boolean isTemplate) throws java.io.IOException, Interview.Fault
Save the current state of the interview in a specified file, and make that file the new file associated with the interview.- Parameters:
file
- the file in which to save the state of the interviewisTemplate
-- Throws:
java.io.IOException
- is there is a problem writing the fileInterview.Fault
- if there is a problem preparing the interview to be written- See Also:
getFile()
-
saveAs
public void saveAs(java.io.File file) throws java.io.IOException, Interview.Fault
Save the current state of the interview in a specified file, including the paths for the test suite and work directory.- Parameters:
file
- the file in which to save the state of the interview- Throws:
java.io.IOException
- is there is a problem writing the fileInterview.Fault
- if there is a problem preparing the interview to be written
-
saveAs
public void saveAs(java.io.File file, boolean saveTestSuite, boolean saveWorkDir, boolean isTemplate) throws java.io.IOException, Interview.Fault
Save the current state of the interview in a specified file. If the test suite path is not saved, the file can only be used as a configuration template.- Parameters:
file
- the file in which to save the state of the interviewsaveTestSuite
- if true, the test suite path will be saved in the file.saveWorkDir
- if true, the work directory path will be saved in the file.isTemplate
- True, the interview will be saved as template.- Throws:
java.io.IOException
- is there is a problem writing the fileInterview.Fault
- if there is a problem preparing the interview to be written
-
saveAs
public void saveAs(java.io.File file, boolean saveTestSuite, boolean saveWorkDir) throws java.io.IOException, Interview.Fault
Save the current state of the interview in a specified file. If the test suite path is not saved, the file can only be used as a configuration template.- Parameters:
file
- the file in which to save the state of the interviewsaveTestSuite
- if true, the test suite path will be saved in the file.saveWorkDir
- if true, the work directory path will be saved in the file.- Throws:
java.io.IOException
- is there is a problem writing the fileInterview.Fault
- if there is a problem preparing the interview to be written
-
save
public void save(java.util.Map data)
Description copied from class:Interview
Save the state for questions in an archive map. The map will be passed to each question in this interview and in any child interviews, and each question shouldsave
its state, according to its tag.
-
getBackupPolicy
public BackupPolicy getBackupPolicy()
Get the backup policy to be used when saving configuration files.- Returns:
- the backup policy object to be used when saving configuration files
- See Also:
setBackupPolicy(com.sun.javatest.util.BackupPolicy)
-
setBackupPolicy
public void setBackupPolicy(BackupPolicy backupPolicy)
Set the backup policy to be used when saving configuration files.- Parameters:
backupPolicy
- the backup policy object to be used when saving configuration files- See Also:
getBackupPolicy()
-
isFileLoaded
public boolean isFileLoaded()
Check if the current file has been loaded into this interview, or if the interview has been saved in it.- Returns:
- true if the file associated with the interview was set as a side effect of load or save, or false if the file was just set by setFile.
-
isFileNewer
public boolean isFileNewer()
Determine if the file associated with this interview has been modified on disk after the last call of load or save.
-
getMarkersEnabled
public boolean getMarkersEnabled()
Check whether or not markers should be enabled.- Returns:
- whether or not markers should be enabled
- See Also:
setMarkersEnabled(boolean)
-
setMarkersEnabled
public void setMarkersEnabled(boolean on)
Specify whether or not markers should be enabled.- Parameters:
on
- whether or not markers should be enabled- See Also:
getMarkersEnabled()
-
getMarkersFilterEnabled
public boolean getMarkersFilterEnabled()
Check whether or not the history list should be filtered to just show questions which have been marked.- Returns:
- whether or not the history list should be filtered to just show questions which have been marked
- See Also:
setMarkersFilterEnabled(boolean)
-
setMarkersFilterEnabled
public void setMarkersFilterEnabled(boolean on)
Specify whether or not the history list should be filtered to just show questions which have been marked.- Parameters:
on
- whether or not the history list should be filtered to just show questions which have been marked- See Also:
getMarkersFilterEnabled()
-
-