public void generateReport(IRunTestResults iRunTestResults, String reportDirectory) throws IOException { String reportFileName = String.format(TEST_CASE_REPORT_NAME + FORMATTER_STRING + REPORT_EXTENSION, valueOf(currentTimeMillis())); Path path = Paths.get(reportDirectory, reportFileName); try (Writer writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter( new FileOutputStream(path.toFile(), false), UTF_8)))) { HtmlCanvas reportPage = new HtmlCanvas(writer); HtmlCanvas reportPageHtml = reportPage.html(); appendReportPageHead(reportPageHtml); HtmlCanvas reportPageBody = reportPageHtml.body(); createResourcesFolder(reportDirectory); copyResources(reportDirectory); generateHeader(reportPageBody, CURRENT_DIRECTORY + RES + SLASH + CLOUD_SLANG_LOGO_PNG); generatePiechart(reportPageBody, iRunTestResults); generateTestCaseReportTable(reportPageBody, iRunTestResults); } }
private String buildHtml() { HtmlCanvas html = new HtmlCanvas(); try { html .head() .title() .content("StreamPipes Connector Worker Container") ._head() .body() .h1().write("Worker Connector Container with ID: " + this.id)._h1() ._body(); } catch (IOException e) { e.printStackTrace(); } return html.toHtml(); } }
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(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container")) .div(class_("row")) .div(class_("col-lg-12")) .h3() .write("Script ") .small().content(String.format("%s -> %s", fSrc.getName(), fDst.getName())) ._h3() .pre().content(ActionsIoUtils.toText(src, this.script, mappings).toString()) ._div() ._div() ._div() .render(new BootstrapFooterView()) .macros().javascript("/dist/script.js") ._body() ._html(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container")) .div(class_("row")) .div(class_("col-lg-12")) .h3() .write("Script ") .small().content(String.format("%s -> %s", fSrc.getName(), fDst.getName())) ._h3() .pre().content(ActionsIoUtils.toText(src, this.script, mappings).toString()) ._div() ._div() ._div() .render(new BootstrapFooterView()) .macros().javascript("/dist/script.js") ._body() ._html(); }
@SuppressWarnings("unchecked") protected void generateHTMLReport() throws IOException, SecurityException { html = new HtmlCanvas(); html.html().head(); writeCss(); html.title().content(title + ": Test Cases Coverage Report")._head().body(); html.h1().content("W3C Linked Data Platform (" + title + ") Test Suite: Test Cases Coverage Report"); html.p().a(href("http://www.w3.org/2012/ldp/")).content("See also W3C Linked Data Platform WG")._p(); html.p().a(href(specUri)).content("Specification Requirements Page")._p(); final String commit = BuildProperties.getRevision(); if (commit != null) { html.div() .write("Test Suite Revision: ") .a(href("https://github.com/w3c/ldp-testsuite/commit/" + commit)).content(commit)._div(); } DateFormat dateFormat = DateFormat.getDateInstance(DateFormat.MEDIUM, Locale.ENGLISH); html.div().content("Updated: " + dateFormat.format(new Date())); // Generate the summary diagrams and information createSummaryReport(); toTop(); // Go through all the classes and generate details of each test case for (@SuppressWarnings("rawtypes") Class testcaseClass: testClasses) { writeTestCasesForClass(testcaseClass); } }
@Override public void renderOn(HtmlCanvas html) throws IOException { html.render(DocType.HTML5) .html() .head() .render(new Head()) .title().content(templateDescriptor.getDefaultTitle()) ._head() .body() .render(new BodyStart()) .render(this.component) .render(new BodyEnd()) ._body() ._html(); }
private void displayResultsOnCanvas(StateSpaceExplorer.StateSpaceExplorerResults results) throws IOException, StateSpaceLoaderException { HtmlCanvas html = new HtmlCanvas(); html.html().head(); html.style(type("text/css").media("screen")).content(HTML_STYLE); html._head(); html.body(); if (results.numberOfStates < MAX_DISPLAY_STATES) { StateSpaceLoader.Results stateSpace = stateSpaceLoader.loadStateSpace(); solveSteadyState(stateSpace.records, stateSpace.stateMappings, html); } else { html.write("State space is too large to show tabular results"); html.br(); html.write("Number of states: " + results.numberOfStates); html.br(); html.write("Number of transitions: " + results.processedTransitions); } html._body()._html(); resultsPane.setText(html.toHtml()); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container-fluid")) .div(class_("row")) .render(new MenuBar()) ._div() .div(class_("row")) .div(class_("col-lg-6 max-height")) .h5().content(fSrc.getName()) .pre(class_("pre max-height")).content(diffs.getSrcDiff(), false) ._div() .div(class_("col-lg-6 max-height")) .h5().content(fDst.getName()) .pre(class_("pre max-height")).content(diffs.getDstDiff(), false) ._div() ._div() ._div() .render(new BootstrapFooterView()) .macros().javascript("/dist/diff.js") ._body() ._html(); }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container-fluid")) .div(class_("row")) .render(new MenuBar()) ._div() .div(class_("row")) .div(class_("col-lg-6 max-height")) .h5().content(fSrc.getName()) .pre(class_("pre max-height")).content(diffs.getSrcDiff(), false) ._div() .div(class_("col-lg-6 max-height")) .h5().content(fDst.getName()) .pre(class_("pre max-height")).content(diffs.getDstDiff(), false) ._div() ._div() ._div() .render(new BootstrapFooterView()) .macros().javascript("/dist/diff.js") ._body() ._html(); }
.html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container")) .div(class_("row"))
.html(lang("en")) .render(new BootstrapHeaderView()) .body() .div(class_("container")) .div(class_("row"))
.style().write("body {padding-top: 70px;}")._style() ._head() .body() .nav(class_("navbar navbar-inverse navbar-fixed-top").style("background:#0A3F54")) .div(class_("container"))
.body(); html.h1().content(LdpTestSuite.NAME + " Summary");
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .head() .meta(charset("utf8")) .meta(name("viewport").content("width=device-width, initial-scale=1.0")) .title().content("GumTree") .macros().javascript("/dist/jquery.min.js") .macros().javascript("/dist/codemirror.min.js") .macros().stylesheet("/dist/codemirror.css") .macros().javascript("/dist/mergely.min.js") .macros().javascript("/dist/mergely_shortcuts.js") .macros().stylesheet("/dist/mergely.css") .macros().stylesheet("/dist/mergely_custom.css") ._head() .body() .div(id("compare")) ._div() .macros().script("lhs_url = \"/left/" + id + "\";") .macros().script("rhs_url = \"/right/" + id + "\";") .macros().javascript("/dist/mergely_ajax.js") ._body() ._html(); } }
@Override public void renderOn(HtmlCanvas html) throws IOException { html .render(DocType.HTML5) .html(lang("en")) .head() .meta(charset("utf8")) .meta(name("viewport").content("width=device-width, initial-scale=1.0")) .title().content("GumTree") .macros().javascript("/dist/jquery.min.js") .macros().javascript("/dist/codemirror.min.js") .macros().stylesheet("/dist/codemirror.css") .macros().javascript("/dist/mergely.min.js") .macros().javascript("/dist/mergely_shortcuts.js") .macros().stylesheet("/dist/mergely.css") .macros().stylesheet("/dist/mergely_custom.css") ._head() .body() .div(id("compare")) ._div() .macros().script("lhs_url = \"/left/" + id + "\";") .macros().script("rhs_url = \"/right/" + id + "\";") .macros().javascript("/dist/mergely_ajax.js") ._body() ._html(); } }