Class AntXmlReport
- java.lang.Object
-
- com.carrotsearch.ant.tasks.junit4.listeners.antxml.AntXmlReport
-
- All Implemented Interfaces:
AggregatedEventListener
public class AntXmlReport extends java.lang.Object implements AggregatedEventListener
A report listener that produces XML files compatible with those produced by ANT's defaultjunit
task. These files do not include full information but many tools can parse them.
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
dir
private java.util.List<org.apache.tools.ant.filters.TokenFilter>
filters
private boolean
ignoreDuplicateSuites
private JUnit4
junit4
private boolean
mavenExtensions
private boolean
outputStreams
private java.util.Map<java.lang.String,java.lang.Integer>
suiteCounts
private java.io.File
summaryFile
private TestsSummaryEventListener
summaryListener
-
Constructor Summary
Constructors Constructor Description AntXmlReport()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addConfiguredTokenFilter(org.apache.tools.ant.filters.TokenFilter filter)
Adds method name filter.private java.lang.String
applyFilters(java.lang.String methodName)
Apply filters to a method name.private TestSuiteModel
buildModel(AggregatedSuiteResultEvent e)
Build data model for serialization.private FailureModel
buildModel(FailureMirror f)
private java.util.List<TestCaseModel>
buildModel(java.util.List<AggregatedTestResultEvent> testEvents)
private java.util.List<PropertyModel>
buildModel(java.util.Map<java.lang.String,java.lang.String> properties)
void
onQuit(AggregatedQuitEvent e)
Write the summary file, if requested.void
onSuiteResult(AggregatedSuiteResultEvent e)
Emit information about all of suite's tests.void
setDir(java.io.File dir)
Output directory to write reports to.void
setIgnoreDuplicateSuites(boolean ignoreDuplicateSuites)
Ignore duplicate suite names.void
setMavenExtensions(boolean mavenExtensions)
Emit maven elements in the XML (extensions compared to ANT).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
setSummaryFile(java.io.File file)
Where to emit Maven's summary file? This can be used by the failsafe plugin to verify whether the build succeeded or not.
-
-
-
Field Detail
-
junit4
private JUnit4 junit4
-
dir
private java.io.File dir
-
mavenExtensions
private boolean mavenExtensions
-
summaryFile
private java.io.File summaryFile
-
filters
private java.util.List<org.apache.tools.ant.filters.TokenFilter> filters
-
suiteCounts
private java.util.Map<java.lang.String,java.lang.Integer> suiteCounts
-
ignoreDuplicateSuites
private boolean ignoreDuplicateSuites
-
outputStreams
private boolean outputStreams
- See Also:
setOutputStreams(boolean)
-
summaryListener
private final TestsSummaryEventListener summaryListener
-
-
Method Detail
-
setDir
public void setDir(java.io.File dir)
Output directory to write reports to.
-
setSummaryFile
public void setSummaryFile(java.io.File file)
Where to emit Maven's summary file? This can be used by the failsafe plugin to verify whether the build succeeded or not.
-
setOutputStreams
public void setOutputStreams(boolean outputStreams)
Include output streams? Mind that with large outputs the report may OOM.
-
setMavenExtensions
public void setMavenExtensions(boolean mavenExtensions)
Emit maven elements in the XML (extensions compared to ANT).
-
setIgnoreDuplicateSuites
public void setIgnoreDuplicateSuites(boolean ignoreDuplicateSuites)
Ignore duplicate suite names.
-
addConfiguredTokenFilter
public void addConfiguredTokenFilter(org.apache.tools.ant.filters.TokenFilter filter)
Adds method name filter.
-
setOuter
public void setOuter(JUnit4 junit4)
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
-
onQuit
public void onQuit(AggregatedQuitEvent e)
Write the summary file, if requested.
-
onSuiteResult
public void onSuiteResult(AggregatedSuiteResultEvent e)
Emit information about all of suite's tests.
-
buildModel
private TestSuiteModel buildModel(AggregatedSuiteResultEvent e) throws java.io.IOException
Build data model for serialization.- Throws:
java.io.IOException
-
buildModel
private java.util.List<TestCaseModel> buildModel(java.util.List<AggregatedTestResultEvent> testEvents)
-
applyFilters
private java.lang.String applyFilters(java.lang.String methodName)
Apply filters to a method name.- Parameters:
methodName
-
-
buildModel
private FailureModel buildModel(FailureMirror f)
-
buildModel
private java.util.List<PropertyModel> buildModel(java.util.Map<java.lang.String,java.lang.String> properties)
-
-