use of alluxio.client.file.MockFileOutStream in project alluxio by Alluxio.
the class MigrateDefinitionRunTaskTest method before.
@Before
public void before() throws Exception {
AlluxioConfiguration conf = ConfigurationTestUtils.defaults();
mMockFileSystem = Mockito.mock(FileSystem.class);
mMockFileSystemContext = PowerMockito.mock(FileSystemContext.class);
when(mMockFileSystemContext.getClientContext()).thenReturn(ClientContext.create(conf));
when(mMockFileSystemContext.getClusterConf()).thenReturn(conf);
when(mMockFileSystemContext.getPathConf(any(AlluxioURI.class))).thenReturn(conf);
mMockInStream = new MockFileInStream(TEST_SOURCE_CONTENTS);
when(mMockFileSystem.openFile(eq(new AlluxioURI(TEST_SOURCE)), any(OpenFilePOptions.class))).thenReturn(mMockInStream);
mMockOutStream = new MockFileOutStream(mMockFileSystemContext);
when(mMockFileSystem.createFile(eq(new AlluxioURI(TEST_DESTINATION)), any(CreateFilePOptions.class))).thenReturn(mMockOutStream);
mMockUfsManager = Mockito.mock(UfsManager.class);
}
Aggregations