com.googlecode.lightest.core
Class ReporterInvoker

java.lang.Object
  extended by com.googlecode.lightest.core.LightestReporter
      extended by com.googlecode.lightest.core.ReporterInvoker
All Implemented Interfaces:
ILightestReporter, ITestRegistryAcceptor, groovy.lang.GroovyObject, IReporter, ITestNGListener

public class ReporterInvoker
extends LightestReporter
implements groovy.lang.GroovyObject, IReporter, ITestRegistryAcceptor

Applies the composite pattern to a group of reporters.


Field Summary
 
Fields inherited from class com.googlecode.lightest.core.LightestReporter
DEFAULT_COOLDOWN_FACTOR
 
Constructor Summary
ReporterInvoker()
           
ReporterInvoker(SystemWrapper system)
           
 
Method Summary
 void generateBaseReport(TestRegistry testRegistry, String outputDir)
          No-op.
 void generateReport(List xmlSuites, List suites, String outputDirectory)
           
 groovy.lang.MetaClass getMetaClass()
           
 Object getProperty(String name)
           
 TestRegistry getRegistry()
          Return the registry currently set on the object.
 Object invokeMethod(String name, Object args)
           
 void registerReporter(ILightestReporter reporter)
           
protected  void runUpdateAndScheduleCooldown(ILightestReporter reporter, ISuite suite, TestRegistry testRegistry, String outputDir)
          Runs the reporter's update method, and updates the scheduled cooldown mapping to reflect the next time this method is allowed to run.
protected  void runUpdateAndScheduleCooldown(ILightestReporter reporter, LightestTestResult result, TestRegistry testRegistry, List xmlSuites, List suites, String outputDir)
           
protected  void scheduleUpdate(ILightestReporter reporter, ISuite suite, TestRegistry testRegistry, String outputDir)
           
protected  void scheduleUpdate(ILightestReporter reporter, LightestTestResult result, TestRegistry testRegistry, List xmlSuites, List suites, String outputDir)
           
 void setConfigText(String configText)
          Sets the textual configuration used to configure this run.
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setProperty(String name, Object value)
           
 void setRegistry(TestRegistry value)
          Set the registry on the object.
 void updateReport(ISuite suite, TestRegistry testRegistry, String outputDir)
          Scheduled ILightestReporter's are treated differently here.
 void updateReport(LightestTestResult result, TestRegistry testRegistry, List xmlSuites, List suites, String outputDir)
          Scheduled IScheduledReporter's are treated differently here.
 
Methods inherited from class com.googlecode.lightest.core.LightestReporter
getConfigText, getCooldownFactor, getScheduled, isScheduled, onUpdateDeferred, setCooldownFactor, setScheduled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReporterInvoker

public ReporterInvoker()

ReporterInvoker

public ReporterInvoker(SystemWrapper system)
Method Detail

getRegistry

public TestRegistry getRegistry()
Description copied from interface: ITestRegistryAcceptor
Return the registry currently set on the object.

Specified by:
getRegistry in interface ITestRegistryAcceptor

setRegistry

public void setRegistry(TestRegistry value)
Description copied from interface: ITestRegistryAcceptor
Set the registry on the object.

Specified by:
setRegistry in interface ITestRegistryAcceptor

registerReporter

public void registerReporter(ILightestReporter reporter)
Parameters:
reporter - may additionally implement IReporter

scheduleUpdate

protected void scheduleUpdate(ILightestReporter reporter,
                              ISuite suite,
                              TestRegistry testRegistry,
                              String outputDir)

scheduleUpdate

protected void scheduleUpdate(ILightestReporter reporter,
                              LightestTestResult result,
                              TestRegistry testRegistry,
                              List xmlSuites,
                              List suites,
                              String outputDir)

runUpdateAndScheduleCooldown

protected void runUpdateAndScheduleCooldown(ILightestReporter reporter,
                                            ISuite suite,
                                            TestRegistry testRegistry,
                                            String outputDir)
Runs the reporter's update method, and updates the scheduled cooldown mapping to reflect the next time this method is allowed to run. The cooldown time adapts as a factor of the runtime of the report update.

Parameters:
reporter -
suite -
result -
testRegistry -
outputDir -

runUpdateAndScheduleCooldown

protected void runUpdateAndScheduleCooldown(ILightestReporter reporter,
                                            LightestTestResult result,
                                            TestRegistry testRegistry,
                                            List xmlSuites,
                                            List suites,
                                            String outputDir)

setConfigText

public void setConfigText(String configText)
Sets the textual configuration used to configure this run.

Specified by:
setConfigText in interface ILightestReporter
Overrides:
setConfigText in class LightestReporter
Parameters:
configText - the textual configuration, or null

generateBaseReport

public void generateBaseReport(TestRegistry testRegistry,
                               String outputDir)
No-op.

Specified by:
generateBaseReport in interface ILightestReporter
Overrides:
generateBaseReport in class LightestReporter
Parameters:
testRegistry - the registry contains all known information about pending tests.

updateReport

public void updateReport(ISuite suite,
                         TestRegistry testRegistry,
                         String outputDir)
Scheduled ILightestReporter's are treated differently here. Their report generation may be deferred.

Specified by:
updateReport in interface ILightestReporter
Overrides:
updateReport in class LightestReporter
Parameters:
suite - the suite that is about to run
testRegistry - the registry contains all known information about pending and completed tests

updateReport

public void updateReport(LightestTestResult result,
                         TestRegistry testRegistry,
                         List xmlSuites,
                         List suites,
                         String outputDir)
Scheduled IScheduledReporter's are treated differently here. Their report generation may be deferred.

Specified by:
updateReport in interface ILightestReporter
Overrides:
updateReport in class LightestReporter
Parameters:
result - the result for which to update the report.
testRegistry - the registry contains all known information about pending and completed tests

generateReport

public void generateReport(List xmlSuites,
                           List suites,
                           String outputDirectory)
Specified by:
generateReport in interface IReporter

getMetaClass

public groovy.lang.MetaClass getMetaClass()
Specified by:
getMetaClass in interface groovy.lang.GroovyObject
Overrides:
getMetaClass in class LightestReporter

setMetaClass

public void setMetaClass(groovy.lang.MetaClass metaClass)
Specified by:
setMetaClass in interface groovy.lang.GroovyObject
Overrides:
setMetaClass in class LightestReporter

invokeMethod

public Object invokeMethod(String name,
                           Object args)
Specified by:
invokeMethod in interface groovy.lang.GroovyObject
Overrides:
invokeMethod in class LightestReporter

getProperty

public Object getProperty(String name)
Specified by:
getProperty in interface groovy.lang.GroovyObject
Overrides:
getProperty in class LightestReporter

setProperty

public void setProperty(String name,
                        Object value)
Specified by:
setProperty in interface groovy.lang.GroovyObject
Overrides:
setProperty in class LightestReporter


Copyright © 2009. All Rights Reserved.