use of org.apache.distributedlog.api.LogReader in project incubator-pulsar by apache.
the class DLInputStreamTest method testClose.
/**
* Test Case: close the input stream
*/
@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();
}
Aggregations