Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.milligan.eccles
Class EcclesRunner  view EcclesRunner download EcclesRunner.java

java.lang.Object
  extended byjunit.framework.Assert
      extended byjunit.framework.TestCase
          extended byorg.milligan.eccles.EcclesRunner
All Implemented Interfaces:
junit.framework.Test

public class EcclesRunner
extends junit.framework.TestCase

Main execution class


Field Summary
protected static java.lang.String DEFAULT_PARSER_NAME
          Default parser name.
protected  java.util.Map globalTags
          Map of top level test Ids to tags
protected  boolean hasFailed
          Flag saying whether the test has 'failed' anywhere.
protected  java.lang.String junitFailureMessage
          Error string to report to JUnit if hasFailed==true
(package private)  junit.framework.TestResult junitResults
           
protected static org.apache.log4j.Category log
           
protected static java.lang.String NAMESPACES_FEATURE_ID
          Namespaces feature id (http://xml.org/sax/features/namespaces).
protected static java.lang.String NO_NAMESPACE_SCHEMA_PROPERTY_ID
          name of schema file
protected  java.io.File outFile
          File reference to outputfile
protected  java.io.FileWriter outFileWriter
          Output report file.
protected  org.w3c.dom.Document outputDocument
          Document node for report output
protected  EcclesRunnerParameters parameters
          Parameters for this run
protected  java.util.HashMap reportTypeMap
          Map of report types
protected static java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
          Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).
protected static java.lang.String SCHEMA_VALIDATION_FEATURE_ID
          Schema validation feature id (http://apache.org/xml/features/validation/schema).
protected static java.lang.String VALIDATION_FEATURE_ID
          Validation feature id (http://xml.org/sax/features/validation).
 
Fields inherited from class junit.framework.TestCase
 
Constructor Summary
EcclesRunner(java.lang.String name)
           
EcclesRunner(java.lang.String name, EcclesRunnerParameters params)
           
 
Method Summary
 void addChildTag(Tag tag)
           
protected  void addDigesterTagConfig(org.apache.commons.digester.Digester digester, java.lang.String tagname, java.lang.String type)
          Add a simply configured tag config to the digester
 void addReportType(ReportType type)
          Add a new report type to the system
 Tag getGlobalTag(java.lang.String id)
          get a top level tag from the map
 org.w3c.dom.Document getOutputDocument()
          Retireve the root xml document
 EcclesRunnerParameters getParameters()
          Get the running parameters
 java.util.Map getReportTypeMap()
          Get a map of all registered report types
 boolean initialiseOutput(java.lang.String outputDirectory)
          create the output directory & initial xml file
protected  void initReportTypeMap()
          Initialise the report type map with the default entries
static void main(java.lang.String[] args)
          Main function for when executed from command line
protected  org.apache.commons.digester.Digester prepareDigester()
          Return an apache commons digester prepared for business :-)
 void processStylesheet()
          Process any requested stylesheet
 void run(junit.framework.TestResult results)
          Runs the test case and collects the results in TestResult.
 void setFailed()
          Indicates that at the end of the test run a JUnit failure will be reported
 void setParameters(EcclesRunnerParameters parameters)
          Set the running parameters
 void testEccles()
          Run tests, process xsl
 void writeResults()
           
 
Methods inherited from class junit.framework.TestCase
countTestCases, createResult, getName, run, runBare, runTest, setName, setUp, tearDown, toString
 
Methods inherited from class junit.framework.Assert
assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertEquals, assertFalse, assertFalse, assertNotNull, assertNotNull, assertNotSame, assertNotSame, assertNull, assertNull, assertSame, assertSame, assertTrue, assertTrue, fail, fail
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

log

protected static final org.apache.log4j.Category log

globalTags

protected java.util.Map globalTags
Map of top level test Ids to tags


NAMESPACES_FEATURE_ID

protected static final java.lang.String NAMESPACES_FEATURE_ID
Namespaces feature id (http://xml.org/sax/features/namespaces).

See Also:
Constant Field Values

VALIDATION_FEATURE_ID

protected static final java.lang.String VALIDATION_FEATURE_ID
Validation feature id (http://xml.org/sax/features/validation).

See Also:
Constant Field Values

SCHEMA_VALIDATION_FEATURE_ID

protected static final java.lang.String SCHEMA_VALIDATION_FEATURE_ID
Schema validation feature id (http://apache.org/xml/features/validation/schema).

See Also:
Constant Field Values

SCHEMA_FULL_CHECKING_FEATURE_ID

protected static final java.lang.String SCHEMA_FULL_CHECKING_FEATURE_ID
Schema full checking feature id (http://apache.org/xml/features/validation/schema-full-checking).

See Also:
Constant Field Values

DEFAULT_PARSER_NAME

protected static final java.lang.String DEFAULT_PARSER_NAME
Default parser name.

See Also:
Constant Field Values

NO_NAMESPACE_SCHEMA_PROPERTY_ID

protected static final java.lang.String NO_NAMESPACE_SCHEMA_PROPERTY_ID
name of schema file

See Also:
Constant Field Values

outputDocument

protected org.w3c.dom.Document outputDocument
Document node for report output


parameters

protected EcclesRunnerParameters parameters
Parameters for this run


outFileWriter

protected java.io.FileWriter outFileWriter
Output report file. Created at the beginning just in case the user cocks up the directory name


outFile

protected java.io.File outFile
File reference to outputfile


reportTypeMap

protected java.util.HashMap reportTypeMap
Map of report types


hasFailed

protected boolean hasFailed
Flag saying whether the test has 'failed' anywhere. If true will report failure to JUnit


junitFailureMessage

protected java.lang.String junitFailureMessage
Error string to report to JUnit if hasFailed==true


junitResults

junit.framework.TestResult junitResults
Constructor Detail

EcclesRunner

public EcclesRunner(java.lang.String name)

EcclesRunner

public EcclesRunner(java.lang.String name,
                    EcclesRunnerParameters params)
Method Detail

main

public static void main(java.lang.String[] args)
Main function for when executed from command line


addDigesterTagConfig

protected void addDigesterTagConfig(org.apache.commons.digester.Digester digester,
                                    java.lang.String tagname,
                                    java.lang.String type)
Add a simply configured tag config to the digester


prepareDigester

protected org.apache.commons.digester.Digester prepareDigester()
Return an apache commons digester prepared for business :-)


run

public void run(junit.framework.TestResult results)
Description copied from class: junit.framework.TestCase
Runs the test case and collects the results in TestResult.


testEccles

public void testEccles()
Run tests, process xsl


addChildTag

public void addChildTag(Tag tag)
                 throws EcclesException

getGlobalTag

public Tag getGlobalTag(java.lang.String id)
get a top level tag from the map


initialiseOutput

public boolean initialiseOutput(java.lang.String outputDirectory)
create the output directory & initial xml file


writeResults

public void writeResults()

getOutputDocument

public org.w3c.dom.Document getOutputDocument()
Retireve the root xml document


getReportTypeMap

public java.util.Map getReportTypeMap()
Get a map of all registered report types


initReportTypeMap

protected void initReportTypeMap()
Initialise the report type map with the default entries


addReportType

public void addReportType(ReportType type)
Add a new report type to the system


getParameters

public EcclesRunnerParameters getParameters()
Get the running parameters


setParameters

public void setParameters(EcclesRunnerParameters parameters)
Set the running parameters


processStylesheet

public void processStylesheet()
Process any requested stylesheet


setFailed

public void setFailed()
Indicates that at the end of the test run a JUnit failure will be reported