|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cdx.scorebot.net.tests.Test<S>
public abstract class Test<S extends Service>
An abstract test which is the skeleton for individual tests on particular services. The constructor takes derivative of the Service class to specify the service the test can run on (or the abstract Service if it is service-independent).
Constructor Summary | |
---|---|
|
Test(S service)
Instantiates a test (with no configuration) for the purpose of instantiating tests of this type with different configurations later. |
protected |
Test(S service,
Configuration config)
Instantiates a test with the specified config (verify that it includes all needed configuration options). |
protected |
Test(S service,
java.util.HashMap<java.lang.String,ConfigOption> options)
Instantiates a test with the specified config (verify that it includes all needed configuration options). |
Method Summary | |
---|---|
boolean |
equals(Test t)
|
Configuration |
getConfig()
gets the options used to configure the test |
java.lang.Object |
getConfig(java.lang.String optionName)
gets the value of the requested option used to configure the test (null is returned if there is no option by this name) |
protected abstract java.util.HashMap<java.lang.String,ConfigOption> |
getDefaultConfigValues()
returns a key-value pair of what options are available for configuration along with their default values |
Configuration |
getDefaultConfigValuesCopy()
returns a COPY of the key-value pairs of what options are available for configuration along with their default values |
Configuration |
getInitialConfigCopy()
returns a complete COPY of the key-value pairs of what options are available for configuration along with their default values |
S |
getService()
gets the service the test is running on |
abstract Test |
instantiate(java.util.HashMap<java.lang.String,ConfigOption> config)
Instantiates a test of this type with the specified config (verify that it includes all needed configuration options). |
protected abstract void |
prepareDefaultResults(TestEvent results)
give all results the test returns some default value |
protected abstract void |
run(TestEvent result)
run the test and put all results into the results TestEvent object |
TestEvent |
run(TestItem ti)
wrapper for run(TestEvent): creates the TestEvent and ensures timestamping is done |
void |
setService(S s)
sets the service the test is running on |
void |
verifyConfig(Configuration configuration,
java.util.HashMap<java.lang.String,ConfigOption> neededConfig)
Checks the config to ensure it has all the properties in neededConfig. |
abstract void |
verifyConfigValue(java.lang.String optionName,
ConfigOption optionValue)
Determine whether the specified configuration option is a valid value. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Test(S service)
service
- the service this test will run againstprotected Test(S service, Configuration config)
service
- the service this test will run againstconfig
- the test configuration information used when the test is
run (warning: these options may change when verified)protected Test(S service, java.util.HashMap<java.lang.String,ConfigOption> options)
options
- a hash of the test configuration information used when the test is
run (warning: these options may change when verified)Method Detail |
---|
public boolean equals(Test t)
public Configuration getDefaultConfigValuesCopy()
public Configuration getInitialConfigCopy()
protected abstract java.util.HashMap<java.lang.String,ConfigOption> getDefaultConfigValues()
public S getService()
public void setService(S s)
public abstract Test instantiate(java.util.HashMap<java.lang.String,ConfigOption> config)
config
- the test configuration information used when the test is
run (warning: these options may change when verified)
protected abstract void prepareDefaultResults(TestEvent results)
public final TestEvent run(TestItem ti)
ti
- the TestItem which contained this test
protected abstract void run(TestEvent result)
result
- the results of the Test are stored herepublic void verifyConfig(Configuration configuration, java.util.HashMap<java.lang.String,ConfigOption> neededConfig)
configuration
- the configuration to check (and fix as needed)neededConfig
- the configuration options which are required (along with default values)public abstract void verifyConfigValue(java.lang.String optionName, ConfigOption optionValue) throws TestMisconfigurationException
optionName
- the name of the option (the key in the config HashMap)optionValue
- the value of the option (the value in the config HashMap); will not be null
TestMisconfigurationException
public Configuration getConfig()
public java.lang.Object getConfig(java.lang.String optionName)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |