|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.interview.Interview
com.sun.javatest.InterviewParameters
public abstract class InterviewParameters
Configuration parameters provided via an interview.
Nested Class Summary | |
---|---|
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 |
Field Summary | |
---|---|
protected java.io.File[] |
kflFiles
|
Fields inherited from class com.sun.interview.Interview |
---|
CHECKSUM, EXPORT_IGNORE_ALL_EXCEPTIONS, EXPORT_IGNORE_NO_EXCEPTIONS, EXPORT_IGNORE_RUNTIME_EXCEPTIONS, EXTERNAL_PREF, INTERVIEW, LOCALE, MARKERS, MARKERS_PREF, QUESTION, SEMANTIC_MAX_VERSION, SEMANTIC_PRE_32, SEMANTIC_VERSION_32, SEMANTIC_VERSION_43, TEMPLATE_PREF |
Constructor Summary | |
---|---|
protected |
InterviewParameters(java.lang.String tag)
Create an InterviewParameters object. |
Method Summary | |
---|---|
boolean |
checkForUpdates()
Returns true if there was update |
void |
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. |
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. |
void |
load(Parameters other)
Load the interview as best as possible with the data in another Parameters object. |
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 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.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.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 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 |
Field Detail |
---|
protected java.io.File[] kflFiles
Constructor Detail |
---|
protected InterviewParameters(java.lang.String tag)
tag
- The tag used to qualify questions in this interviewMethod Detail |
---|
public void setPropagationController(CustomPropagationController pc)
public CustomPropagationController getPropagationController()
public abstract void setWorkDirectory(WorkDirectory workDir)
setWorkDirectory
in interface Parameters
workDir
- the work directory to be used for this test run.
It must match the test suite to be used for this test runParameters.getWorkDirectory()
public void setTemplateManger(InterviewParameters.TemplateManager tm)
tm
- new template managerpublic InterviewParameters.TemplateManager getTemplateManger()
public void init(java.lang.String[] args) throws Interview.Fault
args
- test suite specific args with which to initialize
this InterviewParameters object
Interview.Fault
- if any problems occurred while processing the argumentspublic void dispose()
public java.lang.String getName()
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.
public java.lang.String getDescription()
protected Question getPrologSuccessorQuestion()
Interview.setFirstQuestion(com.sun.interview.Question)
public TestEnvironment getEnv()
Parameters
getEnv
in interface Parameters
Parameters.EnvParameters.getEnv()
protected abstract Question getEnvFirstQuestion()
return callInterview(
envInterview, getEnvSuccessorQuestion);
getEnvSuccessorQuestion()
protected Question getEnvSuccessorQuestion()
getEnvFirstQuestion()
public java.lang.String[] getTests()
Parameters
getTests
in interface Parameters
Parameters.TestsParameters.getTests()
protected abstract Question getTestsFirstQuestion()
getTestsSuccessorQuestion()
protected Question getTestsSuccessorQuestion()
getTestsFirstQuestion()
public ExcludeList getExcludeList()
Parameters
getExcludeList
in interface Parameters
Parameters.getExcludeListFilter()
,
Parameters.ExcludeListParameters.getExcludeList()
public KnownFailuresList getKnownFailuresList()
setKnownFailureFiles(java.io.File[])
,
BasicInterviewParameters
public void setKnownFailureFiles(java.io.File[] files)
files
- The known failures list files. The array should contain
one or more elements.public java.io.File[] getKnownFailureFiles()
setKnownFailureFiles(java.io.File[])
protected abstract Question getExcludeListFirstQuestion()
getExcludeListSuccessorQuestion()
protected Question getExcludeTableFirstQuestion()
getExcludeListFirstQuestion()
protected Question getExcludeListSuccessorQuestion()
getExcludeListFirstQuestion()
protected Question getExcludeTableSuccessorQuestion()
getExcludeListSuccessorQuestion()
public Keywords getKeywords()
Parameters
getKeywords
in interface Parameters
Parameters.KeywordsParameters.getKeywords()
protected abstract Question getKeywordsFirstQuestion()
getKeywordsSuccessorQuestion()
protected Question getKeywordsSuccessorQuestion()
getKeywordsFirstQuestion()
public boolean[] getPriorStatusValues()
Parameters
getPriorStatusValues
in interface Parameters
Parameters.PriorStatusParameters.getPriorStatusValues()
protected abstract Question getPriorStatusFirstQuestion()
getPriorStatusSuccessorQuestion()
protected Question getPriorStatusSuccessorQuestion()
getPriorStatusFirstQuestion()
public int getConcurrency()
Parameters
getConcurrency
in interface Parameters
Parameters.ConcurrencyParameters.getConcurrency()
protected abstract Question getConcurrencyFirstQuestion()
getConcurrencySuccessorQuestion()
protected Question getConcurrencySuccessorQuestion()
getConcurrencyFirstQuestion()
public float getTimeoutFactor()
Parameters
getTimeoutFactor
in interface Parameters
Parameters.TimeoutFactorParameters.getTimeoutFactor()
protected abstract Question getTimeoutFactorFirstQuestion()
getTimeoutFactorSuccessorQuestion()
protected Question getTimeoutFactorSuccessorQuestion()
getTimeoutFactorFirstQuestion()
protected abstract Question getEpilogFirstQuestion()
public boolean isValid()
isValid
in interface Parameters
getErrorMessage()
,
Interview.isFinishable()
public java.lang.String getErrorMessage()
getErrorMessage
in interface Parameters
isValid()
public TestFilter getExcludeTableFilter()
getExcludeListFilter()
public TestFilter getExcludeListFilter()
Parameters
getExcludeListFilter
in interface Parameters
Parameters.getExcludeList()
public TestFilter getKeywordsFilter()
Parameters
getKeywordsFilter
in interface Parameters
Parameters.getKeywords()
public TestFilter getPriorStatusFilter()
Parameters
getPriorStatusFilter
in interface Parameters
Parameters.getPriorStatusValues()
public TestFilter getRelevantTestFilter()
Parameters
getRelevantTestFilter
in interface Parameters
public TestFilter[] getFilters()
Parameters
getFilters
in interface Parameters
Parameters.getExcludeListFilter()
,
Parameters.getKeywordsFilter()
,
Parameters.getPriorStatusFilter()
,
Parameters.getRelevantTestFilter()
public boolean isTemplate()
public void setTemplate(boolean tm)
protected boolean isAutoUpdatableKey(java.lang.String key)
protected boolean isAutoUpdatableKey(java.lang.String key, java.lang.String subkey)
protected boolean isUpdatableKey(java.lang.String key)
public java.lang.String getTemplatePath()
public void setTemplatePath(java.lang.String tu)
public java.io.File getFile()
setFile(java.io.File)
,
load()
,
save()
public void setFile(java.io.File f)
f
- The file to be associated with this interview.getFile()
,
load()
,
save()
public static boolean isInterviewFile(java.io.File f)
f
- the file to be checked
public static InterviewParameters open(java.io.File file) throws java.io.IOException, Interview.Fault
file
- the file to be read
java.io.IOException
- is there is a problem reading the file
Interview.Fault
- if there is a problem instantiating the
interviewpublic static InterviewParameters open(java.io.File file, TestSuite testSuite) throws java.io.IOException, Interview.Fault
file
- the file to be readtestSuite
- the test suite for which to create the interview
java.io.IOException
- is there is a problem reading the file
Interview.Fault
- if there is a problem instantiating the
interviewpublic static InterviewParameters open(java.io.File file, WorkDirectory workDir) throws java.io.IOException, Interview.Fault
file
- the file to be readworkDir
- the work directory (implying the test suite) for which
to create the interview
java.io.IOException
- is there is a problem reading the file
Interview.Fault
- if there is a problem instantiating the
interviewpublic void clear()
Interview
clear
in class Interview
public static InterviewParameters open(java.lang.String testSuitePath, java.lang.String workDirPath, java.lang.String configFilePath) throws Interview.Fault
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.
Interview.Fault
- if there is any problem creating the
resultpublic static InterviewParameters open(java.io.File testSuitePath, java.io.File workDirPath, java.io.File configFilePath) throws Interview.Fault
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.
Interview.Fault
- if there is any problem creating the
resultpublic boolean load() throws java.io.IOException, Interview.Fault
java.io.IOException
- is there is a problem reading the file
Interview.Fault
- if there is a problem loading the
interviewpublic boolean load(java.io.File file) throws java.io.FileNotFoundException, java.io.IOException, Interview.Fault
file
- the file to be loaded
java.io.FileNotFoundException
- if the specified file does not exist.
java.io.IOException
- is there is a problem reading the file
Interview.Fault
- if there is a problem loading the
interviewpublic boolean load(java.util.Map data, java.io.File file) throws Interview.Fault
data
- the data to be loadedfile
- the file from which the data was read
Interview.Fault
- if there is a problem loading the interviewpublic boolean checkForUpdates()
public void load(java.util.Map data, boolean checkChecksum) throws Interview.Fault
Interview
load
its state, according to its tag.
The data must normally contain a valid checksum, generated during Interview.save(java.util.Map)
.
load
in class Interview
data
- The archive map from which the state should be loaded.checkChecksum
- If true, the checksum in the data will be checked.
Interview.Fault
- if the checksum is found to be incorrect.public void load(Parameters other)
other
- The Parameters object to be copied.public void save() throws java.io.IOException, Interview.Fault
java.io.IOException
- is there is a problem writing the file
Interview.Fault
- if there is a problem preparing the
interview to be writtengetFile()
public void save(java.io.File file) throws java.io.IOException, Interview.Fault
file
- the file in which to save the state of the interview
java.io.IOException
- is there is a problem writing the file
Interview.Fault
- if there is a problem preparing the
interview to be writtengetFile()
public void save(java.io.File file, boolean isTemplate) throws java.io.IOException, Interview.Fault
file
- the file in which to save the state of the interviewisTemplate
-
java.io.IOException
- is there is a problem writing the file
Interview.Fault
- if there is a problem preparing the
interview to be writtengetFile()
public void saveAs(java.io.File file) throws java.io.IOException, Interview.Fault
file
- the file in which to save the state of the interview
java.io.IOException
- is there is a problem writing the file
Interview.Fault
- if there is a problem preparing the
interview to be writtenpublic void saveAs(java.io.File file, boolean saveTestSuite, boolean saveWorkDir, boolean isTemplate) throws java.io.IOException, Interview.Fault
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.
java.io.IOException
- is there is a problem writing the file
Interview.Fault
- if there is a problem preparing the
interview to be writtenpublic void saveAs(java.io.File file, boolean saveTestSuite, boolean saveWorkDir) throws java.io.IOException, Interview.Fault
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.
java.io.IOException
- is there is a problem writing the file
Interview.Fault
- if there is a problem preparing the
interview to be writtenpublic void save(java.util.Map data)
Interview
save
its state, according to its tag.
save
in class Interview
data
- The archive in which the values should be saved.public BackupPolicy getBackupPolicy()
setBackupPolicy(com.sun.javatest.util.BackupPolicy)
public void setBackupPolicy(BackupPolicy backupPolicy)
backupPolicy
- the backup policy object to be used when saving configuration filesgetBackupPolicy()
public boolean isFileLoaded()
public boolean isFileNewer()
load()
,
save()
public boolean getMarkersEnabled()
setMarkersEnabled(boolean)
public void setMarkersEnabled(boolean on)
on
- whether or not markers should be enabledgetMarkersEnabled()
public boolean getMarkersFilterEnabled()
setMarkersFilterEnabled(boolean)
public void setMarkersFilterEnabled(boolean on)
on
- whether or not the history list should be filtered to
just show questions which have been markedgetMarkersFilterEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |