Class JsonReport
java.lang.Object
com.carrotsearch.ant.tasks.junit4.listeners.json.JsonReport
- All Implemented Interfaces:
AggregatedEventListener
A report listener that produces a single JSON file for all suites and tests.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private JsonWriter
private JUnit4
private JsonReport.OutputMethod
How should the report be written?private boolean
private String
private Map
<Integer, ForkedJvmInfo> private File
private OutputStreamWriter
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate void
copyScaffolding
(File targetFile) Copy HTML/JS/CSS scaffolding to a targetFile's directory.private String
Return the project name or the default project name.void
All tests completed.void
Emit information about a single suite and all of its tests.private String
removeExtension
(String name) void
Output file for the report file.void
setJsonpMethod
(String method) Sets wrapper method name for JSONP.void
Link to the container.void
setOutputStreams
(boolean outputStreams) Include output streams? Mind that with large outputs the report may OOM.void
setProjectName
(String projectName) Set project name for the output model.
-
Field Details
-
junit4
-
targetFile
-
jsonpMethod
-
jsonWriter
-
projectName
-
slaves
-
writer
-
method
How should the report be written? -
outputStreams
private boolean outputStreams- See Also:
-
-
Constructor Details
-
JsonReport
public JsonReport()
-
-
Method Details
-
setFile
Output file for the report file. The name of the output file will also trigger how the report is written. If the name of the output file ends with ".htm(l)?" then the output file is a HTML file and CSS/JS scaffolding is also written to visualize the JSON model. If the name of the file ends with ".json(p)?" a JSON file is written. -
setJsonpMethod
Sets wrapper method name for JSONP. If set to non-empty value, will change the output format to JSONP. The name of the JSONP function for the HTML wrapper must be "testData".- See Also:
-
setProjectName
Set project name for the output model. -
setOutputStreams
public void setOutputStreams(boolean outputStreams) Include output streams? Mind that with large outputs the report may OOM. -
setOuter
Description copied from interface:AggregatedEventListener
Link to the container. Listener can throwBuildException
if parameter validation doesn't succeed, for example.- Specified by:
setOuter
in interfaceAggregatedEventListener
-
removeExtension
-
getProjectName
Return the project name or the default project name. -
onSuiteResult
Emit information about a single suite and all of its tests. -
onQuit
All tests completed. -
copyScaffolding
Copy HTML/JS/CSS scaffolding to a targetFile's directory.- Throws:
IOException
-