@Test public void testClose() throws Exception { DistributedLogManager dlm = mock(DistributedLogManager.class); LogReader reader = mock(LogReader.class); when(dlm.getInputStream(any(DLSN.class))).thenReturn(reader); DLInputStream in = new DLInputStream(dlm); verify(dlm, times(1)).getInputStream(eq(DLSN.InitialDLSN)); in.close(); verify(dlm, times(1)).close(); verify(reader, times(1)).close(); }
@Override public void close() throws IOException { reader.close(); dlm.close(); }
DLInputStream extends InputStream { @Override public void close() throws IOException { reader.close(); dlm.close(); } }
DLInputStream extends InputStream { @Override public void close() throws IOException { reader.close(); dlm.close(); } DLInputStream(DistributedLogManager dlm); }
DLInputStream extends InputStream { @Override public void close() throws IOException { reader.close(); dlm.close(); } DLInputStream(DistributedLogManager dlm); @Override int read(); @Override int read(byte[] b, int off, int len); @Override void close(); }
DLInputStream extends InputStream { @Override public void close() throws IOException { reader.close(); dlm.close(); } DLInputStream(DistributedLogManager dlm); @Override int read(); @Override int read(byte[] b, int off, int len); @Override void close();  }