org.daisy.zedval.engine
Class ZedContext

java.lang.Object
  extended byorg.daisy.zedval.engine.ZedContext
Direct Known Subclasses:
DefaultContext

public class ZedContext
extends java.lang.Object

Encapsulates run-time context information

This can be subclassed to provide more context information

Author:
James Pritchett, Daniel Carlsson

Field Summary
static java.lang.String ENGINE_VERSION
           
 
Constructor Summary
ZedContext(java.lang.String appName, java.lang.String appVersion)
           
 
Method Summary
 java.lang.String getAppName()
          Returns the application name
 java.lang.String getAppVersion()
          Returns the application version number
 PackageFile getPackageFile()
           
 ZedMap getProcessorMap()
          Returns the processor map file used in this run
 ZedReporter getReporter()
          Returns the ZedReporter instance for this run
 java.lang.String getSpecYear()
           
 ZedMap getTestMap()
          Returns the test map file used in this run
 java.util.LinkedHashMap getTestProcessors()
          Gets the list of test processors to use in this run
 java.util.LinkedHashMap getTests()
          Gets the list of tests to use in this run
 void loadPackageFile(java.lang.String fullPath)
          Creates and initializes a PackageFile object for this run
 void loadProcessorMap(java.lang.String fullPath)
          Creates and initializes a processor map MapFile object for this run
 void loadProcessorMap(java.net.URL url)
           
 void loadReporter(java.lang.String className)
          Creates a ZedReporter object for this run
 void loadTestMap(java.lang.String fullPath)
          Creates and initializes a test map MapFile object for this run
 void loadTestMap(java.net.URL url)
          Creates and initializes a test map MapFile object for this run
 java.util.LinkedHashMap loadTestProcessors()
          Instantiates all applicable test processors based on list of tests and processor map Note: setTests() or loadTests() must be called before this method
 java.util.LinkedHashMap loadTests()
          Instantiates all applicable tests based on contents of package file and test map
 void printTests()
          Prints the entire list of tests to stdout
 void setPackageFile(PackageFile p)
          Sets the package file for this run
 void setProcessorMap(ZedMap pm)
          Sets the processor map file for this run
 void setReporter(ZedReporter r)
          Sets the reporter for this run
 void setTestMap(ZedMap tm)
          Sets the test map file for this run
 void setTestProcessors(java.util.LinkedHashMap tp)
          Sets the list of test processors to use in this run
 void setTests(java.util.LinkedHashMap t)
          Sets the list of tests to use in this run
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ENGINE_VERSION

public static final java.lang.String ENGINE_VERSION
See Also:
Constant Field Values
Constructor Detail

ZedContext

public ZedContext(java.lang.String appName,
                  java.lang.String appVersion)
Parameters:
appName - The name of the application being run
appVersion - The version number of the application being run
Method Detail

loadPackageFile

public void loadPackageFile(java.lang.String fullPath)
                     throws ZedFileInitializationException
Creates and initializes a PackageFile object for this run

Parameters:
fullPath - The full path (including name) of the package file to load
Throws:
ZedFileInitializationException

setPackageFile

public void setPackageFile(PackageFile p)
Sets the package file for this run

Parameters:
p - The PackageFile object for this run

getPackageFile

public PackageFile getPackageFile()
Returns:
The PackageFile object for this run

loadTestMap

public void loadTestMap(java.lang.String fullPath)
                 throws ZedFileInitializationException
Creates and initializes a test map MapFile object for this run

Parameters:
fullPath - The full path (including name) of the test map file to load
Throws:
ZedFileInitializationException

loadTestMap

public void loadTestMap(java.net.URL url)
                 throws ZedFileInitializationException
Creates and initializes a test map MapFile object for this run

Parameters:
url - URL of the test map file to load
Throws:
ZedFileInitializationException

setTestMap

public void setTestMap(ZedMap tm)
Sets the test map file for this run

Parameters:
tm - The test map ZedMao object for this run

getTestMap

public ZedMap getTestMap()
Returns the test map file used in this run

Returns:
the test map MapFile object used in this run

loadProcessorMap

public void loadProcessorMap(java.lang.String fullPath)
                      throws ZedFileInitializationException
Creates and initializes a processor map MapFile object for this run

Parameters:
fullPath - The full path (including name) of the processor map file to load
Throws:
ZedFileInitializationException

loadProcessorMap

public void loadProcessorMap(java.net.URL url)
                      throws ZedFileInitializationException
Throws:
ZedFileInitializationException

setProcessorMap

public void setProcessorMap(ZedMap pm)
Sets the processor map file for this run

Parameters:
pm - The processor map MapFile object for this run

getProcessorMap

public ZedMap getProcessorMap()
Returns the processor map file used in this run

Returns:
the processor map MapFile used in this run

loadReporter

public void loadReporter(java.lang.String className)
                  throws ZedContextException
Creates a ZedReporter object for this run

Parameters:
className - The name of the ZedReporter implementation class to use
Throws:
ZedContextException

setReporter

public void setReporter(ZedReporter r)
Sets the reporter for this run

Parameters:
r - The ZedReporter object for this run

getReporter

public ZedReporter getReporter()
Returns the ZedReporter instance for this run

Returns:
The ZedReporter instance for this run

loadTestProcessors

public java.util.LinkedHashMap loadTestProcessors()
                                           throws ZedContextException
Instantiates all applicable test processors based on list of tests and processor map

Note: setTests() or loadTests() must be called before this method

Returns:
LinkedHashMap of ZedTestProcessors created (key = id)
Throws:
ZedContextException

setTestProcessors

public void setTestProcessors(java.util.LinkedHashMap tp)
Sets the list of test processors to use in this run

Parameters:
tp - LinkedHashMap of ZedTestProcessor objects to use in this run (key = id)

getTestProcessors

public java.util.LinkedHashMap getTestProcessors()
Gets the list of test processors to use in this run

Returns:
LinkedHashMap of ZedTestProcessor objects to use in this run (key = id)

loadTests

public java.util.LinkedHashMap loadTests()
                                  throws ZedContextException
Instantiates all applicable tests based on contents of package file and test map

Returns:
LinkedHashMap of ZedTests created (key = id)
Throws:
ZedContextException

setTests

public void setTests(java.util.LinkedHashMap t)
Sets the list of tests to use in this run

Parameters:
t - LinkedHashMap of ZedTest objects to use in this run (key = id)

getTests

public java.util.LinkedHashMap getTests()
Gets the list of tests to use in this run

Returns:
LinkedHashMap of ZedTest objects to use in this run (key = id)

printTests

public void printTests()
Prints the entire list of tests to stdout


getAppName

public java.lang.String getAppName()
Returns the application name

Returns:
the application name

getAppVersion

public java.lang.String getAppVersion()
Returns the application version number

Returns:
the application version number

getSpecYear

public java.lang.String getSpecYear()

toString

public java.lang.String toString()