use of org.apache.hadoop.yarn.server.api.protocolrecords.impl.pb.RunSharedCacheCleanerTaskResponsePBImpl in project hadoop by apache.
the class TestSCMAdminProtocolService method testRunCleanerTaskCLI.
@Test
public void testRunCleanerTaskCLI() throws Exception {
String[] args = { "-runCleanerTask" };
RunSharedCacheCleanerTaskResponse rp = new RunSharedCacheCleanerTaskResponsePBImpl();
rp.setAccepted(true);
when(mockAdmin.runCleanerTask(isA(RunSharedCacheCleanerTaskRequest.class))).thenReturn(rp);
assertEquals(0, adminCLI.run(args));
rp.setAccepted(false);
when(mockAdmin.runCleanerTask(isA(RunSharedCacheCleanerTaskRequest.class))).thenReturn(rp);
assertEquals(1, adminCLI.run(args));
verify(mockAdmin, times(2)).runCleanerTask(any(RunSharedCacheCleanerTaskRequest.class));
}
Aggregations