Search in sources :

Example 6 with HTMLDocument

use of org.jacoco.report.internal.html.HTMLDocument in project jacoco by jacoco.

the class ReportPage method render.

/**
 * Renders this page's content and optionally additional pages. This method
 * must be called at most once.
 *
 * @throws IOException
 *             if the page can't be written
 */
public void render() throws IOException {
    final HTMLDocument doc = new HTMLDocument(folder.createFile(getFileName()), context.getOutputEncoding());
    doc.attr("lang", context.getLocale().getLanguage());
    head(doc.head());
    body(doc.body());
    doc.close();
}
Also used : HTMLDocument(org.jacoco.report.internal.html.HTMLDocument)

Example 7 with HTMLDocument

use of org.jacoco.report.internal.html.HTMLDocument in project jacoco by jacoco.

the class SourceHighlighterTest method setup.

@Before
public void setup() throws Exception {
    htmlSupport = new HTMLSupport();
    source = new SourceNodeImpl(ElementType.SOURCEFILE, "Foo.java");
    buffer = new StringWriter();
    html = new HTMLDocument(buffer, "UTF-8");
    html.head().title();
    parent = html.body();
    sourceHighlighter = new SourceHighlighter(Locale.US);
}
Also used : SourceNodeImpl(org.jacoco.core.internal.analysis.SourceNodeImpl) HTMLSupport(org.jacoco.report.internal.html.HTMLSupport) StringWriter(java.io.StringWriter) HTMLDocument(org.jacoco.report.internal.html.HTMLDocument) Before(org.junit.Before)

Aggregations

HTMLDocument (org.jacoco.report.internal.html.HTMLDocument)7 Before (org.junit.Before)6 MemoryMultiReportOutput (org.jacoco.report.MemoryMultiReportOutput)5 ReportOutputFolder (org.jacoco.report.internal.ReportOutputFolder)5 HTMLSupport (org.jacoco.report.internal.html.HTMLSupport)5 Resources (org.jacoco.report.internal.html.resources.Resources)5 StringWriter (java.io.StringWriter)1 SourceNodeImpl (org.jacoco.core.internal.analysis.SourceNodeImpl)1