@Test public void check_If_Html_Contains_FitNesse_Information() throws FileNotFoundException { ProjectDependencyInfo projectDependencyInfo = new ProjectDependencyInfo("/src/test/resources/MavenVersions/pom.xml"); String receivedValue = MavenProjectVersionsSymbol.getVersionTableHtmlAsString(projectDependencyInfo.getDependencyInfo()); String expectedValue = "<tr><td>fitnesse</td>" + System.lineSeparator() + "<td>20200404</td>" + System.lineSeparator() + "<td>20200501</td>" + System.lineSeparator() + "<td class=\"Outdated\">Outdated</td>"; String expectedValue2 = "<a href=\"http: assertThat(receivedValue).contains(expectedValue); assertThat(receivedValue).contains(expectedValue2); }
public static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList) { HtmlWriter writer = new HtmlWriter(); writer.startTag("table"); writer.putAttribute("id", "versioncheck"); writer.startTag("tr"); writer.startTag("th"); writer.putAttribute("colspan", "5"); writer.putText("Versioncheck"); writer.endTag(); writer.endTag(); List<String> tableHeaders = Arrays.asList("Name", "Current version", "Newest Version", "Status", "Release notes"); writer.startTag("tr"); for (String tableHeader : tableHeaders) { writer.putText(generateTableRowTdHtmlAsString(tableHeader, null)); } writer.endTag(); for (DependencyInfo dependency : dependencyList) { writer.putText(generateTableRowHtmlAsString(dependency)); } writer.endTag(); return writer.toHtml(); }
MavenProjectVersionsSymbol extends SymbolType implements Rule, Translation { public static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList) { HtmlWriter writer = new HtmlWriter(); writer.startTag("table"); writer.putAttribute("id", "versioncheck"); writer.startTag("tr"); writer.startTag("th"); writer.putAttribute("colspan", "5"); writer.putText("Versioncheck"); writer.endTag(); writer.endTag(); List<String> tableHeaders = Arrays.asList("Name", "Current version", "Newest Version", "Status", "Release notes"); writer.startTag("tr"); for (String tableHeader : tableHeaders) { writer.putText(generateTableRowTdHtmlAsString(tableHeader, null)); } writer.endTag(); for (DependencyInfo dependency : dependencyList) { writer.putText(generateTableRowHtmlAsString(dependency)); } writer.endTag(); return writer.toHtml(); } }
MavenProjectVersionsSymbol extends SymbolType implements Rule, Translation { public static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList) { HtmlWriter writer = new HtmlWriter(); writer.startTag("table"); writer.putAttribute("id", "versioncheck"); writer.startTag("tr"); writer.startTag("th"); writer.putAttribute("colspan", "5"); writer.putText("Versioncheck"); writer.endTag(); writer.endTag(); List<String> tableHeaders = Arrays.asList("Name", "Current version", "Newest Version", "Status", "Release notes"); writer.startTag("tr"); for (String tableHeader : tableHeaders) { writer.putText(generateTableRowTdHtmlAsString(tableHeader, null)); } writer.endTag(); for (DependencyInfo dependency : dependencyList) { writer.putText(generateTableRowHtmlAsString(dependency)); } writer.endTag(); return writer.toHtml(); } MavenProjectVersionsSymbol(); }
MavenProjectVersionsSymbol extends SymbolType implements Rule, Translation { public static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList) { HtmlWriter writer = new HtmlWriter(); writer.startTag("table"); writer.putAttribute("id", "versioncheck"); writer.startTag("tr"); writer.startTag("th"); writer.putAttribute("colspan", "5"); writer.putText("Versioncheck"); writer.endTag(); writer.endTag(); List<String> tableHeaders = Arrays.asList("Name", "Current version", "Newest Version", "Status", "Release notes"); writer.startTag("tr"); for (String tableHeader : tableHeaders) { writer.putText(generateTableRowTdHtmlAsString(tableHeader, null)); } writer.endTag(); for (DependencyInfo dependency : dependencyList) { writer.putText(generateTableRowHtmlAsString(dependency)); } writer.endTag(); return writer.toHtml(); } MavenProjectVersionsSymbol(); @Override Maybe<Symbol> parse(Symbol current, Parser parser); @Override String toTarget(Translator translator, Symbol symbol); static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList); }
MavenProjectVersionsSymbol extends SymbolType implements Rule, Translation { public static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList) { HtmlWriter writer = new HtmlWriter(); writer.startTag("table"); writer.putAttribute("id", "versioncheck"); writer.startTag("tr"); writer.startTag("th"); writer.putAttribute("colspan", "5"); writer.putText("Versioncheck"); writer.endTag(); writer.endTag(); List<String> tableHeaders = Arrays.asList("Name", "Current version", "Newest Version", "Status", "Release notes"); writer.startTag("tr"); for (String tableHeader : tableHeaders) { writer.putText(generateTableRowTdHtmlAsString(tableHeader, null)); } writer.endTag(); for (DependencyInfo dependency : dependencyList) { writer.putText(generateTableRowHtmlAsString(dependency)); } writer.endTag(); return writer.toHtml(); } MavenProjectVersionsSymbol(); @Override Maybe<Symbol> parse(Symbol current, Parser parser); @Override String toTarget(Translator translator, Symbol symbol); static String getVersionTableHtmlAsString(List<DependencyInfo> dependencyList);  }