YARN-6385. Fix checkstyle warnings in TestFileSystemApplicationHistoryStore
Signed-off-by: Akira Ajisaka <aajisaka@apache.org>
(cherry picked from commit 3265b55119
)
This commit is contained in:
parent
cacd267b0d
commit
2741af505f
|
@ -272,20 +272,20 @@ public class TestFileSystemApplicationHistoryStore extends
|
||||||
tearDown();
|
tearDown();
|
||||||
|
|
||||||
// Setup file system to inject startup conditions
|
// Setup file system to inject startup conditions
|
||||||
FileSystem fs = spy(new RawLocalFileSystem());
|
FileSystem fileSystem = spy(new RawLocalFileSystem());
|
||||||
FileStatus fileStatus = Mockito.mock(FileStatus.class);
|
FileStatus fileStatus = Mockito.mock(FileStatus.class);
|
||||||
doReturn(true).when(fileStatus).isDirectory();
|
doReturn(true).when(fileStatus).isDirectory();
|
||||||
doReturn(fileStatus).when(fs).getFileStatus(any(Path.class));
|
doReturn(fileStatus).when(fileSystem).getFileStatus(any(Path.class));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initAndStartStore(fs);
|
initAndStartStore(fileSystem);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
Assert.fail("Exception should not be thrown: " + e);
|
Assert.fail("Exception should not be thrown: " + e);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Make sure that directory creation was not attempted
|
// Make sure that directory creation was not attempted
|
||||||
verify(fileStatus, never()).isDirectory();
|
verify(fileStatus, never()).isDirectory();
|
||||||
verify(fs, times(1)).mkdirs(any(Path.class));
|
verify(fileSystem, times(1)).mkdirs(any(Path.class));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
@ -294,14 +294,14 @@ public class TestFileSystemApplicationHistoryStore extends
|
||||||
tearDown();
|
tearDown();
|
||||||
|
|
||||||
// Setup file system to inject startup conditions
|
// Setup file system to inject startup conditions
|
||||||
FileSystem fs = spy(new RawLocalFileSystem());
|
FileSystem fileSystem = spy(new RawLocalFileSystem());
|
||||||
FileStatus fileStatus = Mockito.mock(FileStatus.class);
|
FileStatus fileStatus = Mockito.mock(FileStatus.class);
|
||||||
doReturn(false).when(fileStatus).isDirectory();
|
doReturn(false).when(fileStatus).isDirectory();
|
||||||
doReturn(fileStatus).when(fs).getFileStatus(any(Path.class));
|
doReturn(fileStatus).when(fileSystem).getFileStatus(any(Path.class));
|
||||||
doThrow(new IOException()).when(fs).mkdirs(any(Path.class));
|
doThrow(new IOException()).when(fileSystem).mkdirs(any(Path.class));
|
||||||
|
|
||||||
try {
|
try {
|
||||||
initAndStartStore(fs);
|
initAndStartStore(fileSystem);
|
||||||
Assert.fail("Exception should have been thrown");
|
Assert.fail("Exception should have been thrown");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// Expected failure
|
// Expected failure
|
||||||
|
@ -309,6 +309,6 @@ public class TestFileSystemApplicationHistoryStore extends
|
||||||
|
|
||||||
// Make sure that directory creation was attempted
|
// Make sure that directory creation was attempted
|
||||||
verify(fileStatus, never()).isDirectory();
|
verify(fileStatus, never()).isDirectory();
|
||||||
verify(fs, times(1)).mkdirs(any(Path.class));
|
verify(fileSystem, times(1)).mkdirs(any(Path.class));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue