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 Stringprivate JsonWriterprivate JUnit4private JsonReport.OutputMethodHow should the report be written?private booleanprivate Stringprivate Map<Integer, ForkedJvmInfo> private Fileprivate OutputStreamWriter -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidcopyScaffolding(File targetFile) Copy HTML/JS/CSS scaffolding to a targetFile's directory.private StringReturn the project name or the default project name.voidAll tests completed.voidEmit information about a single suite and all of its tests.private StringremoveExtension(String name) voidOutput file for the report file.voidsetJsonpMethod(String method) Sets wrapper method name for JSONP.voidLink to the container.voidsetOutputStreams(boolean outputStreams) Include output streams? Mind that with large outputs the report may OOM.voidsetProjectName(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:AggregatedEventListenerLink to the container. Listener can throwBuildExceptionif parameter validation doesn't succeed, for example.- Specified by:
setOuterin 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
-