HtmlFileViewer extends HdfsFileViewer { @Override public void displayFile(final FileSystem fs, final Path path, final OutputStream outputStream, final int startLine, final int endLine) throws IOException { if (logger.isDebugEnabled()) logger.debug("read in uncompressed html file"); TextFileViewer.displayFileContent(fs, path, outputStream, startLine, Integer.MAX_VALUE, BUFFER_LIMIT); } HtmlFileViewer(); @Override String getName(); @Override Set<Capability> getCapabilities(final FileSystem fs, final Path path); @Override void displayFile(final FileSystem fs, final Path path, final OutputStream outputStream,
      final int startLine, final int endLine); @Override ContentType getContentType();  }
@Test public void testEmptyFile() throws IOException { final ByteArrayOutputStream outStream = new ByteArrayOutputStream(); this.viewer.displayFile(this.fs, getResourcePath(EMPTY_HTM), outStream, 1, 2); final String output = outStream.toString(); assertTrue(output.isEmpty()); }
@Test @SuppressWarnings("DefaultCharset") public void testValidHtmlFile() throws IOException { final ByteArrayOutputStream outStream = new ByteArrayOutputStream(); this.viewer.displayFile(this.fs, getResourcePath(VALID_HTML), outStream, 1, 2); final String output = new String(outStream.toByteArray()); assertEquals(output, "<p>file content</p>\n"); }