@Override public void renderOn(HtmlCanvas html) throws IOException { if (caption == null || caption.trim().isEmpty()) return; html .a(class_("brand").href(link)) .write(caption, false) ._a(); } }
private static void iterateTableList(HashMap<String, String> list) throws IOException { String className; String methodName; Iterator<Entry<String, String>> codeIter = list.entrySet().iterator(); while(codeIter.hasNext()){ Entry<String, String> entry = codeIter.next(); className = entry.getValue(); className = className.substring(className.lastIndexOf(".") + 1); methodName = entry.getKey(); String normalizedName = AbstractEarlReporter.createTestCaseName(className, methodName); html.li().a(href("#" + methodName)).b().write(normalizedName)._b()._a()._li(); } }
@Override public void renderOn(HtmlCanvas html) throws IOException { String goalName = null; if (goal != null && getMavenProject() != null && goal.startsWith(getMavenProject().getGroupId() + ":" + getMavenProject().getArtifactId())) { goalName = goal.substring(goal.lastIndexOf(":") + 1, goal.length()); } if (goalName != null) { html.a(href("./" + goalName + "-mojo.html")); } html.write(goal); if (goalName != null) { html._a(); } html.br(); } });
private static void generateList(ArrayList<String> list) throws IOException { if(list.size() == 0) { html.p().content("No tests of this type found."); } else { html.ul(); for (int i = 0; i < list.size(); i++) { html.li().a(href("#" + list.get(i))).write(list.get(i))._a()._li(); } html._ul(); } }
private static <T> void writeTestTables(Class<T> testClass) throws IOException { html.b().a(href("#" + testClass.getCanonicalName())) .content(testClass.getCanonicalName())._b(); html.br(); writeTestClassTable(testClass); html.br(); }
private <T> void writeTestCasesForClass(Class<T> classType) throws IOException, SecurityException { String className = classType.getCanonicalName(); html.h2().a(id(className)).write("Test Class: " + className)._a()._h2(); html.ul(); for (Method method : classType.getDeclaredMethods()) { if (method.isAnnotationPresent(Test.class)) { writeTestCaseDetails(method, className); } } html._ul(); toTop(); }
private void writeIndirectCases() throws IOException { if(indirectCases.size() == 0){ html.p().b().write("No Indirect Test Cases.")._b()._p(); } else { html.ul(); for (Method method : indirectCases) { if (method.getAnnotation(SpecTest.class) != null) { String name = method.getDeclaringClass().getCanonicalName(); name = name.substring(name.lastIndexOf(".") + 1); String normalizedName = AbstractEarlReporter.createTestCaseName(name, method.getName()); html.li().a(href("#" + method.getName())).b().write(normalizedName)._b()._a()._li(); } } html._ul(); } }
@Override public void renderOn(HtmlCanvas html) throws IOException { html.li().a(href(subMenuLink)).write(subMenuElement)._a()._li(); }
private static void toTestClass(String name) throws IOException { html.p(class_("totest")).a(href("#" + name)) .content("Back to Main Test Class")._p(); }
private static void toTop() throws IOException { html.p(class_("totop")).a(href("#top")).content("Back to Top")._p(); }
private void toTop() throws IOException { html.p(class_("totop")).a(href("#top")).content("Back to Top")._p(); } private void writeOverallBarChart() throws IOException {
@Override public void renderOn(HtmlCanvas html) throws IOException { HtmlCanvas tbody = html .table(class_("table table-striped table-condensed")) .tbody(); int id = 0; for (Pair<File, File> file : files) { tbody .tr() .td(class_("col-md-10")).content(comparator.getSrc().relativize(file.getFirst().toPath()).toString()) .td(class_("col-md-2")) .a(class_("btn btn-primary btn-xs").href("/diff/" + id)).content("diff") .write(" ") .a(class_("btn btn-primary btn-xs").href("/mergely/" + id)).content("mergely") .write(" ") .a(class_("btn btn-primary btn-xs").href("/script/" + id)).content("script") ._td() ._tr(); id++; } tbody ._tbody() ._table(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .div(class_("col-lg-12")) .div(class_("btn-toolbar pull-right")) .div(class_("btn-group")) .a(class_("btn btn-default btn-xs").id("legend").href("#").add("data-toggle", "popover").add("data-html", "true").add("data-placement", "bottom").add("data-content", "<span class="del"> </span> deleted<br><span class="add"> </span> added<br><span class="mv"> </span> moved<br><span class="upd"> </span> updated<br>", false).add("data-original-title", "Legend").title("Legend").role("button")).content("Legend") .a(class_("btn btn-default btn-xs").id("shortcuts").href("#").add("data-toggle", "popover").add("data-html", "true").add("data-placement", "bottom").add("data-content", "<b>q</b> quit<br><b>l</b> list<br><b>n</b> next<br><b>t</b> top<br><b>b</b> bottom", false).add("data-original-title", "Shortcuts").title("Shortcuts").role("button")).content("Shortcuts") ._div() .div(class_("btn-group")) .a(class_("btn btn-default btn-xs btn-danger").href("/quit")).content("Quit") ._div() ._div() ._div(); } }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .div(class_("col-lg-12")) .div(class_("btn-toolbar pull-right")) .div(class_("btn-group")) .a(class_("btn btn-default btn-xs").id("legend").href("#").add("data-toggle", "popover").add("data-html", "true").add("data-placement", "bottom").add("data-content", "<span class="del"> </span> deleted<br><span class="add"> </span> added<br><span class="mv"> </span> moved<br><span class="upd"> </span> updated<br>", false).add("data-original-title", "Legend").title("Legend").role("button")).content("Legend") .a(class_("btn btn-default btn-xs").id("shortcuts").href("#").add("data-toggle", "popover").add("data-html", "true").add("data-placement", "bottom").add("data-content", "<b>q</b> quit<br><b>l</b> list<br><b>n</b> next<br><b>t</b> top<br><b>b</b> bottom", false).add("data-original-title", "Shortcuts").title("Shortcuts").role("button")).content("Shortcuts") ._div() .div(class_("btn-group")) .a(class_("btn btn-default btn-xs btn-danger").href("/quit")).content("Quit") ._div() ._div() ._div(); } }
void generateHeader(HtmlCanvas reportPageBody, String cloudSlangImage) throws IOException { HtmlCanvas headerDiv = reportPageBody.div(new HtmlAttributes().id(HEADER_BAR_ID)); HtmlCanvas anchor = headerDiv.a(new HtmlAttributes().href(HTTP_CLOUD_SLANG_IO).target(BLANK)); HtmlCanvas img = new HtmlCanvas().img(new HtmlAttributes().src(cloudSlangImage).alt(CLOUD_SLANG_LOGO_ALT)); anchor.content(img.toHtml(), false); headerDiv._div(); reportPageBody.h1(new HtmlAttributes().class_(REPORT_TITLE_CLASS)).content(TEST_CASE_REPORT); }
private HtmlCanvas addMergeRequest(HtmlCanvas html, MergeRequest mergeRequest) throws IOException { MutableDataSet options = new MutableDataSet(); Parser parser = Parser.builder(options).build(); HtmlRenderer renderer = HtmlRenderer.builder(options).build(); String description = mergeRequest.getDescription(); description = renderer.render(parser.parse(description)); return html.li().h5().write(mergeRequest.getTitle() + " ").a(href(gitlabRepository + "/merge_requests/"+mergeRequest.getIid()).class_("external")).write("#"+mergeRequest.getIid())._a()._h5().write(description, false)._li(); }
private HtmlCanvas addIssue(HtmlCanvas html, Issue issue) throws IOException { MutableDataSet options = new MutableDataSet(); Parser parser = Parser.builder(options).build(); HtmlRenderer renderer = HtmlRenderer.builder(options).build(); String description = issue.getDescription(); description = renderer.render(parser.parse(description)); return html.li().h5().write(issue.getTitle() + " ").a(href(gitlabRepository + "/issues/"+issue.getIid()).class_("external")).write("#"+issue.getIid())._a()._h5().write(description, false)._li(); }
private void generateSummaryTableStart(Date date, String suiteName) throws IOException { html.tr().th().content("Test Suite Name"); html.th().content("Revision"); html.th().content("Report Date"); html.th().content("Skipped Tests"); html.th().content("MUST Requirements"); html.th().content("SHOULD Requirements"); html.th().content("MAY Requirements"); html._tr(); html.tr(class_("alt")).td().content(suiteName); final String commit = BuildProperties.getRevision(); if (commit == null) { html.td().content("<UNKNOWN>"); } else { html.td().a(href("https://github.com/w3c/ldp-testsuite/commit/" + commit)).content(commit)._td(); } html.td().content(date.toString()); }
private HtmlCanvas generateSampleProfileDocumentation(HtmlCanvas html) throws IOException { HtmlCanvas sampleProfile = new HtmlCanvas(); sampleProfile = generateSampleProfile(sampleProfile); html. div(class_("section")). h3(id("Sample_Profile")).write("Sample Profile")._h3(). p().em().write("Based on above properties, here is a sample profile to include in ").a(href("https://maven.apache.org/settings.html")).write("Maven settings.xml file")._a().write(":")._em()._p(). write(sampleProfile.toHtml(), false). write(sampleProfileCommandLineGenerator, false) ._div(); addPropertyInSessionRequest("sampleProfile", sampleProfile.toHtml()); return html; }
@Override public void renderOn(HtmlCanvas html) throws IOException { html. div(class_("section")). h3(id("Lifecycle_"+this.getPackagingName())).a(href("packaging-"+this.getPackagingName()+".html")).write(this.getPackagingName())._a()._h3(). table(border("0").class_("bodyTable table table-striped table-hover")). thead(). tr(class_("a")). th().write("Phase")._th(). th().write("Goal")._th(). _tr() ._thead(). tbody(); for (t3.LifecyclesUtils.Phase phase : this.getPhases()) { ((Phase) phase).renderOn(html); } html ._tbody() ._table() ._div(); }