NamenodeJspHelper { static void generateSnapshotReport(JspWriter out, FSNamesystem fsn) throws IOException { if (fsn == null) { return; } out.println("<div id=\"snapshotstats\"><div class=\"dfstable\">" + "<table class=\"storage\" title=\"Snapshot Summary\">\n" + "<thead><tr><td><b>Snapshottable directories</b></td>" + "<td><b>Snapshotted directories</b></td></tr></thead>"); out.println(String.format("<td>%d</td><td>%d</td>", fsn.getNumSnapshottableDirs(), fsn.getNumSnapshots())); out.println("</table></div></div>"); }    }
@Test public void testGenerateSnapshotReportNullNamesystem() throws Exception { NamenodeJspHelper.generateSnapshotReport(mock(JspWriter.class), null); }