com.carrotsearch.ant.tasks.junit4.listeners.json
Class JsonReport

java.lang.Object
  extended by com.carrotsearch.ant.tasks.junit4.listeners.json.JsonReport
All Implemented Interfaces:
AggregatedEventListener

public class JsonReport
extends Object
implements AggregatedEventListener

A report listener that produces a single JSON file for all suites and tests.


Constructor Summary
JsonReport()
           
 
Method Summary
 void onQuit(AggregatedQuitEvent e)
          All tests completed.
 void onSuiteResult(AggregatedSuiteResultEvent e)
          Emit information about a single suite and all of its tests.
 void setFile(File file)
          Output file for the report file.
 void setJsonpMethod(String method)
          Sets wrapper method name for JSONP.
 void setOuter(JUnit4 junit4)
          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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JsonReport

public JsonReport()
Method Detail

setFile

public void setFile(File file)
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

public void setJsonpMethod(String method)
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:
"http://en.wikipedia.org/wiki/JSONP"

setProjectName

public void setProjectName(String projectName)
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

public void setOuter(JUnit4 junit4)
Description copied from interface: AggregatedEventListener
Link to the container. Listener can throw BuildException if parameter validation doesn't succeed, for example.

Specified by:
setOuter in interface AggregatedEventListener

onSuiteResult

public void onSuiteResult(AggregatedSuiteResultEvent e)
Emit information about a single suite and all of its tests.


onQuit

public void onQuit(AggregatedQuitEvent e)
All tests completed.



Copyright © 2011-2012 Carrot Search s.c.. All Rights Reserved.