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();
}
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";
}
};
}
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);
}
}
Aggregations