use of alluxio.client.file.options.GetStatusOptions in project alluxio by Alluxio.
the class BaseFileSystemTest method getStatusException.
/**
* Ensures that an exception is propagated correctly when retrieving information.
*/
@Test
public void getStatusException() throws Exception {
AlluxioURI file = new AlluxioURI("/file");
Mockito.when(mFileSystemMasterClient.getStatus(file)).thenThrow(EXCEPTION);
GetStatusOptions getStatusOptions = GetStatusOptions.defaults();
try {
mFileSystem.getStatus(file, getStatusOptions);
Assert.fail(SHOULD_HAVE_PROPAGATED_MESSAGE);
} catch (Exception e) {
Assert.assertSame(EXCEPTION, e);
}
}
use of alluxio.client.file.options.GetStatusOptions in project alluxio by Alluxio.
the class BaseFileSystemTest method getStatus.
/**
* Tests for the {@link BaseFileSystem#getStatus(AlluxioURI, GetStatusOptions)} method.
*/
@Test
public void getStatus() throws Exception {
AlluxioURI file = new AlluxioURI("/file");
URIStatus status = new URIStatus(new FileInfo());
Mockito.when(mFileSystemMasterClient.getStatus(file)).thenReturn(status);
GetStatusOptions getStatusOptions = GetStatusOptions.defaults();
Assert.assertSame(status, mFileSystem.getStatus(file, getStatusOptions));
Mockito.verify(mFileSystemMasterClient).getStatus(file);
}
Aggregations