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 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(); } }
html.label(class_("label")).b().write("Test Results by Specification Requirement")._b()._label(); html.div(class_("barChart").id("overallChart1"))._div(); // svg chart writePassFailLegend(); html.label(class_("label")).b().write("Test Results by Test Class")._b()._label(); html.div(class_("barChart").id("resourcesChart"))._div(); writeTestClassLegend();
DataSourceDescriptionHtml semanticEventProducerDescription = (DataSourceDescriptionHtml) description; for (Description agentDesc : semanticEventProducerDescription.getStreams()) { html.h5().b().write(agentDesc.getName())._b()._h5(); html.h5().write(agentDesc.getDescription())._h5();
private void printReqCellResult(int passed, int failed, int skipped) throws IOException { int total = passed + failed + skipped; html.td().b().write(passed + "/" + total)._b(); html.write(" Passed"); html.br().b().write(failed + "/" + total)._b(); html.write(" Failed"); html.br().b().write(skipped + "/" + total)._b(); html.write(" Skipped"); html._td(); }
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.p(); if (description != null && !description.isEmpty()) { html.write(replaceProperties(description), false).br(); } if (name != null && !name.isEmpty()) { if (description != null && !description.isEmpty()) { html.br(); } html.b().write("Parameter name is")._b().write(": " + name + "."); } if (property != null && !property.isEmpty()) { if (name != null && !name.isEmpty() || description != null && !description.isEmpty()) { html.br(); } html.b().write("User property is")._b().write(": " + property + "."); } if (defaultValue != null && !defaultValue.isEmpty()) { if (property != null && !property.isEmpty() || name != null && !name.isEmpty() || description != null && !description.isEmpty()) { html.br(); } html.b().write("Default value is")._b().write(": " + defaultValue + "."); } html._p(); } });
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.td(); if (must > 0) html.b().write("MUST: ")._b().write(must).br(); if (should > 0) html.b().write("SHOULD: ")._b().write(should).br(); if (may > 0) html.b().write("MAY: ")._b().write(may).br(); html.b().write("Approved: ")._b().write("" + approve).br(); int pend = getTotal(pendReq); if(pend > 0) html.b().write("Pending: ")._b().write("" + pend).br(); int extend = getTotal(extReq); if (extend > 0) html.b().write("Extension: ")._b().write("" + extend).br(); int depre = getTotal(depreReq); if (depre > 0) html.b().write("Deprecated: ")._b().write("" + depre).br(); int clarify = getTotal(clariReq); if(clarify > 0) html.b().write("Clarification: ")._b().write("" + clarify).br(); html.b().write("Automated: ")._b().write("" + auto).br(); int unimpl = getTotal(unimReq); if (unimpl > 0) html.b().write("Not Implemented: ")._b().write("" + unimpl).br(); int client = getTotal(clientReq); if (client > 0) html.b().write("Client Only: ")._b().write("" + client).br();
private static <T> void writeTestClassTable(Class<T> classType) throws IOException { html.span(class_("chartStart")); html.label(class_("label")).b().write("Test Case Status")._b()._label(); html.div(class_("smallBar").id(classType.getSimpleName() + "_statusbar"))._div(); writeStatusLegend(); html.span(class_("chartStart")); html.label(class_("label")).b().write("Test Case Implementation")._b()._label(); html.div(class_("smallBar").id(classType.getSimpleName() + "_implmtbar"))._div(); writeImplmntLegend(); acquireTestInfo(classType); }
html.b(); html.a(href(ReportUtils.getJavadocLink(method))) .content(method.getName()); html.b().write("Used by Class: ")._b(); boolean seen=false; for (@SuppressWarnings("rawtypes") Class c: testClasses) { html.br().b().write("Description: ")._b().write(test.description()); html.br().b().write("Specification Section: ")._b() .a(href(testLdp.specRefUri())) .write(testLdp.specRefUri())._a(); html.br().b().write("Groups: ")._b() .write(Arrays.toString(test.groups())); html.br().b().write("Status: ")._b() .write(testLdp.approval().toString()); html.br().b().write("Test Case Implementation: ")._b() .write("" + testLdp.testMethod()); html.br().b().write("Enabled: ")._b() .write("" + test.enabled()); if(testLdp.steps().length != 0) writeSteps(testLdp.steps(), method.getName()); if(!testLdp.comment().equals("")) html.p(class_("note")).b().write("NOTE: ")._b() .write(testLdp.comment())._p(); if(testLdp.testMethod().equals(METHOD.INDIRECT)){ 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();
parameters += p.toString() + " "; html.p(class_("indented")).b().write("Parameters: ")._b() .write(parameters)._p(); .getAnnotation(SpecTest.class); if(!testLdp.comment().equals("")) html.p(class_("note")).b().write("NOTE: ")._b() .write(testLdp.comment())._p(); if(testLdp.steps().length != 0) writeSteps(testLdp.steps(), m.getName()); 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()){ String testCaseName = methodName.getDeclaringClass().getSimpleName(); String normalizedName = AbstractEarlReporter.createTestCaseName(testCaseName, methodName.getName()); html.li().b().write(normalizedName)._b(); html.write(" - [Test " + findTestResult(methodName.getName()) + "]"); html._li(); html.p(class_("indented")).b().write("Reference URI: ")._b() .a(href(testLdp.specRefUri())).write(testLdp.specRefUri())._a()._p();
html.td(rowspan("2")).b().write("" + totalTests)._b().write(" Total Tests"); html.ul(); html.b().write(approved + " ")._b().write("Approved"); html._li(); html.b().write(pending + " ")._b().write("Pending"); html._li(); html.b().write(extended + " ")._b().write("Extension"); html._li(); html.b().write(deprecated + " ")._b().write("No longer valid"); html._li(); html.b().write(clarification + " ")._b().write("Needs to be clarified with WG"); html._li(); html.br().b().a(href("#tobeapproved")).write(readyToBeApproved.size() + " Ready for Approval")._a()._b(); html.b().write(automated + " / " + totalTests)._b() .write(" of Total Tests Automated").br(); 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();
private void printSkipCellResult() throws IOException { if (skipped == 0) html.td().i().write("No tests of this type called")._i()._td(); else { html.td(); html.write("("); html.b().write(skipped + "/" + total)._b(); html.write(") "); html.write("of the total tests.")._td(); } }
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(); } }
.write(normalizedName)._a(); if (method.getConstructorOrMethod().getMethod().getAnnotation(SpecTest.class).approval() == STATUS.WG_PENDING) { html.br().b().em().write("WG Approval Pending")._em()._b();
tr(class_(clazz)). td(). b(). a(id(name).href("#"+name)).write(property)._a() ._b()