Search in sources :

Example 1 with ILinkable

use of org.jacoco.report.internal.html.ILinkable 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)

Example 2 with ILinkable

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

the class PackageSourcePageTest method setup.

@Before
@Override
public void setup() throws Exception {
    super.setup();
    ISourceFileCoverage src1 = new SourceFileCoverageImpl("Src1.java", "org/jacoco/example");
    ISourceFileCoverage src2 = new SourceFileCoverageImpl("Src2.java", "org/jacoco/example");
    node = new PackageCoverageImpl("org/jacoco/example", Collections.<IClassCoverage>emptyList(), Arrays.asList(src1, src2));
    sourceLocator = new ISourceFileLocator() {

        public int getTabWidth() {
            return 4;
        }

        public Reader getSourceFile(String packageName, String fileName) throws IOException {
            return fileName.equals("Src1.java") ? new StringReader("") : null;
        }
    };
    packagePageLink = new ILinkable() {

        public String getLinkStyle() {
            fail();
            return null;
        }

        public String getLinkLabel() {
            fail();
            return null;
        }

        public String getLink(ReportOutputFolder base) {
            return "index.html";
        }
    };
}
Also used : ReportOutputFolder(org.jacoco.report.internal.ReportOutputFolder) ISourceFileCoverage(org.jacoco.core.analysis.ISourceFileCoverage) PackageCoverageImpl(org.jacoco.core.internal.analysis.PackageCoverageImpl) IClassCoverage(org.jacoco.core.analysis.IClassCoverage) StringReader(java.io.StringReader) Reader(java.io.Reader) StringReader(java.io.StringReader) IOException(java.io.IOException) ILinkable(org.jacoco.report.internal.html.ILinkable) ISourceFileLocator(org.jacoco.report.ISourceFileLocator) SourceFileCoverageImpl(org.jacoco.core.internal.analysis.SourceFileCoverageImpl) Before(org.junit.Before)

Example 3 with ILinkable

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

the class PackagePage method renderClasses.

private void renderClasses() throws IOException {
    for (final IClassCoverage c : getNode().getClasses()) {
        final ILinkable sourceFilePage = packageSourcePage.getSourceFilePage(c.getSourceFileName());
        final ClassPage page = new ClassPage(c, this, sourceFilePage, folder, context);
        page.render();
        addItem(page);
    }
}
Also used : IClassCoverage(org.jacoco.core.analysis.IClassCoverage) ILinkable(org.jacoco.report.internal.html.ILinkable)

Aggregations

ILinkable (org.jacoco.report.internal.html.ILinkable)3 IClassCoverage (org.jacoco.core.analysis.IClassCoverage)2 ReportOutputFolder (org.jacoco.report.internal.ReportOutputFolder)2 IOException (java.io.IOException)1 Reader (java.io.Reader)1 StringReader (java.io.StringReader)1 Locale (java.util.Locale)1 ISourceFileCoverage (org.jacoco.core.analysis.ISourceFileCoverage)1 PackageCoverageImpl (org.jacoco.core.internal.analysis.PackageCoverageImpl)1 SourceFileCoverageImpl (org.jacoco.core.internal.analysis.SourceFileCoverageImpl)1 ILanguageNames (org.jacoco.report.ILanguageNames)1 ISourceFileLocator (org.jacoco.report.ISourceFileLocator)1 JavaNames (org.jacoco.report.JavaNames)1 MemoryMultiReportOutput (org.jacoco.report.MemoryMultiReportOutput)1 HTMLSupport (org.jacoco.report.internal.html.HTMLSupport)1 IHTMLReportContext (org.jacoco.report.internal.html.IHTMLReportContext)1 LinkableStub (org.jacoco.report.internal.html.LinkableStub)1 IIndexUpdate (org.jacoco.report.internal.html.index.IIndexUpdate)1 Resources (org.jacoco.report.internal.html.resources.Resources)1 LabelColumn (org.jacoco.report.internal.html.table.LabelColumn)1