com.aventstack.extentreports.reporter

## Class BasicFileReporter

- java.lang.Object
- - com.aventstack.extentreports.reporter.ConfigurableReporter
  - - com.aventstack.extentreports.reporter.AbstractReporter
    - - com.aventstack.extentreports.reporter.BasicFileReporter

- All Implemented Interfaces:
    AnalysisStrategyService, ExtentReporter, TestListener
  Direct Known Subclasses:
    ExtentAventReporter, ExtentBDDReporter, ExtentCardsReporter, ExtentEmailReporter, ExtentHtmlReporter, ExtentLoggerReporter, ExtentTabularReporter

      public abstract class BasicFileReporter
      extends AbstractReporter

  A base class for all reporter types that generate an output file

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected String` | `destination`
    `protected String` | `filePath`
    `protected Map<String,Object>` | `templateMap`

    - ### Fields inherited from class com.aventstack.extentreports.reporter.AbstractReporter

      `endTime, levels, startTime`

    - ### Fields inherited from class com.aventstack.extentreports.reporter.ConfigurableReporter

      `configContext`

  - ### Constructor Summary

    Constructors
    Modifier | Constructor and Description
    --- | ---
    `protected` | `BasicFileReporter(File path)`
    `protected` | `BasicFileReporter(String path)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `containsStatus(Status status)`
    `boolean` | `containsStatus(String status)`
    `protected Boolean` | `enforceOfflineMode()`
    `void` | `flush(ReportAggregates reportAggregates)` Write to or update the target source (file, database)
    `TestAttributeTestContextProvider<Author>` | `getAuthorContextInfo()`
    `TestAttributeTestContextProvider<Category>` | `getCategoryContextInfo()`
    `TestAttributeTestContextProvider<Device>` | `getDeviceContextInfo()`
    `Date` | `getEndTime()`
    `ExceptionTestContextImpl` | `getExceptionContextInfo()`
    `File` | `getFileFile()`
    `String` | `getFilePath()`
    `protected freemarker.template.Configuration` | `getFreemarkerConfig()`
    `ReportStatusStats` | `getReportStatusStats()`
    `protected String` | `getSource()`
    `Date` | `getStartTime()`
    `List<Status>` | `getStatusList()`
    `SystemAttributeContext` | `getSystemAttributeContext()`
    `List<Test>` | `getTestList()`
    `List<String>` | `getTestRunnerLogs()`
    `protected void` | `init(String[] configFilePath, BasicFileConfiguration userConfig)`
    `protected void` | `loadUserConfig()`
    `void` | `onAuthorAssigned(Test test, Author author)` Invoked each time an author is assigned to any test/node
    `void` | `onCategoryAssigned(Test test, Category category)` Invoked each time a category is assigned to any test/node
    `void` | `onDeviceAssigned(Test test, Device device)` Invoked each time a device is assigned to any test/node
    `void` | `onLogAdded(Test test, Log log)` Invoked each time a log is added to any test/node
    `void` | `onNodeStarted(Test node)` Invoked when a node is started using `createNode()`
    `void` | `onScreenCaptureAdded(Log log, ScreenCapture screenCapture)` Invoked each time a screencapture is added to log
    `void` | `onScreenCaptureAdded(Test test, ScreenCapture screenCapture)` Invoked each time a screencapture is added to test
    `void` | `onScreencastAdded(Test test, Screencast screencast)` Invoked each time a screencast is added
    `void` | `onTestRemoved(Test test)` Invoked when a test is removed using `removeTest()`
    `void` | `onTestStarted(Test test)` Invoked when a test is started using `createTest()`
    `protected void` | `processTemplate(freemarker.template.Template template, File outputFile)`
    `protected void` | `setFilePath(String filePath)`
    `void` | `start()` Starts passing run information to the reporter
    `void` | `stop()` Stops the reporter.

    - ### Methods inherited from class com.aventstack.extentreports.reporter.AbstractReporter

      `getAnalysisStrategy, getLongRunDuration, getRunDuration, setAnalysisStrategy, setEndTime`

    - ### Methods inherited from class com.aventstack.extentreports.reporter.ConfigurableReporter

      `getConfigContext, loadConfig, loadConfig, loadConfig, loadXMLConfig, loadXMLConfig, loadXMLConfig`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface com.aventstack.extentreports.ExtentReporter

      `getReporterName`

