Search in sources :

Example 1 with MultiReportVisitor

use of org.jacoco.report.MultiReportVisitor in project jacoco by jacoco.

the class ReportSupport method initRootVisitor.

public IReportVisitor initRootVisitor() throws IOException {
    final IReportVisitor visitor = new MultiReportVisitor(formatters);
    visitor.visitInfo(loader.getSessionInfoStore().getInfos(), loader.getExecutionDataStore().getContents());
    return visitor;
}
Also used : MultiReportVisitor(org.jacoco.report.MultiReportVisitor) IReportVisitor(org.jacoco.report.IReportVisitor)

Example 2 with MultiReportVisitor

use of org.jacoco.report.MultiReportVisitor in project jacoco by jacoco.

the class Report method createReportVisitor.

private IReportVisitor createReportVisitor() throws IOException, IOException {
    final List<IReportVisitor> visitors = new ArrayList<IReportVisitor>();
    if (xml != null) {
        final XMLFormatter formatter = new XMLFormatter();
        visitors.add(formatter.createVisitor(new FileOutputStream(xml)));
    }
    if (csv != null) {
        final CSVFormatter formatter = new CSVFormatter();
        visitors.add(formatter.createVisitor(new FileOutputStream(csv)));
    }
    if (html != null) {
        final HTMLFormatter formatter = new HTMLFormatter();
        visitors.add(formatter.createVisitor(new FileMultiReportOutput(html)));
    }
    return new MultiReportVisitor(visitors);
}
Also used : FileMultiReportOutput(org.jacoco.report.FileMultiReportOutput) MultiReportVisitor(org.jacoco.report.MultiReportVisitor) XMLFormatter(org.jacoco.report.xml.XMLFormatter) FileOutputStream(java.io.FileOutputStream) HTMLFormatter(org.jacoco.report.html.HTMLFormatter) ArrayList(java.util.ArrayList) CSVFormatter(org.jacoco.report.csv.CSVFormatter) IReportVisitor(org.jacoco.report.IReportVisitor)

Aggregations

IReportVisitor (org.jacoco.report.IReportVisitor)2 MultiReportVisitor (org.jacoco.report.MultiReportVisitor)2 FileOutputStream (java.io.FileOutputStream)1 ArrayList (java.util.ArrayList)1 FileMultiReportOutput (org.jacoco.report.FileMultiReportOutput)1 CSVFormatter (org.jacoco.report.csv.CSVFormatter)1 HTMLFormatter (org.jacoco.report.html.HTMLFormatter)1 XMLFormatter (org.jacoco.report.xml.XMLFormatter)1