org.easetech.easytest.util
Class RunAftersWithOutputData

java.lang.Object
  extended by org.junit.runners.model.Statement
      extended by org.easetech.easytest.util.RunAftersWithOutputData

public class RunAftersWithOutputData
extends org.junit.runners.model.Statement

An extension of RunAfters method to write the test data to the file at the end of executing all the test methods in the test cases. This class also encapsulates the logic of running the reports after the test execution. The reports are run asynchronously so that the Test cases do not get halted for the expensive run of the reports.


Field Summary
protected static org.slf4j.Logger LOG
          An instance of logger associated with the test framework.
 
Constructor Summary
RunAftersWithOutputData(org.junit.runners.model.Statement next, List<org.junit.runners.model.FrameworkMethod> afters, Object target, List<TestInfo> testInfoList, Map<String,List<Map<String,Object>>> writableData, ReportDataContainer testReportContainer)
          Construct a new RunAftersWithOutputData
 
Method Summary
 void evaluate()
          Evaluate all the test methods and then finally run all the afterClass methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected static final org.slf4j.Logger LOG
An instance of logger associated with the test framework.

Constructor Detail

RunAftersWithOutputData

public RunAftersWithOutputData(org.junit.runners.model.Statement next,
                               List<org.junit.runners.model.FrameworkMethod> afters,
                               Object target,
                               List<TestInfo> testInfoList,
                               Map<String,List<Map<String,Object>>> writableData,
                               ReportDataContainer testReportContainer)
Construct a new RunAftersWithOutputData

Parameters:
next - the instance of Statement object
afters - the list of FrameworkMethod that needs to be run after all the methods in the test class have been executed.
target - the target instance of the class. In this case it will always be null since methods with AfterClass are always declared as static.
testInfoList - the list of TestInfo containing information required to write data back to the file.
writableData - the writable data that needs to be written to the file.
testReportContainer - a container class representing everything required to generate reports
Method Detail

evaluate

public void evaluate()
              throws Throwable
Evaluate all the test methods and then finally run all the afterClass methods. Before afterClass annotated methods are executed, we start the asynchronous processing of the reports. This will save us some time in case the afterClass annotation on the client does some process intensive tasks.

Specified by:
evaluate in class org.junit.runners.model.Statement
Throws:
Throwable
See Also:
RunAfters#evaluate()}


Copyright © 2013. All Rights Reserved.