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(); } }
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 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(); } }
private HtmlCanvas getAllRunningAdapters(HtmlCanvas canvas) throws IOException { List<AdapterDescription> allAdapterDescriptions = null; try { allAdapterDescriptions = this.adapterMasterManagement.getAllAdapters(new AdapterStorageImpl()); } catch (AdapterException e) { logger.error("Could not connect to couchdb on URL: " + CouchDbConfig.INSTANCE.getHost(), e); canvas.li().write("Error while connecting to CouchDB on Host: " + CouchDbConfig.INSTANCE.getHost())._li(); return canvas; } for (AdapterDescription ad : allAdapterDescriptions) { canvas.li().write(ad.getAdapterId())._li(); canvas.ul().li().write("Kafka Topic: " + GroundingService.extractTopic(ad))._li()._ul(); } return canvas; }
@Override public void renderOn(HtmlCanvas html) throws IOException { html.li().a(href(subMenuLink)).write(subMenuElement)._a()._li(); }
private static void writeGraphDescription() throws IOException { html.h3().content("Description of the Chart Information"); html.h4().content("Test Status"); html.ul(); html.li().b().write("Approved")._b().write(" - the working group has approved this test case")._li(); html.li().b().write("Pending approval")._b().write(" (default) - no official recommendation from the working group supporting the specification being tested by this test suite")._li(); html.li().b().write("Extension")._b().write(" - valuable test case but not part of the approved set")._li(); html.li().b().write("Deprecated")._b().write(" - no longer recommended by the working group")._li(); html.li().b().write("Clarification")._b().write(" - requires further clarification from the working group")._li(); html._ul(); html.h4().content("Test Implementation"); html.ul(); html.li().b().write("Automated")._b().write(" - implementation complete")._li(); html.li().b().write("Not Implemented")._b().write(" (default) - possible to implement, just not done")._li(); html.li().b().write("Client Only")._b().write(" - test is only client-side, this test suite doesn't test it")._li(); html.li().b().write("Manual")._b().write(" - server test but not automated")._li(); html._ul(); }
private void updateMenu(File htmlFile, List<SubMenuReplacement> subMenuReplacements) throws IOException, MojoExecutionException { if (subMenuReplacements == null || subMenuReplacements.isEmpty()) return; for (SubMenuReplacement subMenuReplacement : subMenuReplacements) { HtmlCanvas html = new HtmlCanvas(); html .li(class_("dropdown-submenu")) .a(href(subMenuReplacement.getOriginalMenuElementLink())).write(subMenuReplacement.getOriginalMenuElement())._a() .ul(class_("dropdown-menu")); if (subMenuReplacement.getSubMenuElements() != null) { for (String subMenuElement : subMenuReplacement.getSubMenuElements().keySet()) { html.render(new SubMenuElement(subMenuElement, subMenuReplacement.getSubMenuElements().get(subMenuElement))); } } html ._ul() ._li(); replaceByLine(htmlFile, "<li.*><a href=.*>" + subMenuReplacement.getOriginalMenuElement() + "</a></li>", formatHtml(html.toHtml())); } }
html.li().b().write(normalizedName)._b(); html.write(" - [Test " + findTestResult(methodName.getName()) + "]"); html._li();
writeColorBlock(statusColor, "approved"); html.b().write(approved + " ")._b().write("Approved"); html._li(); html._li(); html._li(); html._li(); html._li(); html.ul(); html.li().b().write("" + refURI.size())._b().write(" Requirements Covered") ._li(); html.ul().li().b().write("" + mustTotal)._b().write(" MUST")._li(); html.li().b().write("" + shouldTotal)._b().write(" SHOULD")._li(); html.li().b().write("" + mayTotal)._b().write(" MAY")._li()._ul(); html._ul(); writeColorBlock(implmColor, "automated"); html.b().write(implemented + " ")._b().write("Requirements Automated"); html._li(); html.li().b().write(auto[MUST] + " / " + mustTotal)._b().write(" MUST")._li(); html.li().b().write(auto[SHOULD] + " / " + shouldTotal)._b().write(" SHOULD") ._li(); html.li().b().write(auto[MAY] + " / " + mayTotal)._b().write(" MAY")._li(); html._ul();
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(); }