use of com.twitter.heron.dlog.DLInputStream in project incubator-heron by apache.
the class DLDownloaderTest method testOpenInputStream.
@Test
public void testOpenInputStream() throws Exception {
Namespace ns = mock(Namespace.class);
DistributedLogManager dlm = mock(DistributedLogManager.class);
LogReader reader = mock(LogReader.class);
when(ns.openLog(anyString())).thenReturn(dlm);
when(dlm.getInputStream(eq(DLSN.InitialDLSN))).thenReturn(reader);
InputStream is = DLDownloader.openInputStream(ns, "test-open-inputstream");
assertTrue(is instanceof DLInputStream);
is.close();
verify(dlm, times(1)).close();
verify(reader, times(1)).close();
}
Aggregations