Search in sources :

Example 1 with ReportOutputFolder

use of org.jacoco.report.internal.ReportOutputFolder in project jacoco by jacoco.

the class ReportPageTest method testGetLink.

@Test
public void testGetLink() throws IOException {
    ReportOutputFolder base = rootFolder.subFolder("here");
    assertEquals("../Test.html", page.getLink(base));
}
Also used : ReportOutputFolder(org.jacoco.report.internal.ReportOutputFolder) Test(org.junit.Test)

Example 2 with ReportOutputFolder

use of org.jacoco.report.internal.ReportOutputFolder in project jacoco by jacoco.

the class ResourcesTest method testGetLink.

@Test
public void testGetLink() {
    ReportOutputFolder base = root.subFolder("f1").subFolder("f2");
    assertEquals("../../jacoco-resources/test.png", resources.getLink(base, "test.png"));
}
Also used : ReportOutputFolder(org.jacoco.report.internal.ReportOutputFolder) Test(org.junit.Test)

Example 3 with ReportOutputFolder

use of org.jacoco.report.internal.ReportOutputFolder in project jacoco by jacoco.

the class BarColumnTest method setup.

@Before
public void setup() throws Exception {
    output = new MemoryMultiReportOutput();
    root = new ReportOutputFolder(output);
    resources = new Resources(root);
    html = new HTMLElement(root.createFile("Test.html"), "UTF-8");
    html.head().title();
    td = html.body().table("somestyle").tr().td();
    support = new HTMLSupport();
    column = new BarColumn(CounterEntity.LINE, Locale.ENGLISH);
}
Also used : ReportOutputFolder(org.jacoco.report.internal.ReportOutputFolder) HTMLSupport(org.jacoco.report.internal.html.HTMLSupport) HTMLElement(org.jacoco.report.internal.html.HTMLElement) MemoryMultiReportOutput(org.jacoco.report.MemoryMultiReportOutput) Resources(org.jacoco.report.internal.html.resources.Resources) Before(org.junit.Before)

Example 4 with ReportOutputFolder

use of org.jacoco.report.internal.ReportOutputFolder in project jacoco by jacoco.

the class LabelColumnTest method setup.

@Before
public void setup() throws Exception {
    output = new MemoryMultiReportOutput();
    root = new ReportOutputFolder(output);
    resources = new Resources(root);
    html = new HTMLElement(root.createFile("Test.html"), "UTF-8");
    html.head().title();
    td = html.body().table("somestyle").tr().td();
    support = new HTMLSupport();
    column = new LabelColumn();
}
Also used : ReportOutputFolder(org.jacoco.report.internal.ReportOutputFolder) HTMLSupport(org.jacoco.report.internal.html.HTMLSupport) HTMLElement(org.jacoco.report.internal.html.HTMLElement) MemoryMultiReportOutput(org.jacoco.report.MemoryMultiReportOutput) Resources(org.jacoco.report.internal.html.resources.Resources) Before(org.junit.Before)

Example 5 with ReportOutputFolder

use of org.jacoco.report.internal.ReportOutputFolder in project jacoco by jacoco.

the class PageTestBase method setup.

protected void setup() throws Exception {
    output = new MemoryMultiReportOutput();
    rootFolder = new ReportOutputFolder(output);
    final Resources resources = new Resources(rootFolder);
    final Table table = new Table();
    table.add("Element", null, new LabelColumn(), true);
    context = new IHTMLReportContext() {

        public ILanguageNames getLanguageNames() {
            return new JavaNames();
        }

        public Resources getResources() {
            return resources;
        }

        public Table getTable() {
            return table;
        }

        public String getFooterText() {
            return "CustomFooter";
        }

        public ILinkable getSessionsPage() {
            return new LinkableStub("sessions.html", "Sessions", Styles.EL_SESSION);
        }

        public String getOutputEncoding() {
            return "UTF-8";
        }

        public IIndexUpdate getIndexUpdate() {
            return new IIndexUpdate() {

                public void addClass(ILinkable link, long classid) {
                }
            };
        }

        public Locale getLocale() {
            return Locale.ENGLISH;
        }
    };
    support = new HTMLSupport();
}
Also used : ReportOutputFolder(org.jacoco.report.internal.ReportOutputFolder) Locale(java.util.Locale) HTMLSupport(org.jacoco.report.internal.html.HTMLSupport) IIndexUpdate(org.jacoco.report.internal.html.index.IIndexUpdate) Table(org.jacoco.report.internal.html.table.Table) LinkableStub(org.jacoco.report.internal.html.LinkableStub) LabelColumn(org.jacoco.report.internal.html.table.LabelColumn) ILinkable(org.jacoco.report.internal.html.ILinkable) ILanguageNames(org.jacoco.report.ILanguageNames) MemoryMultiReportOutput(org.jacoco.report.MemoryMultiReportOutput) Resources(org.jacoco.report.internal.html.resources.Resources) IHTMLReportContext(org.jacoco.report.internal.html.IHTMLReportContext) JavaNames(org.jacoco.report.JavaNames)

Aggregations

ReportOutputFolder (org.jacoco.report.internal.ReportOutputFolder)11 MemoryMultiReportOutput (org.jacoco.report.MemoryMultiReportOutput)7 Resources (org.jacoco.report.internal.html.resources.Resources)7 Before (org.junit.Before)7 HTMLElement (org.jacoco.report.internal.html.HTMLElement)5 HTMLSupport (org.jacoco.report.internal.html.HTMLSupport)5 ISourceFileLocator (org.jacoco.report.ISourceFileLocator)2 ILinkable (org.jacoco.report.internal.html.ILinkable)2 Test (org.junit.Test)2 IOException (java.io.IOException)1 Reader (java.io.Reader)1 StringReader (java.io.StringReader)1 Collection (java.util.Collection)1 List (java.util.List)1 Locale (java.util.Locale)1 IBundleCoverage (org.jacoco.core.analysis.IBundleCoverage)1 IClassCoverage (org.jacoco.core.analysis.IClassCoverage)1 ISourceFileCoverage (org.jacoco.core.analysis.ISourceFileCoverage)1 PackageCoverageImpl (org.jacoco.core.internal.analysis.PackageCoverageImpl)1 SourceFileCoverageImpl (org.jacoco.core.internal.analysis.SourceFileCoverageImpl)1