OperationalReport extends Report { public String getHTMLRendering() throws IOException { List<ResultSet> data = getReportGenerator().generateData(this); StringBuffer sb = new StringBuffer(); sb.append("<b>" + this.getName() + "</b><br><br>"); sb.append(data.size() + " results:"); if(data == null || data.size() == 0){ } else { sb.append("<table border=\"1\" cellspacing=\"0\">\n"); sb.append("<b><tr>"); for(String title : data.get(0).getColumnHTMLNames()){ sb.append("<th>" + title + "</th>"); } sb.append("</tr></b>"); for(ResultSet rs : data){ sb.append("<tr>"); String[] fields = rs.getDisplayableFields(); for(int i=0; i<fields.length; i++){ sb.append("<td>"); sb.append(fields[i] == null || fields[i].equals("") ? "&nbsp;" : fields[i]); sb.append("</td>"); } sb.append("</tr>\n"); } sb.append("</table>\n"); } return sb.toString(); } OperationalReport();  OperationalReport(String name, String info, List<Parameter> parameters, ReportGenerator reportGenerator); String getRendering(String format); String getHTMLRendering(); void getDownloadRendering(HttpServletRequest req, HttpServletResponse resp, String fileName, String format); void getDownloadRendering(HttpServletRequest req, HttpServletResponse resp, String fileName, String format, String destinationURL);  }
@Test public final void testGetHTMLRendering() { testOperationalReport(); try { String output = testInstance.getHTMLRendering(); assertEquals(output, expectedHTMLOutput); } catch(Exception e) { fail(e.getMessage()); } }