- - ### Field Detail

    - #### filePath

          protected String filePath

    - #### destination

          protected String destination

    - #### templateMap

          protected Map<String,Object> templateMap

  - ### Constructor Detail

    - #### BasicFileReporter

          protected BasicFileReporter(String path)

    - #### BasicFileReporter

          protected BasicFileReporter(File path)

  - ### Method Detail

    - #### setFilePath

          protected void setFilePath(String filePath)

    - #### getFilePath

          public String getFilePath()

    - #### getFileFile

          public File getFileFile()

    - #### init

          protected void init(String[] configFilePath,
                              BasicFileConfiguration userConfig)

    - #### loadUserConfig

          protected void loadUserConfig()

    - #### start

          public void start()

      Description copied from interface: `ExtentReporter`
      Starts passing run information to the reporter

    - #### flush

          public void flush(ReportAggregates reportAggregates)

      Description copied from interface: `ExtentReporter`
      Write to or update the target source (file, database)
      Specified by:
        `flush` in interface `ExtentReporter`
      Overrides:
        `flush` in class `AbstractReporter`
      Parameters:
        `reportAggregates` - a `ReportAggregates` object

    - #### getTestList

          public List<Test> getTestList()

    - #### getTestRunnerLogs

          public List<String> getTestRunnerLogs()

    - #### getCategoryContextInfo

          public TestAttributeTestContextProvider<Category> getCategoryContextInfo()

    - #### getAuthorContextInfo

          public TestAttributeTestContextProvider<Author> getAuthorContextInfo()

    - #### getDeviceContextInfo

          public TestAttributeTestContextProvider<Device> getDeviceContextInfo()

    - #### getExceptionContextInfo

          public ExceptionTestContextImpl getExceptionContextInfo()

    - #### getSystemAttributeContext

          public SystemAttributeContext getSystemAttributeContext()

    - #### getReportStatusStats

          public ReportStatusStats getReportStatusStats()

    - #### getStatusList

          public List<Status> getStatusList()

      Overrides:
        `getStatusList` in class `AbstractReporter`

    - #### onTestStarted

          public void onTestStarted(Test test)

      Description copied from interface: `TestListener`
      Invoked when a test is started using `createTest()`
      Parameters:
        `test` - `Test` object

    - #### onTestRemoved

          public void onTestRemoved(Test test)

      Description copied from interface: `TestListener`
      Invoked when a test is removed using `removeTest()`
      Parameters:
        `test` - `Test` object

    - #### onNodeStarted

          public void onNodeStarted(Test node)

      Description copied from interface: `TestListener`
      Invoked when a node is started using `createNode()`
      Parameters:
        `node` - `Test` object

    - #### onLogAdded

          public void onLogAdded(Test test,
                                 Log log)

      Description copied from interface: `TestListener`
      Invoked each time a log is added to any test/node
      Parameters:
        `test` - `Test` object
        `log` - `Log` object

    - #### onCategoryAssigned

          public void onCategoryAssigned(Test test,
                                         Category category)

      Description copied from interface: `TestListener`
      Invoked each time a category is assigned to any test/node
      Parameters:
        `test` - `Test` object
        `category` - `Category` object

    - #### onAuthorAssigned

          public void onAuthorAssigned(Test test,
                                       Author author)

      Description copied from interface: `TestListener`
      Invoked each time an author is assigned to any test/node
      Parameters:
        `test` - `Test` object
        `author` - `Author` object

    - #### onDeviceAssigned

          public void onDeviceAssigned(Test test,
                                       Device device)

      Description copied from interface: `TestListener`
      Invoked each time a device is assigned to any test/node
      Parameters:
        `test` - `Test` object
        `device` - `Device` object

    - #### onScreenCaptureAdded

          public void onScreenCaptureAdded(Test test,
                                           ScreenCapture screenCapture)
                                    throws IOException

      Description copied from interface: `TestListener`
      Invoked each time a screencapture is added to test
      Parameters:
        `test` - `Test` object
        `screenCapture` - `ScreenCapture` object
      Throws:
        `IOException` - Exception thrown if the media object is not found

    - #### onScreenCaptureAdded

          public void onScreenCaptureAdded(Log log,
                                           ScreenCapture screenCapture)
                                    throws IOException

      Description copied from interface: `TestListener`
      Invoked each time a screencapture is added to log
      Parameters:
        `log` - `Log` object
        `screenCapture` - `ScreenCapture` object
      Throws:
        `IOException` - Exception thrown if the media object is not found

    - #### stop

          public void stop()

      Description copied from interface: `ExtentReporter`
      Stops the reporter. Ensures no information is passed to the reporter.

    - #### getStartTime

          public Date getStartTime()

      Overrides:
        `getStartTime` in class `AbstractReporter`

    - #### getEndTime

          public Date getEndTime()

      Overrides:
        `getEndTime` in class `AbstractReporter`

    - #### onScreencastAdded

          public void onScreencastAdded(Test test,
                                        Screencast screencast)
                                 throws IOException

      Description copied from interface: `TestListener`
      Invoked each time a screencast is added
      Parameters:
        `test` - `Test` object
        `screencast` - `Screencast` object
      Throws:
        `IOException` - Exception thrown if the media object is not found

    - #### containsStatus

          public boolean containsStatus(String status)

    - #### containsStatus

          public boolean containsStatus(Status status)

    - #### processTemplate

          protected void processTemplate(freemarker.template.Template template,
                                         File outputFile)
                                  throws freemarker.template.TemplateException,
                                         IOException

      Throws:
        `freemarker.template.TemplateException`
        `IOException`

    - #### getSource

          protected String getSource()

    - #### getFreemarkerConfig

          protected freemarker.template.Configuration getFreemarkerConfig()

    - #### enforceOfflineMode

          protected Boolean enforceOfflineMode()

Copyright © 2018. All rights reserved.