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
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidwriteReport(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, waitMethods inherited from interface org.shakespeareframework.reporting.QuestionReporter
failure, failure, retry, retry, start, successMethods 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. ThereportsPathis automatically created if necessary.The filename will be structured as follows:
[increasedcounterwith leading zeros]-[actor.name]- [reportType]-[activity].[fileNameExtension]E.g.
001-fiona-start-some_question.txt- Parameters:
actor- the actingActorreportType- theFileReporter.ReportTypeactivity- theTaskorQuestionthis report is about.fileNameExtension- The file name extension for the report filecontent- the content to write- Throws:
RuntimeException- if creating thereportsPathor writing the file fails
-