Skip to content

EasyTest : Reporting

Anuj Kumar edited this page Nov 25, 2013 · 6 revisions

There are two ways to generate reports for the individual unit tests:

  1. using the @Report annotation
  2. using command line parameters

1. @Report annotation

Reports can be generated by adding the @Report annotation at class level
E.g.
@Report(outputFormats={Report.EXPORT_FORMAT.PDF, Report.EXPORT_FORMAT.XLS}, reportTypes={Report.REPORT_TYPE.DEFAULT, Report.REPORT_TYPE.METHOD_DURATION}, outputLocation="classpath:org/easetech/easytest/reports")

Output formats are: PDF, HTML, XLS (optional, default is PDF)
Report types are: DEFAULT, METHOD_DURATION (optional, default is default)
DEFAULT report is the original report that EasyTest used to generate. This report gives an idea of how many tests ran per class, with what input and output parameters did the tests run, what tests failed and what tests passed etc.

METHOD_DURATION report is more detailed and capture tha max, min, avg duration a test method took to execute and how many time a given test method was executed. The report is depicted as a Bar graph with a table that lists the avg, min and max time a test method took. Output location: for exporting to a classpath use: classpath:, for exporting to a disk location use: file: (e.g. file:c:\reporting) (optional, default is local location)

2. Command line parameters

-Dreports.generate : generates reports
-Dreports.format=pdf : report output is pdf, (optional, default=pdf). Comma separated, valid value is e.g. pdf,xls
-Dreports.type=default : report type is main report, (optional, default=default). Comma separated, valid value is default,method_duration. The default report makes a generic report, the method duration report shows the duration that the unit tests have taken.
-Dreports.location=classpath:org/easetech/easytest/output : (optional, default="" current folder). (e.g. file:c:\temp is supported as well)