@Test public void translatesToContent() { Symbol symbol = new Symbol(releaseSymbolType); symbol.putProperty(ReleaseSymbolType.OptionType.RELEASE.name(), "20121220"); String html = releaseSymbolType.toTarget(null, symbol); assertTrue(html.contains("<h3>release \n" + "\t<a href=\"\">20121220</a>\n" + "</h3>")); assertTrue(html.contains("<a href=\"/fitnesse-standalone.jar?responder=releaseDownload&release=20121220\">")); }
@Override public String toTarget(Translator translator, Symbol symbol) { Release release; try { release = new Release(symbol.getProperty(OptionType.RELEASE.name())); } catch (Exception e) { return "<strong>Malformed release: " + e.getMessage() + "</strong>"; } String href = symbol.getProperty(OptionType.HREF.name()); TagGroup html = new TagGroup(); addTitle(html, release, href); if (release.exists()) { addFilesHtml(html, release); release.saveInfo(); } else html.add("The release directory could not be found."); return html.html(); }
ReleaseSymbolType extends SymbolType implements Rule, Translation { @Override public String toTarget(Translator translator, Symbol symbol) { Release release; try { release = new Release(symbol.getProperty(OptionType.RELEASE.name())); } catch (Exception e) { return "<strong>Malformed release: " + e.getMessage() + "</strong>"; } String href = symbol.getProperty(OptionType.HREF.name()); TagGroup html = new TagGroup(); addTitle(html, release, href); if (release.exists()) { addFilesHtml(html, release); release.saveInfo(); } else html.add("The release directory could not be found."); return html.html(); } }
ReleaseSymbolType extends SymbolType implements Rule, Translation { @Override public String toTarget(Translator translator, Symbol symbol) { Release release; try { release = new Release(symbol.getProperty(OptionType.RELEASE.name())); } catch (Exception e) { return "<strong>Malformed release: " + e.getMessage() + "</strong>"; } String href = symbol.getProperty(OptionType.HREF.name()); TagGroup html = new TagGroup(); addTitle(html, release, href); if (release.exists()) { addFilesHtml(html, release); release.saveInfo(); } else html.add("The release directory could not be found."); return html.html(); } ReleaseSymbolType(); }
ReleaseSymbolType extends SymbolType implements Rule, Translation { @Override public String toTarget(Translator translator, Symbol symbol) { Release release; try { release = new Release(symbol.getProperty(OptionType.RELEASE.name())); } catch (Exception e) { return "<strong>Malformed release: " + e.getMessage() + "</strong>"; } String href = symbol.getProperty(OptionType.HREF.name()); TagGroup html = new TagGroup(); addTitle(html, release, href); if (release.exists()) { addFilesHtml(html, release); release.saveInfo(); } else html.add("The release directory could not be found."); return html.html(); } ReleaseSymbolType(); @Override Maybe<Symbol> parse(Symbol current, Parser parser); @Override String toTarget(Translator translator, Symbol symbol); }
ReleaseSymbolType extends SymbolType implements Rule, Translation { @Override public String toTarget(Translator translator, Symbol symbol) { Release release; try { release = new Release(symbol.getProperty(OptionType.RELEASE.name())); } catch (Exception e) { return "<strong>Malformed release: " + e.getMessage() + "</strong>"; } String href = symbol.getProperty(OptionType.HREF.name()); TagGroup html = new TagGroup(); addTitle(html, release, href); if (release.exists()) { addFilesHtml(html, release); release.saveInfo(); } else html.add("The release directory could not be found."); return html.html(); } ReleaseSymbolType(); @Override Maybe<Symbol> parse(Symbol current, Parser parser); @Override String toTarget(Translator translator, Symbol symbol);  }