use of alluxio.client.file.FileSystemMasterClient in project alluxio by Alluxio.
the class LineageFileOutStreamTest method persistHandledByMaster.
@Test
public void persistHandledByMaster() throws Exception {
FileSystemContext context = PowerMockito.mock(FileSystemContext.class);
FileSystemMasterClient client = PowerMockito.mock(FileSystemMasterClient.class);
Mockito.when(context.acquireMasterClientResource()).thenReturn(new DummyCloseableResource<>(client));
LineageFileOutStream stream = new LineageFileOutStream(context, new AlluxioURI("/path"), OutStreamOptions.defaults().setWriteType(WriteType.ASYNC_THROUGH));
stream.close();
// The lineage file out stream doesn't manage asynchronous persistence.
Mockito.verify(client, Mockito.times(0)).scheduleAsyncPersist(new AlluxioURI("/path"));
}
use of alluxio.client.file.FileSystemMasterClient in project alluxio by Alluxio.
the class LineageFileSystemTest method before.
/**
* Sets up all dependencies before running a test.
*/
@Before
public void before() throws Exception {
mLineageMasterClient = PowerMockito.mock(LineageMasterClient.class);
mLineageContext = PowerMockito.mock(LineageContext.class);
FileSystemContext fileSystemContext = PowerMockito.mock(FileSystemContext.class);
Mockito.when(mLineageContext.acquireMasterClient()).thenReturn(mLineageMasterClient);
FileSystemMasterClient fileSystemMasterClient = PowerMockito.mock(FileSystemMasterClient.class);
Mockito.when(fileSystemContext.acquireMasterClient()).thenReturn(fileSystemMasterClient);
Mockito.when(fileSystemMasterClient.getStatus(Mockito.any(AlluxioURI.class))).thenReturn(new URIStatus(new FileInfo()));
mAlluxioLineageFileSystem = LineageFileSystem.get(fileSystemContext, mLineageContext);
}
Aggregations