com.googlecode.lightest.core
Class LightestReporterAdapter

java.lang.Object
  extended by com.googlecode.lightest.core.LightestReporter
      extended by com.googlecode.lightest.core.LightestReporterAdapter
All Implemented Interfaces:
ILightestReporter, ITestRegistryAcceptor, groovy.lang.GroovyObject, IReporter, ITestNGListener
Direct Known Subclasses:
FailedReporterDecorator

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

An IReporter decorator that 1) enables generateReport() to be invoked as an update, rather than a one-time call; and 2) enables the update to be scheduled with a cooldown, rather than always invoked immediately when the update method is called.


Field Summary
 
Fields inherited from class com.googlecode.lightest.core.LightestReporter
DEFAULT_COOLDOWN_FACTOR
 
Constructor Summary
LightestReporterAdapter(IReporter delegate)
           
 
Method Summary
 void generateReport(List xmlSuites, List suites, String outputDirectory)
           
 IReporter getDelegate()
           
 groovy.lang.MetaClass getMetaClass()
           
 Object getProperty(String name)
           
 TestRegistry getRegistry()
          Return the registry currently set on the object.
 boolean getUpdateEnabled()
           
 Object invokeMethod(String name, Object args)
           
 boolean isUpdateEnabled()
           
 void setMetaClass(groovy.lang.MetaClass metaClass)
           
 void setProperty(String name, Object value)
           
 void setRegistry(TestRegistry value)
          Set the registry on the object.
 void setUpdateEnabled(boolean value)
           
 void updateReport(LightestTestResult result, TestRegistry testRegistry, List xmlSuites, List suites, String outputDirectory)
          Invokes the generateReport() method on the delegate, but only if updateEnabled is true.
 
Methods inherited from class com.googlecode.lightest.core.LightestReporter
generateBaseReport, getConfigText, getCooldownFactor, getScheduled, isScheduled, onUpdateDeferred, setConfigText, setCooldownFactor, setScheduled, updateReport
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LightestReporterAdapter

public LightestReporterAdapter(IReporter delegate)
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

getUpdateEnabled

public boolean getUpdateEnabled()

isUpdateEnabled

public boolean isUpdateEnabled()

setUpdateEnabled

public void setUpdateEnabled(boolean value)

getDelegate

public IReporter getDelegate()

updateReport

public void updateReport(LightestTestResult result,
                         TestRegistry testRegistry,
                         List xmlSuites,
                         List suites,
                         String outputDirectory)
Invokes the generateReport() method on the delegate, but only if updateEnabled is true. If the delegate implements ITestRegistryAcceptor, the testRegistry will be set for it.

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.