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 HtmlCanvas getArchetypeSection() throws IOException { HtmlCanvas html = new HtmlCanvas(); html.div(class_("section")). div(class_("page-header")). h2(id("Archetype")).em().write(project.getArtifactId())._em().write(" archetype")._h2() ._div(). a(name("Archetype"))._a(); String additionalHTML = replaceProperties(getPropertyValue(project, "archetypeAdditionalHTML", false, false, false)); if (additionalHTML != null && ! additionalHTML.isEmpty()) { html.write(additionalHTML, false); } Dependency dependency = new Dependency(); dependency.setGroupId(project.getGroupId()); dependency.setArtifactId(project.getArtifactId()); dependency.setVersion(project.getVersion()); String archetypeAdditionalArguments = replaceProperties(project.getProperties().getProperty("archetypeAdditionalArguments")); HtmlCanvas commandLine = createArchetypesCommandLines(dependency, archetypeAdditionalArguments, false); html.write(commandLine.toHtml(), false) ._div(); return html; }
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 String buildHtml() { HtmlCanvas html = new HtmlCanvas(); try { HtmlCanvas tmp = html .head() .title() .content("StreamPipes Connector Master Container") ._head() .body() .h1().write("Connector Master Container")._h1() .h2().write("All Running Adapters")._h2() .ol(); tmp = getAllRunningAdapters(tmp); html = tmp._ol() ._body(); } catch (IOException e) { logger.error("Error in SP Connect Master Container: ", e); } return html.toHtml(); }
div(class_("section")). div(class_("page-header")). h2().write("Changelog")._h2() ._div();
@Override public HtmlCanvas getContent(HtmlCanvas html) throws IOException, SAXException { html. div(class_("row")). div(class_("span12")). div(class_("body-content")). div(class_("section")). div(class_("page-header")). h2(id(packagingName + "-packaging")).write(packagingName + " packaging")._h2(). p().write("This is the packaging for " + packagingName + ".")._p() ._div() ._div() ._div() ._div() ._div(); return html; } };
private HtmlCanvas getLifecyclesDocumentation(HtmlCanvas html) throws IOException { html. div(class_("row")). div(class_("span12")). div(class_("body-content")). div(class_("section")). div(class_("page-header")). h2(id("Lifecycles")).write("Lifecycles")._h2(). p().write("The different lifecycles of the plugin are associated with custom packagings.")._p(); html.render(new Renderable() { @Override public void renderOn(HtmlCanvas html) throws IOException { getLifecyclesSection(html); } }); html ._div() ._div() ._div() ._div() ._div(); return html; }
private HtmlCanvas generateGlobalDocumentation(HtmlCanvas html) throws IOException { html. div(class_("row")). div(class_("span12")). div(class_("body-content")). div(class_("section")). div(class_("page-header")). h2(id("Global_Documentation")).write("Global Documentation")._h2(). p().write("The global documentation describes parameters which are common to a group of projects.")._p(); html.render(new Renderable() { @Override public void renderOn(HtmlCanvas html) throws IOException { generateGlobalParametersSection(html); } }); html.render(new Renderable() { @Override public void renderOn(HtmlCanvas html) throws IOException { generateSampleProfileDocumentation(html); } }); html ._div() ._div() ._div() ._div() ._div(); return html; }
private void generateDetail(IResultMap tests) throws IOException { for (ITestResult m : tests.getAllResults()) { ITestNGMethod method = m.getMethod(); String normalizedName = AbstractEarlReporter.createTestCaseName( m.getTestClass().getName(), method.getMethodName()); html.h2() .a(id(m.getTestClass().getName() + "_" + method.getMethodName())) .write(normalizedName)._a()._h2(); getAdditionalInfo(m, method); html.p(class_("indented")) .b() .write("Description: ") ._b() .write((method.getDescription() != null ? method .getDescription() : "No description for this test method found")) ._p(); String groups = ""; for (String group : method.getGroups()) { groups += group + " "; } html.p(class_("indented")).b().write("Requirement Level: ")._b() .write(groups)._p(); toTop(); } }