Class FileReporter
- java.lang.Object
-
- org.shakespeareframework.reporting.FileReporter
-
- All Implemented Interfaces:
QuestionReporter
,Reporter
,TaskReporter
public abstract class FileReporter extends java.lang.Object implements Reporter
Reporter
providing a method to write report files. Files will be placed under thereportsPath
and namedcounter
-actor
-reportType
-task|question
.fileNameExtension
. E.g.:003-regina-retry-is_logged_in.png
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileReporter.ReportType
Possible types of reports.
-
Constructor Summary
Constructors Modifier Constructor Description protected
FileReporter(java.nio.file.Path reportsPath)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
writeReport(Actor actor, FileReporter.ReportType reportType, java.lang.Object activity, java.lang.String fileNameExtension, byte[] content)
Writes the given content to a new file in thereportsPath
.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.shakespeareframework.reporting.QuestionReporter
failure, failure, retry, retry, start, success
-
Methods inherited from interface org.shakespeareframework.reporting.TaskReporter
failure, retry, start, success
-
-
-
-
Method Detail
-
writeReport
protected void writeReport(Actor actor, FileReporter.ReportType reportType, java.lang.Object activity, java.lang.String fileNameExtension, byte[] content)
Writes the given content to a new file in thereportsPath
. ThereportsPath
is automatically created if necessary.The filename will be structured as follows:
[increased
counter
with leading zeros]-[actor.name
]- [reportType
]-[activity].[fileNameExtension]E.g.
001-fiona-start-some_question.txt
- Parameters:
actor
- the actingActor
reportType
- theFileReporter.ReportType
activity
- theTask
orQuestion
this report is about.fileNameExtension
- The file name extension for the report filecontent
- the content to write- Throws:
java.lang.RuntimeException
- if creating thereportsPath
or writing the file fails
-
-