|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.w3c.mwi.mobileok.basic.TesterConfiguration
public final class TesterConfiguration
Encapsulates configuration options that determine how the Checker behaves in terms of resource preprocessing and tests checking.
The Checker cannot be run without a proper configuration. Mandatory settings are:
ResourceRetrieverFactory
to use to create the appropriate
ResourceRetriever
instance to retrieve the resource.DecodedContentFactory
to use to created the decoded
representation of a resource in a DecodedContent
derived class.ResourceExtractor
s to use to extract additional
resources from decoded resources.moki
representation of the resource under test.The class also contains a generic key/value list that may be used to set additional settings specific to some other class, such as the host and port of an HTTP proxy to use to retrieve HTTP resources, the value of the User-Agent HTTP header to send in HTTP requests, or authentication parameters.
The class is implemented as a per-thread singleton to make it easy to access options across the code. Note to developers: beware, the Checker uses multi-threading and so the singleton must be passed along to any thread created while running tests on a resource.
Tester
Field Summary | |
---|---|
private java.util.Map<java.lang.String,java.lang.Object> |
configurationMap
Generic list of parameters that may be used by some classes. |
private DecodedContentFactory |
decodedContentFactory
Decoded content factory. |
private java.util.List<ResourceExtractor> |
extractors
List of resource extractors to be applied to retrieved resources in this configuration. |
static java.lang.String |
PASSWORD
|
private static java.lang.ThreadLocal<TesterConfiguration> |
perThreadConfiguration
Single thread instance of the configuration. |
private ResourceRetrieverFactory |
resourceRetrieverFactory
Resource retriever factory. |
private java.util.List<TestImplementation> |
tests
List of tests that need to be applied to the moki representation. |
static java.lang.String |
USERNAME
|
Constructor Summary | |
---|---|
TesterConfiguration(ResourceRetrieverFactory resourceRetrieverFactory,
DecodedContentFactory decodedContentFactory,
java.util.List<ResourceExtractor> extractors,
java.util.List<TestImplementation> tests,
java.util.Map<java.lang.String,java.lang.Object> settings)
Creates a new instance of a tester configuration. |
Method Summary | |
---|---|
java.lang.Object |
get(java.lang.String key)
|
static TesterConfiguration |
getConfiguration()
|
DecodedContentFactory |
getDecodedContentFactory()
Returns the decoded content factory to be used in this configuration of the Checker. |
java.util.List<ResourceExtractor> |
getResourceExtractors()
Returns the list of resource extractors to apply in this configuration of the Checker. |
ResourceRetrieverFactory |
getResourceRetrieverFactory()
Returns the resource retriever factory to be used in this configuration of the Checker. |
java.lang.String |
getString(java.lang.String key)
|
java.util.List<TestImplementation> |
getTests()
Returns the list of tests that should be run on the moki representation of the resource under test. |
static void |
setConfiguration(TesterConfiguration configuration)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String USERNAME
public static final java.lang.String PASSWORD
private static final java.lang.ThreadLocal<TesterConfiguration> perThreadConfiguration
private final ResourceRetrieverFactory resourceRetrieverFactory
The factory is used to create resource retrievers based on the scheme of the URI.
private final DecodedContentFactory decodedContentFactory
Used to map retrieved resources to the most appropriate
DecodedContent
implementation known in this configuration.
private final java.util.List<ResourceExtractor> extractors
private final java.util.List<TestImplementation> tests
moki
representation.
private final java.util.Map<java.lang.String,java.lang.Object> configurationMap
Constructor Detail |
---|
public TesterConfiguration(ResourceRetrieverFactory resourceRetrieverFactory, DecodedContentFactory decodedContentFactory, java.util.List<ResourceExtractor> extractors, java.util.List<TestImplementation> tests, java.util.Map<java.lang.String,java.lang.Object> settings)
resourceRetrieverFactory
- factory to use to create resource retrievers.decodedContentFactory
- factory to use to decode contentextractors
- list of resource extractors to usetests
- list of tests to apply on the moki representationsettings
- list of other settingsMethod Detail |
---|
public java.lang.Object get(java.lang.String key)
public java.lang.String getString(java.lang.String key)
public ResourceRetrieverFactory getResourceRetrieverFactory()
null
.public DecodedContentFactory getDecodedContentFactory()
null
.public java.util.List<ResourceExtractor> getResourceExtractors()
public java.util.List<TestImplementation> getTests()
public static void setConfiguration(TesterConfiguration configuration)
public static TesterConfiguration getConfiguration()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |