Class FileReporter
java.lang.Object
org.shakespeareframework.reporting.FileReporter
- All Implemented Interfaces:
QuestionReporter
,Reporter
,TaskReporter
Reporter
providing a method to write report files. Files will be placed under the reportsPath
and named counter
-actor
-reportType
-
task|question
.fileNameExtension
. E.g.: 003-regina-retry-is_logged_in.png
.-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
writeReport
(Actor actor, FileReporter.ReportType reportType, Object activity, 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
-
Constructor Details
-
FileReporter
- Parameters:
reportsPath
- path to the reports directory
-
-
Method Details
-
writeReport
protected void writeReport(Actor actor, FileReporter.ReportType reportType, Object activity, 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:
RuntimeException
- if creating thereportsPath
or writing the file fails
-