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 <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 writeSteps(String[] steps, String title) throws IOException { html.p().content("How to Run " + title); html.ul(); for(String step : steps) html.li().content(step); html._ul(); }
private static void writeSteps(String[] steps, String title) throws IOException { html.p().content("How to Run " + title); html.ul(); for(String step : steps) html.li().content(step); 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())); } }
private void generateList(String[] list, String title) throws IOException { html.h2().write(title)._h2(); if (list.length == 0) { html.div(style("padding-left:2em")).i() .content("No groups of this type found in the test suite") ._div(); } else { html.ul(); for (String group : list) { html.li().content(group); } 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; }
if(testLdp.coveredByTests().length > 0 && testLdp.coveredByGroups().length > 0){ html.p().b().content("Test Case is covered Indirectly by the following:")._p(); html.ul(); for(Class<?> className : testLdp.coveredByTests()){ Method[] classMethod = className.getDeclaredMethods();
html.p().b().write("This test is covered Indirectly by other test cases.")._b()._p(); html.p().content("Test Cases that cover this test:"); html.ul(); for(Class<?> coverTest : testLdp.coveredByTests()) { Method[] classMethod = coverTest.getDeclaredMethods();
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(); }
html.ul(); html.b().write(automated + " / " + (automated + needCode.size()))._b() .write(" of Tests Possible to Automate"); 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(); html.ul(); int implemented = getTotal(auto); html.li(); html.ul(); html.li().b().write(auto[MUST] + " / " + mustTotal)._b().write(" MUST")._li(); html.li().b().write(auto[SHOULD] + " / " + shouldTotal)._b().write(" SHOULD") html.b().write((needCode.size() + clients.size() + manuals.size()) + " ")._b() .write("of the Unimplemented Tests"); html.ul(); html.ul(); int unimplemented = getTotal(unimplmnt); html.ul(); html.li().b().write(unimplmnt[MUST] + " ")._b().write("MUST")._li();